Commit bf61b05b authored by ishell's avatar ishell Committed by Commit bot

Follow-up for "Enable loads and stores to global vars through property cell...

Follow-up for "Enable loads and stores to global vars through property cell shortcuts installed into parent script context."

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

Cr-Commit-Position: refs/heads/master@{#29651}
parent 5a52b9fe
......@@ -432,8 +432,11 @@ RUNTIME_FUNCTION(Runtime_LoadGlobalViaContext) {
Handle<GlobalObject> global(script_context->global_object());
LookupIterator it(global, name, LookupIterator::OWN);
if (LookupIterator::DATA == it.state()) {
LookupIterator it(global, name, LookupIterator::HIDDEN);
// Switch to fast mode only if there is a data property and it's not on
// a hidden prototype.
if (LookupIterator::DATA == it.state() &&
it.GetHolder<Object>()->IsJSGlobalObject()) {
// Now update cell in the script context.
Handle<PropertyCell> cell = it.GetPropertyCell();
script_context->set(index, *cell);
......@@ -464,8 +467,11 @@ RUNTIME_FUNCTION(Runtime_StoreGlobalViaContext) {
Handle<GlobalObject> global(script_context->global_object());
LookupIterator it(global, name, LookupIterator::OWN);
if (LookupIterator::DATA == it.state()) {
LookupIterator it(global, name, LookupIterator::HIDDEN);
// Switch to fast mode only if there is a data property and it's not on
// a hidden prototype.
if (LookupIterator::DATA == it.state() &&
it.GetHolder<Object>()->IsJSGlobalObject()) {
// Now update cell in the script context.
Handle<PropertyCell> cell = it.GetPropertyCell();
script_context->set(index, *cell);
......
......@@ -628,7 +628,11 @@ UNINITIALIZED_DEPENDENT_TEST(CustomContextDeserialization,
root =
deserializer.DeserializePartial(isolate, global_proxy,
&outdated_contexts).ToHandleChecked();
CHECK_EQ(3, outdated_contexts->length());
if (FLAG_global_var_shortcuts) {
CHECK_EQ(5, outdated_contexts->length());
} else {
CHECK_EQ(3, outdated_contexts->length());
}
CHECK(root->IsContext());
Handle<Context> context = Handle<Context>::cast(root);
CHECK(context->global_proxy() == *global_proxy);
......
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