Patrick, PTAL @ all
Michael, PTAL @ profiler and compiler
TNode<Object> CodeStubAssembler::GetConstructor(TNode<Map> map) {There were two unused copies of `GetConstructor` logic in CSA and a third version in `CallOrConstructBuiltinsAssembler::GetCompatibleReceiver()`.
}This is the bottleneck for setting constructor name for both prototypes created by bootstrapper and lazily created prototype objects for user code.
kDontAdapt);Pass the hole as a prototype to let it setup everything properly.
The `#ifdef DEBUG` block is 11 years old and is not relevant anymore.
Using the `class_name` here just for clarity. It'll be overwritten during context serialization anyway.
v8_flags.harmony_struct);This check was incorrect incomplete, there are other legitimate cases. I updated the comment.
CHECK(!i::V8HeapExplorer::GetConstructor(i_isolate, *js_obj5).is_null());Now we are able to figure out the constructor function (it's `Object`).
description : Object`Object.create([1,2])` is an `Object` and not an `Array`.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
📍 Job linux-r350-perf/speedometer3.crossbench complete.
See results at: https://pinpoint-dot-chromeperf.appspot.com/job/11761620c90000
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
📍 Job mac-m1_mini_2020-perf/speedometer3.crossbench complete.
See results at: https://pinpoint-dot-chromeperf.appspot.com/job/137ee094c90000
📍 Job mac-m4-mini-perf/speedometer3.crossbench complete.
See results at: https://pinpoint-dot-chromeperf.appspot.com/job/104f9d2ac90000
📍 Job mac-m1_mini_2020-perf/jetstream3.crossbench complete.
See results at: https://pinpoint-dot-chromeperf.appspot.com/job/14b86442c90000
📍 Job mac-m4-mini-perf/jetstream3.crossbench complete.
See results at: https://pinpoint-dot-chromeperf.appspot.com/job/12055148c90000
📍 Job linux-r350-perf/jetstream3.crossbench complete.
See results at: https://pinpoint-dot-chromeperf.appspot.com/job/142f03ecc90000
| Code-Review | +1 |
LGTM
- no the need to deal with JSGlobalObject in order to figure out```suggestion
- no need to deal with JSGlobalObject in order to figure out
```
TNode<Object> CodeStubAssembler::GetConstructor(TNode<Map> map) {There were two unused copies of `GetConstructor` logic in CSA and a third version in `CallOrConstructBuiltinsAssembler::GetCompatibleReceiver()`.
Acknowledged
// Turn it to prototype mode since the next the caller will do is to```suggestion
// Turn it to prototype mode since the next caller will
```
This is the bottleneck for setting constructor name for both prototypes created by bootstrapper and lazily created prototype objects for user code.
Acknowledged
kDontAdapt);Pass the hole as a prototype to let it setup everything properly.
The `#ifdef DEBUG` block is 11 years old and is not relevant anymore.
Using the `class_name` here just for clarity. It'll be overwritten during context serialization anyway.
Can you please add a comment explaining why the hole is used as prototype here?
v8_flags.harmony_struct);This check was incorrect incomplete, there are other legitimate cases. I updated the comment.
Acknowledged
!constructor_name->Equals(ReadOnlyRoots(isolate).Object_string())) {Do we need to check string equality here?
description : Object`Object.create([1,2])` is an `Object` and not an `Array`.
Acknowledged
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
- no the need to deal with JSGlobalObject in order to figure out```suggestion
- no need to deal with JSGlobalObject in order to figure out
```
Done
// Turn it to prototype mode since the next the caller will do is to```suggestion
// Turn it to prototype mode since the next caller will
```
Done
kDontAdapt);Patrick ThierPass the hole as a prototype to let it setup everything properly.
The `#ifdef DEBUG` block is 11 years old and is not relevant anymore.
Using the `class_name` here just for clarity. It'll be overwritten during context serialization anyway.
Can you please add a comment explaining why the hole is used as prototype here?
I added the explanatory comment to `CreateFunctionForBuiltinWithPrototype` which is used in a couple of other places in this file.
!constructor_name->Equals(ReadOnlyRoots(isolate).Object_string())) {Do we need to check string equality here?
Yes. Empty name and "Object" name are considered too generic, so we want to query `Symbol.toStringTag` property in a hope to find a nicer name.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
CHECK(!i::V8HeapExplorer::GetConstructor(i_isolate, *js_obj5).is_null());Now we are able to figure out the constructor function (it's `Object`).
Acknowledged
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
22 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: src/diagnostics/objects-debug.cc
Insertions: 0, Deletions: 2.
@@ -863,7 +863,6 @@
CHECK(IsJSFunction(tuple->value1()));
CHECK(IsString(tuple->value2()));
} else {
- CHECK(new_target_is_base());
CHECK(IsJSFunction(maybe_constructor) ||
IsFunctionTemplateInfo(maybe_constructor) ||
IsString(maybe_constructor) ||
@@ -872,7 +871,6 @@
Context::EMPTY_FUNCTION_INDEX)));
CHECK_IMPLIES(IsString(maybe_constructor), is_prototype_map());
}
- CHECK_IMPLIES(!new_target_is_base(), IsTuple2(maybe_constructor));
}
}
```
[runtime] Improve derived class name inference
... by recording the value of new.target's function name along side the
constructor value in a Tuple2 stored in initial map's constructor field.
This simplifies the constructor name deduction logic which
a) used to query obj.prototype.constructor's name in attempt to figure
out the name of the derived class,
b) did not respect cross-origin boundaries when it did (a).
Other benefits:
- this also allows to free Map::new_target_is_base bit because the
derived case can be detected simply by checking
IsTuple2(map->GetConstructorRaw()).
- no need to deal with JSGlobalObject in order to figure out
JSGlobalProxy's class name - the class name is now copied from
global object's constructor template to global proxy's
constructor template.
Drive-by: report Proxy objects as "Object" or "Function" to make them
indistinguishable from regular Objects/Functions in stack traces.
NO_IFTTT=Introducing IFTTT for Map::GetConstructor() implementation.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |