Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1293)

Unified Diff: src/runtime/runtime-i18n.cc

Issue 614083002: Use symbols instead of hidden properties for i18n markers. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime.cc ('k') | test/mjsunit/test-hidden-string.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-i18n.cc
diff --git a/src/runtime/runtime-i18n.cc b/src/runtime/runtime-i18n.cc
index 5822374c7f30d1e1f0d34ba13a70cc76001eebbc..479800724c75405552620ad137365f77df16ff8b 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<JSObject> obj = Handle<JSObject>::cast(input);
- Handle<String> marker = isolate->factory()->intl_initialized_marker_string();
- Handle<Object> tag(obj->GetHiddenProperty(marker), isolate);
- return isolate->heap()->ToBoolean(!tag->IsTheHole());
+ Handle<Symbol> marker = isolate->factory()->intl_initialized_marker_symbol();
+ Handle<Object> 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<JSObject> obj = Handle<JSObject>::cast(input);
- Handle<String> marker = isolate->factory()->intl_initialized_marker_string();
- Handle<Object> tag(obj->GetHiddenProperty(marker), isolate);
+ Handle<Symbol> marker = isolate->factory()->intl_initialized_marker_symbol();
+ Handle<Object> 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<String> marker = isolate->factory()->intl_initialized_marker_string();
- JSObject::SetHiddenProperty(input, marker, type);
+ Handle<Symbol> 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<JSObject> obj = Handle<JSObject>::cast(input);
- Handle<String> marker = isolate->factory()->intl_impl_object_string();
- Handle<Object> impl(obj->GetHiddenProperty(marker), isolate);
+ Handle<Symbol> marker = isolate->factory()->intl_impl_object_symbol();
+
+ Handle<Object> impl = JSObject::GetDataProperty(obj, marker);
if (impl->IsTheHole()) {
Vector<Handle<Object> > arguments = HandleVector(&obj, 1);
THROW_NEW_ERROR_RETURN_FAILURE(isolate,
« no previous file with comments | « src/runtime/runtime.cc ('k') | test/mjsunit/test-hidden-string.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698