| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 91cf835 commit 696ce7d
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,7 +36,7 @@ | |||
| 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.10', | ||
| 39 | + 'v8_embedder_string': '-node.11', | ||
| 40 | 40 | ||
| 41 | 41 | ##### V8 defaults for Node.js ##### | |
| 42 | 42 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1296,13 +1296,16 @@ void AccessorAssembler::HandleStoreICHandlerCase( | |||
| 1296 | 1296 | if (ic_mode == ICMode::kGlobalIC) { | |
| 1297 | 1297 | TailCallRuntime(Runtime::kStoreGlobalIC_Slow, p->context(), p->value(), | |
| 1298 | 1298 | p->slot(), p->vector(), p->receiver(), p->name()); | |
| 1299 | - } else if (p->IsStoreOwn()) { | ||
| 1300 | - TailCallRuntime(Runtime::kStoreDataPropertyInLiteral, p->context(), | ||
| 1301 | - p->receiver(), p->name(), p->value()); | ||
| 1302 | 1299 | } else { | |
| 1303 | - TailCallRuntime(p->IsDefineOwn() ? Runtime::kKeyedDefineOwnIC_Slow | ||
| 1304 | - : Runtime::kKeyedStoreIC_Slow, | ||
| 1305 | - p->context(), p->value(), p->receiver(), p->name()); | ||
| 1300 | + Runtime::FunctionId id; | ||
| 1301 | + if (p->IsStoreOwn()) { | ||
| 1302 | + id = Runtime::kStoreOwnIC_Slow; | ||
| 1303 | + } else if (p->IsDefineOwn()) { | ||
| 1304 | + id = Runtime::kKeyedDefineOwnIC_Slow; | ||
| 1305 | + } else { | ||
| 1306 | + id = Runtime::kKeyedStoreIC_Slow; | ||
| 1307 | + } | ||
| 1308 | + TailCallRuntime(id, p->context(), p->value(), p->receiver(), p->name()); | ||
| 1306 | 1309 | } | |
| 1307 | 1310 | } | |
| 1308 | 1311 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2751,6 +2751,27 @@ RUNTIME_FUNCTION(Runtime_StoreOwnIC_Miss) { | |||
| 2751 | 2751 | RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | |
| 2752 | 2752 | } | |
| 2753 | 2753 | ||
| 2754 | + RUNTIME_FUNCTION(Runtime_StoreOwnIC_Slow) { | ||
| 2755 | + HandleScope scope(isolate); | ||
| 2756 | + DCHECK_EQ(3, args.length()); | ||
| 2757 | + | ||
| 2758 | + Handle<Object> value = args.at(0); | ||
| 2759 | + Handle<Object> object = args.at(1); | ||
| 2760 | + Handle<Object> key = args.at(2); | ||
| 2761 | + | ||
| 2762 | + // Unlike DefineOwn, StoreOwn doesn't handle private fields and is used for | ||
| 2763 | + // defining data properties in object literals and defining public class | ||
| 2764 | + // fields. | ||
| 2765 | + DCHECK(!key->IsSymbol() || !Symbol::cast(*key).is_private_name()); | ||
| 2766 | + | ||
| 2767 | + PropertyKey lookup_key(isolate, key); | ||
| 2768 | + LookupIterator it(isolate, object, lookup_key, LookupIterator::OWN); | ||
| 2769 | + MAYBE_RETURN(JSObject::DefineOwnPropertyIgnoreAttributes( | ||
| 2770 | + &it, value, NONE, Nothing<ShouldThrow>()), | ||
| 2771 | + ReadOnlyRoots(isolate).exception()); | ||
| 2772 | + return *value; | ||
| 2773 | + } | ||
| 2774 | + | ||
| 2754 | 2775 | RUNTIME_FUNCTION(Runtime_StoreGlobalIC_Miss) { | |
| 2755 | 2776 | HandleScope scope(isolate); | |
| 2756 | 2777 | DCHECK_EQ(4, args.length()); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -638,6 +638,7 @@ namespace internal { | |||
| 638 | 638 | F(KeyedStoreIC_Miss, 5, 1) \ | |
| 639 | 639 | F(KeyedDefineOwnIC_Miss, 5, 1) \ | |
| 640 | 640 | F(StoreInArrayLiteralIC_Miss, 5, 1) \ | |
| 641 | + F(StoreOwnIC_Slow, 3, 1) \ | ||
| 641 | 642 | F(KeyedStoreIC_Slow, 3, 1) \ | |
| 642 | 643 | F(KeyedDefineOwnIC_Slow, 3, 1) \ | |
| 643 | 644 | F(LoadElementWithInterceptor, 2, 1) \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,15 @@ | |||
| 1 | + // Copyright 2021 the V8 project authors. All rights reserved. | ||
| 2 | + // Use of this source code is governed by a BSD-style license that can be | ||
| 3 | + // found in the LICENSE file. | ||
| 4 | + | ||
| 5 | + // Flags: --no-lazy-feedback-allocation | ||
| 6 | + | ||
| 7 | + { | ||
| 8 | + class C { | ||
| 9 | + x = Object.freeze(this); | ||
| 10 | + } | ||
| 11 | + // Call once to install slow handler. | ||
| 12 | + assertThrows(() => { new C(); }); | ||
| 13 | + // Hit the slow handler. | ||
| 14 | + assertThrows(() => { new C(); }); | ||
| 15 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments