GeezerVison is showing github.com — deps: V8: cherry-pick a1efa5343880 · nodejs/node@0c40b51
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: common.gypi +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
36 | 36 |
|
37 | 37 | # Reset this number to 0 on major V8 upgrades. |
38 | 38 | # Increment by one for each non-official patch applied to deps/v8. |
39 | | - 'v8_embedder_string': '-node.20', |
| 39 | + 'v8_embedder_string': '-node.21', |
40 | 40 |
|
41 | 41 | ##### V8 defaults for Node.js ##### |
42 | 42 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: deps/v8/src/objects/js-function.cc +6Lines changed: 6 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -676,6 +676,10 @@ void SetInstancePrototype(Isolate* isolate, Handle<JSFunction> function, |
676 | 676 | // At that point, a new initial map is created and the prototype is put |
677 | 677 | // into the initial map where it belongs. |
678 | 678 | function->set_prototype_or_initial_map(*value, kReleaseStore); |
| 679 | + if (value->IsJSObjectThatCanBeTrackedAsPrototype()) { |
| 680 | + // Optimize as prototype to detach it from its transition tree. |
| 681 | + JSObject::OptimizeAsPrototype(Handle<JSObject>::cast(value)); |
| 682 | + } |
679 | 683 | } else { |
680 | 684 | Handle<Map> new_map = |
681 | 685 | Map::Copy(isolate, initial_map, "SetInstancePrototype"); |
@@ -801,8 +805,10 @@ void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) { |
801 | 805 | Handle<HeapObject> prototype; |
802 | 806 | if (function->has_instance_prototype()) { |
803 | 807 | prototype = handle(function->instance_prototype(), isolate); |
| 808 | + map->set_prototype(*prototype); |
804 | 809 | } else { |
805 | 810 | prototype = isolate->factory()->NewFunctionPrototype(function); |
| 811 | + Map::SetPrototype(isolate, map, prototype); |
806 | 812 | } |
807 | 813 | DCHECK(map->has_fast_object_elements()); |
808 | 814 |
|
|