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

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

Issue 1149863005: Move hash code from hidden string to a private symbol (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix merge Created 5 years, 7 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-collections.cc ('k') | src/utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-symbol.cc
diff --git a/src/runtime/runtime-symbol.cc b/src/runtime/runtime-symbol.cc
index e44d15dfce292d16186935d3899f539bb587fb24..7ff7eb96436a25b25f1227bd60ee7ceeb2a91a08 100644
--- a/src/runtime/runtime-symbol.cc
+++ b/src/runtime/runtime-symbol.cc
@@ -37,9 +37,7 @@ RUNTIME_FUNCTION(Runtime_CreatePrivateOwnSymbol) {
DCHECK(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(Object, name, 0);
RUNTIME_ASSERT(name->IsString() || name->IsUndefined());
- Handle<Symbol> symbol = isolate->factory()->NewPrivateOwnSymbol();
- if (name->IsString()) symbol->set_name(*name);
- return *symbol;
+ return *isolate->factory()->NewPrivateOwnSymbol(name);
}
@@ -50,18 +48,15 @@ RUNTIME_FUNCTION(Runtime_CreateGlobalPrivateOwnSymbol) {
Handle<JSObject> registry = isolate->GetSymbolRegistry();
Handle<String> part = isolate->factory()->private_intern_string();
Handle<Object> privates;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, privates, Object::GetPropertyOrElement(registry, part));
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, privates,
+ Object::GetProperty(registry, part));
Handle<Object> symbol;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, symbol, Object::GetPropertyOrElement(privates, name));
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, symbol,
+ Object::GetProperty(privates, name));
if (!symbol->IsSymbol()) {
DCHECK(symbol->IsUndefined());
- symbol = isolate->factory()->NewPrivateSymbol();
- Handle<Symbol>::cast(symbol)->set_name(*name);
- Handle<Symbol>::cast(symbol)->set_is_own(true);
- JSObject::SetProperty(Handle<JSObject>::cast(privates), name, symbol,
- STRICT).Assert();
+ symbol = isolate->factory()->NewPrivateOwnSymbol(name);
+ JSObject::AddProperty(Handle<JSObject>::cast(privates), name, symbol, NONE);
}
return *symbol;
}
« no previous file with comments | « src/runtime/runtime-collections.cc ('k') | src/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698