From 983205d5fd18cea54990d1a975fd853a1ec947a4 Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Wed, 1 Oct 2014 11:53:29 +0000 Subject: [PATCH] Reland "Use symbols instead of hidden properties for i18n markers." R=dslomov@chromium.org Review URL: https://codereview.chromium.org/618213002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24362 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- include/v8.h | 2 +- src/arm/code-stubs-arm.cc | 10 +- src/arm64/code-stubs-arm64.cc | 10 +- src/factory.h | 8 ++ src/heap-snapshot-generator.cc | 3 + src/heap/heap.cc | 20 +--- src/heap/heap.h | 193 ++++++++++++++++++++----------------- src/hydrogen-instructions.cc | 3 + src/mips/code-stubs-mips.cc | 10 +- src/mips64/code-stubs-mips64.cc | 10 +- src/runtime/runtime-i18n.cc | 23 ++--- src/runtime/runtime.cc | 12 --- src/runtime/runtime.h | 1 - test/mjsunit/test-hidden-string.js | 11 --- 14 files changed, 154 insertions(+), 162 deletions(-) delete mode 100644 test/mjsunit/test-hidden-string.js diff --git a/include/v8.h b/include/v8.h index c9b3862..274dedb 100644 --- a/include/v8.h +++ b/include/v8.h @@ -5904,7 +5904,7 @@ class Internals { static const int kNullValueRootIndex = 7; static const int kTrueValueRootIndex = 8; static const int kFalseValueRootIndex = 9; - static const int kEmptyStringRootIndex = 166; + static const int kEmptyStringRootIndex = 152; // The external allocation limit should be below 256 MB on all architectures // to avoid that resource-constrained embedders run low on memory. diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc index be0532e..3ed7b12 100644 --- a/src/arm/code-stubs-arm.cc +++ b/src/arm/code-stubs-arm.cc @@ -2376,13 +2376,13 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { // A monomorphic miss (i.e, here the cache is not uninitialized) goes // megamorphic. - __ CompareRoot(r4, Heap::kUninitializedSymbolRootIndex); + __ CompareRoot(r4, Heap::kuninitialized_symbolRootIndex); __ b(eq, &initialize); // MegamorphicSentinel is an immortal immovable object (undefined) so no // write-barrier is needed. __ bind(&megamorphic); __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); - __ LoadRoot(ip, Heap::kMegamorphicSymbolRootIndex); + __ LoadRoot(ip, Heap::kmegamorphic_symbolRootIndex); __ str(ip, FieldMemOperand(r4, FixedArray::kHeaderSize)); __ jmp(&done); @@ -2698,9 +2698,9 @@ void CallICStub::Generate(MacroAssembler* masm) { __ bind(&extra_checks_or_miss); Label miss; - __ CompareRoot(r4, Heap::kMegamorphicSymbolRootIndex); + __ CompareRoot(r4, Heap::kmegamorphic_symbolRootIndex); __ b(eq, &slow_start); - __ CompareRoot(r4, Heap::kUninitializedSymbolRootIndex); + __ CompareRoot(r4, Heap::kuninitialized_symbolRootIndex); __ b(eq, &miss); if (!FLAG_trace_ic) { @@ -2710,7 +2710,7 @@ void CallICStub::Generate(MacroAssembler* masm) { __ CompareObjectType(r4, r5, r5, JS_FUNCTION_TYPE); __ b(ne, &miss); __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); - __ LoadRoot(ip, Heap::kMegamorphicSymbolRootIndex); + __ LoadRoot(ip, Heap::kmegamorphic_symbolRootIndex); __ str(ip, FieldMemOperand(r4, FixedArray::kHeaderSize)); __ jmp(&slow_start); } diff --git a/src/arm64/code-stubs-arm64.cc b/src/arm64/code-stubs-arm64.cc index 35b60f7..b2cc4dc 100644 --- a/src/arm64/code-stubs-arm64.cc +++ b/src/arm64/code-stubs-arm64.cc @@ -2683,13 +2683,13 @@ static void GenerateRecordCallTarget(MacroAssembler* masm, // A monomorphic miss (i.e, here the cache is not uninitialized) goes // megamorphic. - __ JumpIfRoot(scratch1, Heap::kUninitializedSymbolRootIndex, &initialize); + __ JumpIfRoot(scratch1, Heap::kuninitialized_symbolRootIndex, &initialize); // MegamorphicSentinel is an immortal immovable object (undefined) so no // write-barrier is needed. __ Bind(&megamorphic); __ Add(scratch1, feedback_vector, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); - __ LoadRoot(scratch2, Heap::kMegamorphicSymbolRootIndex); + __ LoadRoot(scratch2, Heap::kmegamorphic_symbolRootIndex); __ Str(scratch2, FieldMemOperand(scratch1, FixedArray::kHeaderSize)); __ B(&done); @@ -3038,8 +3038,8 @@ void CallICStub::Generate(MacroAssembler* masm) { __ bind(&extra_checks_or_miss); Label miss; - __ JumpIfRoot(x4, Heap::kMegamorphicSymbolRootIndex, &slow_start); - __ JumpIfRoot(x4, Heap::kUninitializedSymbolRootIndex, &miss); + __ JumpIfRoot(x4, Heap::kmegamorphic_symbolRootIndex, &slow_start); + __ JumpIfRoot(x4, Heap::kuninitialized_symbolRootIndex, &miss); if (!FLAG_trace_ic) { // We are going megamorphic. If the feedback is a JSFunction, it is fine @@ -3048,7 +3048,7 @@ void CallICStub::Generate(MacroAssembler* masm) { __ JumpIfNotObjectType(x4, x5, x5, JS_FUNCTION_TYPE, &miss); __ Add(x4, feedback_vector, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); - __ LoadRoot(x5, Heap::kMegamorphicSymbolRootIndex); + __ LoadRoot(x5, Heap::kmegamorphic_symbolRootIndex); __ Str(x5, FieldMemOperand(x4, FixedArray::kHeaderSize)); __ B(&slow_start); } diff --git a/src/factory.h b/src/factory.h index 24b490c..981dee0 100644 --- a/src/factory.h +++ b/src/factory.h @@ -588,6 +588,14 @@ class Factory FINAL { INTERNALIZED_STRING_LIST(STRING_ACCESSOR) #undef STRING_ACCESSOR +#define SYMBOL_ACCESSOR(name) \ + inline Handle name() { \ + return Handle(bit_cast( \ + &isolate()->heap()->roots_[Heap::k##name##RootIndex])); \ + } + PRIVATE_SYMBOL_LIST(SYMBOL_ACCESSOR) +#undef SYMBOL_ACCESSOR + inline void set_string_table(Handle table) { isolate()->heap()->set_string_table(*table); } diff --git a/src/heap-snapshot-generator.cc b/src/heap-snapshot-generator.cc index 4a4c914..c4f9600 100644 --- a/src/heap-snapshot-generator.cc +++ b/src/heap-snapshot-generator.cc @@ -2164,6 +2164,9 @@ const char* V8HeapExplorer::GetStrongGcSubrootName(Object* object) { #define STRING_NAME(name, str) NAME_ENTRY(name) INTERNALIZED_STRING_LIST(STRING_NAME) #undef STRING_NAME +#define SYMBOL_NAME(name) NAME_ENTRY(name) + PRIVATE_SYMBOL_LIST(SYMBOL_NAME) +#undef SYMBOL_NAME #undef NAME_ENTRY CHECK(!strong_gc_subroot_names_.is_empty()); } diff --git a/src/heap/heap.cc b/src/heap/heap.cc index bc20045..2a86e1b 100644 --- a/src/heap/heap.cc +++ b/src/heap/heap.cc @@ -2830,6 +2830,11 @@ void Heap::CreateInitialObjects() { set_instanceof_cache_map(Smi::FromInt(0)); set_instanceof_cache_answer(Smi::FromInt(0)); +#define SYMBOL_INIT(name) \ + roots_[k##name##RootIndex] = *factory->NewPrivateOwnSymbol(); + PRIVATE_SYMBOL_LIST(SYMBOL_INIT) +#undef SYMBOL_INIT + CreateFixedStubs(); // Allocate the dictionary of intrinsic function names. @@ -2868,21 +2873,6 @@ void Heap::CreateInitialObjects() { // Number of queued microtasks stored in Isolate::pending_microtask_count(). set_microtask_queue(empty_fixed_array()); - set_detailed_stack_trace_symbol(*factory->NewPrivateOwnSymbol()); - set_elements_transition_symbol(*factory->NewPrivateOwnSymbol()); - set_frozen_symbol(*factory->NewPrivateOwnSymbol()); - set_megamorphic_symbol(*factory->NewPrivateOwnSymbol()); - set_premonomorphic_symbol(*factory->NewPrivateOwnSymbol()); - set_generic_symbol(*factory->NewPrivateOwnSymbol()); - set_nonexistent_symbol(*factory->NewPrivateOwnSymbol()); - set_normal_ic_symbol(*factory->NewPrivateOwnSymbol()); - set_observed_symbol(*factory->NewPrivateOwnSymbol()); - set_stack_trace_symbol(*factory->NewPrivateOwnSymbol()); - set_uninitialized_symbol(*factory->NewPrivateOwnSymbol()); - set_home_object_symbol(*factory->NewPrivateOwnSymbol()); - set_promise_debug_marker_symbol(*factory->NewPrivateOwnSymbol()); - set_promise_has_handler_symbol(*factory->NewPrivateOwnSymbol()); - Handle slow_element_dictionary = SeededNumberDictionary::New(isolate(), 0, TENURED); slow_element_dictionary->set_requires_slow_elements(); diff --git a/src/heap/heap.h b/src/heap/heap.h index 88e534f..b281cb4 100644 --- a/src/heap/heap.h +++ b/src/heap/heap.h @@ -175,22 +175,8 @@ namespace internal { V(JSObject, observation_state, ObservationState) \ V(Map, external_map, ExternalMap) \ V(Object, symbol_registry, SymbolRegistry) \ - V(Symbol, frozen_symbol, FrozenSymbol) \ - V(Symbol, nonexistent_symbol, NonExistentSymbol) \ - V(Symbol, elements_transition_symbol, ElementsTransitionSymbol) \ V(SeededNumberDictionary, empty_slow_element_dictionary, \ EmptySlowElementDictionary) \ - V(Symbol, observed_symbol, ObservedSymbol) \ - V(Symbol, uninitialized_symbol, UninitializedSymbol) \ - V(Symbol, megamorphic_symbol, MegamorphicSymbol) \ - V(Symbol, premonomorphic_symbol, PremonomorphicSymbol) \ - V(Symbol, generic_symbol, GenericSymbol) \ - V(Symbol, stack_trace_symbol, StackTraceSymbol) \ - V(Symbol, detailed_stack_trace_symbol, DetailedStackTraceSymbol) \ - V(Symbol, normal_ic_symbol, NormalICSymbol) \ - V(Symbol, home_object_symbol, HomeObjectSymbol) \ - V(Symbol, promise_debug_marker_symbol, PromiseDebugMarkerSymbol) \ - V(Symbol, promise_has_handler_symbol, PromiseHasHandlerSymbol) \ V(FixedArray, materialized_objects, MaterializedObjects) \ V(FixedArray, allocation_sites_scratchpad, AllocationSitesScratchpad) \ V(FixedArray, microtask_queue, MicrotaskQueue) @@ -261,83 +247,99 @@ namespace internal { V(foreign_map) \ V(neander_map) -#define INTERNALIZED_STRING_LIST(V) \ - V(Object_string, "Object") \ - V(proto_string, "__proto__") \ - V(arguments_string, "arguments") \ - V(Arguments_string, "Arguments") \ - V(caller_string, "caller") \ - V(boolean_string, "boolean") \ - V(Boolean_string, "Boolean") \ - V(callee_string, "callee") \ - V(constructor_string, "constructor") \ - V(dot_result_string, ".result") \ - V(dot_for_string, ".for.") \ - V(eval_string, "eval") \ - V(empty_string, "") \ - V(function_string, "function") \ - V(Function_string, "Function") \ - V(length_string, "length") \ - V(name_string, "name") \ - V(null_string, "null") \ - V(number_string, "number") \ - V(Number_string, "Number") \ - V(nan_string, "NaN") \ - V(source_string, "source") \ - V(source_url_string, "source_url") \ - V(source_mapping_url_string, "source_mapping_url") \ - V(global_string, "global") \ - V(ignore_case_string, "ignoreCase") \ - V(multiline_string, "multiline") \ - V(sticky_string, "sticky") \ - V(harmony_regexps_string, "harmony_regexps") \ - V(input_string, "input") \ - V(index_string, "index") \ - V(last_index_string, "lastIndex") \ - V(object_string, "object") \ - V(prototype_string, "prototype") \ - V(string_string, "string") \ - V(String_string, "String") \ - V(symbol_string, "symbol") \ - V(Symbol_string, "Symbol") \ - V(Map_string, "Map") \ - V(Set_string, "Set") \ - V(WeakMap_string, "WeakMap") \ - V(WeakSet_string, "WeakSet") \ - V(for_string, "for") \ - V(for_api_string, "for_api") \ - V(for_intern_string, "for_intern") \ - V(private_api_string, "private_api") \ - V(private_intern_string, "private_intern") \ - V(Date_string, "Date") \ - V(char_at_string, "CharAt") \ - V(undefined_string, "undefined") \ - V(value_of_string, "valueOf") \ - V(stack_string, "stack") \ - V(toJSON_string, "toJSON") \ - V(KeyedLoadMonomorphic_string, "KeyedLoadMonomorphic") \ - V(KeyedStoreMonomorphic_string, "KeyedStoreMonomorphic") \ - V(stack_overflow_string, "kStackOverflowBoilerplate") \ - V(illegal_access_string, "illegal access") \ - V(cell_value_string, "%cell_value") \ - V(illegal_argument_string, "illegal argument") \ - V(identity_hash_string, "v8::IdentityHash") \ - V(closure_string, "(closure)") \ - V(dot_string, ".") \ - V(compare_ic_string, "==") \ - V(strict_compare_ic_string, "===") \ - V(infinity_string, "Infinity") \ - V(minus_infinity_string, "-Infinity") \ - V(query_colon_string, "(?:)") \ - V(Generator_string, "Generator") \ - V(throw_string, "throw") \ - V(done_string, "done") \ - V(value_string, "value") \ - V(next_string, "next") \ - V(byte_length_string, "byteLength") \ - V(byte_offset_string, "byteOffset") \ - V(intl_initialized_marker_string, "v8::intl_initialized_marker") \ - V(intl_impl_object_string, "v8::intl_object") +#define INTERNALIZED_STRING_LIST(V) \ + V(Object_string, "Object") \ + V(proto_string, "__proto__") \ + V(arguments_string, "arguments") \ + V(Arguments_string, "Arguments") \ + V(caller_string, "caller") \ + V(boolean_string, "boolean") \ + V(Boolean_string, "Boolean") \ + V(callee_string, "callee") \ + V(constructor_string, "constructor") \ + V(dot_result_string, ".result") \ + V(dot_for_string, ".for.") \ + V(eval_string, "eval") \ + V(empty_string, "") \ + V(function_string, "function") \ + V(Function_string, "Function") \ + V(length_string, "length") \ + V(name_string, "name") \ + V(null_string, "null") \ + V(number_string, "number") \ + V(Number_string, "Number") \ + V(nan_string, "NaN") \ + V(source_string, "source") \ + V(source_url_string, "source_url") \ + V(source_mapping_url_string, "source_mapping_url") \ + V(global_string, "global") \ + V(ignore_case_string, "ignoreCase") \ + V(multiline_string, "multiline") \ + V(sticky_string, "sticky") \ + V(harmony_regexps_string, "harmony_regexps") \ + V(input_string, "input") \ + V(index_string, "index") \ + V(last_index_string, "lastIndex") \ + V(object_string, "object") \ + V(prototype_string, "prototype") \ + V(string_string, "string") \ + V(String_string, "String") \ + V(symbol_string, "symbol") \ + V(Symbol_string, "Symbol") \ + V(Map_string, "Map") \ + V(Set_string, "Set") \ + V(WeakMap_string, "WeakMap") \ + V(WeakSet_string, "WeakSet") \ + V(for_string, "for") \ + V(for_api_string, "for_api") \ + V(for_intern_string, "for_intern") \ + V(private_api_string, "private_api") \ + V(private_intern_string, "private_intern") \ + V(Date_string, "Date") \ + V(char_at_string, "CharAt") \ + V(undefined_string, "undefined") \ + V(value_of_string, "valueOf") \ + V(stack_string, "stack") \ + V(toJSON_string, "toJSON") \ + V(KeyedLoadMonomorphic_string, "KeyedLoadMonomorphic") \ + V(KeyedStoreMonomorphic_string, "KeyedStoreMonomorphic") \ + V(stack_overflow_string, "kStackOverflowBoilerplate") \ + V(illegal_access_string, "illegal access") \ + V(cell_value_string, "%cell_value") \ + V(illegal_argument_string, "illegal argument") \ + V(identity_hash_string, "v8::IdentityHash") \ + V(closure_string, "(closure)") \ + V(dot_string, ".") \ + V(compare_ic_string, "==") \ + V(strict_compare_ic_string, "===") \ + V(infinity_string, "Infinity") \ + V(minus_infinity_string, "-Infinity") \ + V(query_colon_string, "(?:)") \ + V(Generator_string, "Generator") \ + V(throw_string, "throw") \ + V(done_string, "done") \ + V(value_string, "value") \ + V(next_string, "next") \ + V(byte_length_string, "byteLength") \ + V(byte_offset_string, "byteOffset") + +#define PRIVATE_SYMBOL_LIST(V) \ + V(frozen_symbol) \ + V(nonexistent_symbol) \ + V(elements_transition_symbol) \ + V(observed_symbol) \ + V(uninitialized_symbol) \ + V(megamorphic_symbol) \ + V(premonomorphic_symbol) \ + V(generic_symbol) \ + V(stack_trace_symbol) \ + V(detailed_stack_trace_symbol) \ + V(normal_ic_symbol) \ + V(home_object_symbol) \ + V(intl_initialized_marker_symbol) \ + V(intl_impl_object_symbol) \ + V(promise_debug_marker_symbol) \ + V(promise_has_handler_symbol) // Forward declarations. class HeapStats; @@ -785,6 +787,11 @@ class Heap { INTERNALIZED_STRING_LIST(STRING_ACCESSOR) #undef STRING_ACCESSOR +#define SYMBOL_ACCESSOR(name) \ + Symbol* name() { return Symbol::cast(roots_[k##name##RootIndex]); } + PRIVATE_SYMBOL_LIST(SYMBOL_ACCESSOR) +#undef SYMBOL_ACCESSOR + // The hidden_string is special because it is the empty string, but does // not match the empty string. String* hidden_string() { return hidden_string_; } @@ -1062,6 +1069,10 @@ class Heap { INTERNALIZED_STRING_LIST(STRING_INDEX_DECLARATION) #undef STRING_DECLARATION +#define SYMBOL_INDEX_DECLARATION(name) k##name##RootIndex, + PRIVATE_SYMBOL_LIST(SYMBOL_INDEX_DECLARATION) +#undef SYMBOL_INDEX_DECLARATION + // Utility type maps #define DECLARE_STRUCT_MAP(NAME, Name, name) k##Name##MapRootIndex, STRUCT_LIST(DECLARE_STRUCT_MAP) diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc index 9b7bfce..eb6d4f0 100644 --- a/src/hydrogen-instructions.cc +++ b/src/hydrogen-instructions.cc @@ -2873,6 +2873,9 @@ bool HConstant::ImmortalImmovable() const { object_.IsKnownGlobal(heap->name##_map()) || STRING_TYPE_LIST(STRING_TYPE) #undef STRING_TYPE +#define SYMBOL(name) object_.IsKnownGlobal(heap->name()) || + PRIVATE_SYMBOL_LIST(SYMBOL) +#undef SYMBOL false; } diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc index f2fdab6..9dd8bdc 100644 --- a/src/mips/code-stubs-mips.cc +++ b/src/mips/code-stubs-mips.cc @@ -2520,14 +2520,14 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { // A monomorphic miss (i.e, here the cache is not uninitialized) goes // megamorphic. - __ LoadRoot(at, Heap::kUninitializedSymbolRootIndex); + __ LoadRoot(at, Heap::kuninitialized_symbolRootIndex); __ Branch(&initialize, eq, t0, Operand(at)); // MegamorphicSentinel is an immortal immovable object (undefined) so no // write-barrier is needed. __ bind(&megamorphic); __ sll(t0, a3, kPointerSizeLog2 - kSmiTagSize); __ Addu(t0, a2, Operand(t0)); - __ LoadRoot(at, Heap::kMegamorphicSymbolRootIndex); + __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); __ sw(at, FieldMemOperand(t0, FixedArray::kHeaderSize)); __ jmp(&done); @@ -2845,9 +2845,9 @@ void CallICStub::Generate(MacroAssembler* masm) { __ bind(&extra_checks_or_miss); Label miss; - __ LoadRoot(at, Heap::kMegamorphicSymbolRootIndex); + __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); __ Branch(&slow_start, eq, t0, Operand(at)); - __ LoadRoot(at, Heap::kUninitializedSymbolRootIndex); + __ LoadRoot(at, Heap::kuninitialized_symbolRootIndex); __ Branch(&miss, eq, t0, Operand(at)); if (!FLAG_trace_ic) { @@ -2858,7 +2858,7 @@ void CallICStub::Generate(MacroAssembler* masm) { __ Branch(&miss, ne, t1, Operand(JS_FUNCTION_TYPE)); __ sll(t0, a3, kPointerSizeLog2 - kSmiTagSize); __ Addu(t0, a2, Operand(t0)); - __ LoadRoot(at, Heap::kMegamorphicSymbolRootIndex); + __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); __ sw(at, FieldMemOperand(t0, FixedArray::kHeaderSize)); __ Branch(&slow_start); } diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc index ef497cc..8916c40 100644 --- a/src/mips64/code-stubs-mips64.cc +++ b/src/mips64/code-stubs-mips64.cc @@ -2539,14 +2539,14 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { // A monomorphic miss (i.e, here the cache is not uninitialized) goes // megamorphic. - __ LoadRoot(at, Heap::kUninitializedSymbolRootIndex); + __ LoadRoot(at, Heap::kuninitialized_symbolRootIndex); __ Branch(&initialize, eq, a4, Operand(at)); // MegamorphicSentinel is an immortal immovable object (undefined) so no // write-barrier is needed. __ bind(&megamorphic); __ dsrl(a4, a3, 32- kPointerSizeLog2); __ Daddu(a4, a2, Operand(a4)); - __ LoadRoot(at, Heap::kMegamorphicSymbolRootIndex); + __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); __ sd(at, FieldMemOperand(a4, FixedArray::kHeaderSize)); __ jmp(&done); @@ -2904,9 +2904,9 @@ void CallICStub::Generate(MacroAssembler* masm) { __ bind(&extra_checks_or_miss); Label miss; - __ LoadRoot(at, Heap::kMegamorphicSymbolRootIndex); + __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); __ Branch(&slow_start, eq, a4, Operand(at)); - __ LoadRoot(at, Heap::kUninitializedSymbolRootIndex); + __ LoadRoot(at, Heap::kuninitialized_symbolRootIndex); __ Branch(&miss, eq, a4, Operand(at)); if (!FLAG_trace_ic) { @@ -2917,7 +2917,7 @@ void CallICStub::Generate(MacroAssembler* masm) { __ Branch(&miss, ne, a5, Operand(JS_FUNCTION_TYPE)); __ dsrl(a4, a3, 32 - kPointerSizeLog2); __ Daddu(a4, a2, Operand(a4)); - __ LoadRoot(at, Heap::kMegamorphicSymbolRootIndex); + __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); __ sd(at, FieldMemOperand(a4, FixedArray::kHeaderSize)); __ Branch(&slow_start); } diff --git a/src/runtime/runtime-i18n.cc b/src/runtime/runtime-i18n.cc index 5822374..4798007 100644 --- a/src/runtime/runtime-i18n.cc +++ b/src/runtime/runtime-i18n.cc @@ -233,9 +233,9 @@ RUNTIME_FUNCTION(Runtime_IsInitializedIntlObject) { if (!input->IsJSObject()) return isolate->heap()->false_value(); Handle obj = Handle::cast(input); - Handle marker = isolate->factory()->intl_initialized_marker_string(); - Handle tag(obj->GetHiddenProperty(marker), isolate); - return isolate->heap()->ToBoolean(!tag->IsTheHole()); + Handle marker = isolate->factory()->intl_initialized_marker_symbol(); + Handle tag = JSObject::GetDataProperty(obj, marker); + return isolate->heap()->ToBoolean(!tag->IsUndefined()); } @@ -250,8 +250,8 @@ RUNTIME_FUNCTION(Runtime_IsInitializedIntlObjectOfType) { if (!input->IsJSObject()) return isolate->heap()->false_value(); Handle obj = Handle::cast(input); - Handle marker = isolate->factory()->intl_initialized_marker_string(); - Handle tag(obj->GetHiddenProperty(marker), isolate); + Handle marker = isolate->factory()->intl_initialized_marker_symbol(); + Handle tag = JSObject::GetDataProperty(obj, marker); return isolate->heap()->ToBoolean(tag->IsString() && String::cast(*tag)->Equals(*expected_type)); } @@ -266,11 +266,11 @@ RUNTIME_FUNCTION(Runtime_MarkAsInitializedIntlObjectOfType) { CONVERT_ARG_HANDLE_CHECKED(String, type, 1); CONVERT_ARG_HANDLE_CHECKED(JSObject, impl, 2); - Handle marker = isolate->factory()->intl_initialized_marker_string(); - JSObject::SetHiddenProperty(input, marker, type); + Handle marker = isolate->factory()->intl_initialized_marker_symbol(); + JSObject::SetProperty(input, marker, type, STRICT).Assert(); - marker = isolate->factory()->intl_impl_object_string(); - JSObject::SetHiddenProperty(input, marker, impl); + marker = isolate->factory()->intl_impl_object_symbol(); + JSObject::SetProperty(input, marker, impl, STRICT).Assert(); return isolate->heap()->undefined_value(); } @@ -291,8 +291,9 @@ RUNTIME_FUNCTION(Runtime_GetImplFromInitializedIntlObject) { Handle obj = Handle::cast(input); - Handle marker = isolate->factory()->intl_impl_object_string(); - Handle impl(obj->GetHiddenProperty(marker), isolate); + Handle marker = isolate->factory()->intl_impl_object_symbol(); + + Handle impl = JSObject::GetDataProperty(obj, marker); if (impl->IsTheHole()) { Vector > arguments = HandleVector(&obj, 1); THROW_NEW_ERROR_RETURN_FAILURE(isolate, diff --git a/src/runtime/runtime.cc b/src/runtime/runtime.cc index 815bc45..620c91f 100644 --- a/src/runtime/runtime.cc +++ b/src/runtime/runtime.cc @@ -1040,18 +1040,6 @@ MaybeHandle Runtime::DeleteObjectProperty(Isolate* isolate, } -RUNTIME_FUNCTION(Runtime_SetHiddenProperty) { - HandleScope scope(isolate); - RUNTIME_ASSERT(args.length() == 3); - - CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); - CONVERT_ARG_HANDLE_CHECKED(String, key, 1); - CONVERT_ARG_HANDLE_CHECKED(Object, value, 2); - RUNTIME_ASSERT(key->IsUniqueName()); - return *JSObject::SetHiddenProperty(object, key, value); -} - - RUNTIME_FUNCTION(Runtime_AddNamedProperty) { HandleScope scope(isolate); RUNTIME_ASSERT(args.length() == 4); diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h index 8b25e51..9fb4c11 100644 --- a/src/runtime/runtime.h +++ b/src/runtime/runtime.h @@ -256,7 +256,6 @@ namespace internal { F(DefineDataPropertyUnchecked, 4, 1) \ F(DefineAccessorPropertyUnchecked, 5, 1) \ F(GetDataProperty, 2, 1) \ - F(SetHiddenProperty, 3, 1) \ \ /* Arrays */ \ F(RemoveArrayHoles, 2, 1) \ diff --git a/test/mjsunit/test-hidden-string.js b/test/mjsunit/test-hidden-string.js deleted file mode 100644 index a5d32c8..0000000 --- a/test/mjsunit/test-hidden-string.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2014 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Flags: --allow-natives-syntax - -var o = {}; -%SetHiddenProperty(o, "test", 1); -// Create non-internalized "" -var empty = "a".substring(1, 1); -assertEquals(undefined, o[empty]); -- 2.7.4