Commit 63851465 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Revert "Use symbols instead of hidden properties for i18n markers."

This reverts r24345.

TBR=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/618123005

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24346 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 153ec032
...@@ -5904,7 +5904,7 @@ class Internals { ...@@ -5904,7 +5904,7 @@ class Internals {
static const int kNullValueRootIndex = 7; static const int kNullValueRootIndex = 7;
static const int kTrueValueRootIndex = 8; static const int kTrueValueRootIndex = 8;
static const int kFalseValueRootIndex = 9; static const int kFalseValueRootIndex = 9;
static const int kEmptyStringRootIndex = 152; static const int kEmptyStringRootIndex = 166;
// The external allocation limit should be below 256 MB on all architectures // The external allocation limit should be below 256 MB on all architectures
// to avoid that resource-constrained embedders run low on memory. // to avoid that resource-constrained embedders run low on memory.
......
...@@ -588,14 +588,6 @@ class Factory FINAL { ...@@ -588,14 +588,6 @@ class Factory FINAL {
INTERNALIZED_STRING_LIST(STRING_ACCESSOR) INTERNALIZED_STRING_LIST(STRING_ACCESSOR)
#undef STRING_ACCESSOR #undef STRING_ACCESSOR
#define SYMBOL_ACCESSOR(name) \
inline Handle<Symbol> name() { \
return Handle<Symbol>(bit_cast<Symbol**>( \
&isolate()->heap()->roots_[Heap::k##name##RootIndex])); \
}
PRIVATE_SYMBOL_LIST(SYMBOL_ACCESSOR)
#undef SYMBOL_ACCESSOR
inline void set_string_table(Handle<StringTable> table) { inline void set_string_table(Handle<StringTable> table) {
isolate()->heap()->set_string_table(*table); isolate()->heap()->set_string_table(*table);
} }
......
...@@ -2164,9 +2164,6 @@ const char* V8HeapExplorer::GetStrongGcSubrootName(Object* object) { ...@@ -2164,9 +2164,6 @@ const char* V8HeapExplorer::GetStrongGcSubrootName(Object* object) {
#define STRING_NAME(name, str) NAME_ENTRY(name) #define STRING_NAME(name, str) NAME_ENTRY(name)
INTERNALIZED_STRING_LIST(STRING_NAME) INTERNALIZED_STRING_LIST(STRING_NAME)
#undef STRING_NAME #undef STRING_NAME
#define SYMBOL_NAME(name) NAME_ENTRY(name)
PRIVATE_SYMBOL_LIST(SYMBOL_NAME)
#undef SYMBOL_NAME
#undef NAME_ENTRY #undef NAME_ENTRY
CHECK(!strong_gc_subroot_names_.is_empty()); CHECK(!strong_gc_subroot_names_.is_empty());
} }
......
...@@ -2868,10 +2868,20 @@ void Heap::CreateInitialObjects() { ...@@ -2868,10 +2868,20 @@ void Heap::CreateInitialObjects() {
// Number of queued microtasks stored in Isolate::pending_microtask_count(). // Number of queued microtasks stored in Isolate::pending_microtask_count().
set_microtask_queue(empty_fixed_array()); set_microtask_queue(empty_fixed_array());
#define SYMBOL_INIT(name) \ set_detailed_stack_trace_symbol(*factory->NewPrivateOwnSymbol());
roots_[k##name##RootIndex] = *factory->NewPrivateOwnSymbol(); set_elements_transition_symbol(*factory->NewPrivateOwnSymbol());
PRIVATE_SYMBOL_LIST(SYMBOL_INIT) set_frozen_symbol(*factory->NewPrivateOwnSymbol());
#undef SYMBOL_INIT 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<SeededNumberDictionary> slow_element_dictionary = Handle<SeededNumberDictionary> slow_element_dictionary =
SeededNumberDictionary::New(isolate(), 0, TENURED); SeededNumberDictionary::New(isolate(), 0, TENURED);
......
This diff is collapsed.
...@@ -2873,9 +2873,6 @@ bool HConstant::ImmortalImmovable() const { ...@@ -2873,9 +2873,6 @@ bool HConstant::ImmortalImmovable() const {
object_.IsKnownGlobal(heap->name##_map()) || object_.IsKnownGlobal(heap->name##_map()) ||
STRING_TYPE_LIST(STRING_TYPE) STRING_TYPE_LIST(STRING_TYPE)
#undef STRING_TYPE #undef STRING_TYPE
#define SYMBOL(name) object_.IsKnownGlobal(heap->name()) ||
PRIVATE_SYMBOL_LIST(SYMBOL)
#undef SYMBOL
false; false;
} }
......
...@@ -233,9 +233,9 @@ RUNTIME_FUNCTION(Runtime_IsInitializedIntlObject) { ...@@ -233,9 +233,9 @@ RUNTIME_FUNCTION(Runtime_IsInitializedIntlObject) {
if (!input->IsJSObject()) return isolate->heap()->false_value(); if (!input->IsJSObject()) return isolate->heap()->false_value();
Handle<JSObject> obj = Handle<JSObject>::cast(input); Handle<JSObject> obj = Handle<JSObject>::cast(input);
Handle<Symbol> marker = isolate->factory()->intl_initialized_marker_symbol(); Handle<String> marker = isolate->factory()->intl_initialized_marker_string();
Handle<Object> tag = JSObject::GetDataProperty(obj, marker); Handle<Object> tag(obj->GetHiddenProperty(marker), isolate);
return isolate->heap()->ToBoolean(!tag->IsUndefined()); return isolate->heap()->ToBoolean(!tag->IsTheHole());
} }
...@@ -250,8 +250,8 @@ RUNTIME_FUNCTION(Runtime_IsInitializedIntlObjectOfType) { ...@@ -250,8 +250,8 @@ RUNTIME_FUNCTION(Runtime_IsInitializedIntlObjectOfType) {
if (!input->IsJSObject()) return isolate->heap()->false_value(); if (!input->IsJSObject()) return isolate->heap()->false_value();
Handle<JSObject> obj = Handle<JSObject>::cast(input); Handle<JSObject> obj = Handle<JSObject>::cast(input);
Handle<Symbol> marker = isolate->factory()->intl_initialized_marker_symbol(); Handle<String> marker = isolate->factory()->intl_initialized_marker_string();
Handle<Object> tag = JSObject::GetDataProperty(obj, marker); Handle<Object> tag(obj->GetHiddenProperty(marker), isolate);
return isolate->heap()->ToBoolean(tag->IsString() && return isolate->heap()->ToBoolean(tag->IsString() &&
String::cast(*tag)->Equals(*expected_type)); String::cast(*tag)->Equals(*expected_type));
} }
...@@ -266,11 +266,11 @@ RUNTIME_FUNCTION(Runtime_MarkAsInitializedIntlObjectOfType) { ...@@ -266,11 +266,11 @@ RUNTIME_FUNCTION(Runtime_MarkAsInitializedIntlObjectOfType) {
CONVERT_ARG_HANDLE_CHECKED(String, type, 1); CONVERT_ARG_HANDLE_CHECKED(String, type, 1);
CONVERT_ARG_HANDLE_CHECKED(JSObject, impl, 2); CONVERT_ARG_HANDLE_CHECKED(JSObject, impl, 2);
Handle<Symbol> marker = isolate->factory()->intl_initialized_marker_symbol(); Handle<String> marker = isolate->factory()->intl_initialized_marker_string();
JSObject::SetProperty(input, marker, type, STRICT).Assert(); JSObject::SetHiddenProperty(input, marker, type);
marker = isolate->factory()->intl_impl_object_symbol(); marker = isolate->factory()->intl_impl_object_string();
JSObject::SetProperty(input, marker, impl, STRICT).Assert(); JSObject::SetHiddenProperty(input, marker, impl);
return isolate->heap()->undefined_value(); return isolate->heap()->undefined_value();
} }
...@@ -291,9 +291,8 @@ RUNTIME_FUNCTION(Runtime_GetImplFromInitializedIntlObject) { ...@@ -291,9 +291,8 @@ RUNTIME_FUNCTION(Runtime_GetImplFromInitializedIntlObject) {
Handle<JSObject> obj = Handle<JSObject>::cast(input); Handle<JSObject> obj = Handle<JSObject>::cast(input);
Handle<Symbol> marker = isolate->factory()->intl_impl_object_symbol(); Handle<String> marker = isolate->factory()->intl_impl_object_string();
Handle<Object> impl(obj->GetHiddenProperty(marker), isolate);
Handle<Object> impl = JSObject::GetDataProperty(obj, marker);
if (impl->IsTheHole()) { if (impl->IsTheHole()) {
Vector<Handle<Object> > arguments = HandleVector(&obj, 1); Vector<Handle<Object> > arguments = HandleVector(&obj, 1);
THROW_NEW_ERROR_RETURN_FAILURE(isolate, THROW_NEW_ERROR_RETURN_FAILURE(isolate,
......
...@@ -1040,6 +1040,18 @@ MaybeHandle<Object> Runtime::DeleteObjectProperty(Isolate* isolate, ...@@ -1040,6 +1040,18 @@ MaybeHandle<Object> 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) { RUNTIME_FUNCTION(Runtime_AddNamedProperty) {
HandleScope scope(isolate); HandleScope scope(isolate);
RUNTIME_ASSERT(args.length() == 4); RUNTIME_ASSERT(args.length() == 4);
......
...@@ -256,6 +256,7 @@ namespace internal { ...@@ -256,6 +256,7 @@ namespace internal {
F(DefineDataPropertyUnchecked, 4, 1) \ F(DefineDataPropertyUnchecked, 4, 1) \
F(DefineAccessorPropertyUnchecked, 5, 1) \ F(DefineAccessorPropertyUnchecked, 5, 1) \
F(GetDataProperty, 2, 1) \ F(GetDataProperty, 2, 1) \
F(SetHiddenProperty, 3, 1) \
\ \
/* Arrays */ \ /* Arrays */ \
F(RemoveArrayHoles, 2, 1) \ F(RemoveArrayHoles, 2, 1) \
......
// 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]);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment