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

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

Issue 1259963002: [stubs] Don't pass name to Load/StoreGlobalViaContext stubs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix rebase Created 5 years, 5 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.h ('k') | src/scopeinfo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-object.cc
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
index ebaf006a4ffe748a5f86803acd8bfe854aca9f6c..b9c3fdf1bedbdc09643c164347be4cdf14a92281 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -420,9 +420,8 @@ RUNTIME_FUNCTION(Runtime_ObjectSeal) {
RUNTIME_FUNCTION(Runtime_LoadGlobalViaContext) {
HandleScope scope(isolate);
- DCHECK_EQ(2, args.length());
+ DCHECK_EQ(1, args.length());
CONVERT_SMI_ARG_CHECKED(slot, 0);
- CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
// Go up context chain to the script context.
Handle<Context> script_context(isolate->context()->script_context(), isolate);
@@ -430,12 +429,15 @@ RUNTIME_FUNCTION(Runtime_LoadGlobalViaContext) {
DCHECK(script_context->get(slot)->IsPropertyCell());
// Lookup the named property on the global object.
+ Handle<ScopeInfo> scope_info(ScopeInfo::cast(script_context->extension()),
+ isolate);
+ Handle<Name> name(scope_info->ContextSlotName(slot), isolate);
Handle<GlobalObject> global_object(script_context->global_object(), isolate);
LookupIterator it(global_object, name, LookupIterator::HIDDEN);
// Switch to fast mode only if there is a data property and it's not on
// a hidden prototype.
- if (it.state() == LookupIterator::DATA &&
+ if (LookupIterator::DATA == it.state() &&
it.GetHolder<Object>()->IsJSGlobalObject()) {
// Now update the cell in the script context.
Handle<PropertyCell> cell = it.GetPropertyCell();
@@ -454,8 +456,7 @@ RUNTIME_FUNCTION(Runtime_LoadGlobalViaContext) {
namespace {
-Object* StoreGlobalViaContext(Isolate* isolate, int slot, Handle<Name> name,
- Handle<Object> value,
+Object* StoreGlobalViaContext(Isolate* isolate, int slot, Handle<Object> value,
LanguageMode language_mode) {
// Go up context chain to the script context.
Handle<Context> script_context(isolate->context()->script_context(), isolate);
@@ -463,6 +464,9 @@ Object* StoreGlobalViaContext(Isolate* isolate, int slot, Handle<Name> name,
DCHECK(script_context->get(slot)->IsPropertyCell());
// Lookup the named property on the global object.
+ Handle<ScopeInfo> scope_info(ScopeInfo::cast(script_context->extension()),
+ isolate);
+ Handle<Name> name(scope_info->ContextSlotName(slot), isolate);
Handle<GlobalObject> global_object(script_context->global_object(), isolate);
LookupIterator it(global_object, name, LookupIterator::HIDDEN);
// Switch to fast mode only if there is a data property and it's not on
@@ -491,23 +495,21 @@ Object* StoreGlobalViaContext(Isolate* isolate, int slot, Handle<Name> name,
RUNTIME_FUNCTION(Runtime_StoreGlobalViaContext_Sloppy) {
HandleScope scope(isolate);
- DCHECK_EQ(3, args.length());
+ DCHECK_EQ(2, args.length());
CONVERT_SMI_ARG_CHECKED(slot, 0);
- CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
- CONVERT_ARG_HANDLE_CHECKED(Object, value, 2);
+ CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
- return StoreGlobalViaContext(isolate, slot, name, value, SLOPPY);
+ return StoreGlobalViaContext(isolate, slot, value, SLOPPY);
}
RUNTIME_FUNCTION(Runtime_StoreGlobalViaContext_Strict) {
HandleScope scope(isolate);
- DCHECK_EQ(3, args.length());
+ DCHECK_EQ(2, args.length());
CONVERT_SMI_ARG_CHECKED(slot, 0);
- CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
- CONVERT_ARG_HANDLE_CHECKED(Object, value, 2);
+ CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
- return StoreGlobalViaContext(isolate, slot, name, value, STRICT);
+ return StoreGlobalViaContext(isolate, slot, value, STRICT);
}
« no previous file with comments | « src/runtime/runtime.h ('k') | src/scopeinfo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698