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

Side by Side Diff: src/interpreter/bytecode-generator.cc

Issue 1478303002: Revert of [runtime] Replace global object link with native context link in all contexts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « src/ic/x64/handler-compiler-x64.cc ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/interpreter/bytecode-generator.h" 5 #include "src/interpreter/bytecode-generator.h"
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/interpreter/control-flow-builders.h" 9 #include "src/interpreter/control-flow-builders.h"
10 #include "src/objects.h" 10 #include "src/objects.h"
(...skipping 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after
1776 } else if (expr->expression()->IsVariableProxy()) { 1776 } else if (expr->expression()->IsVariableProxy()) {
1777 // Delete of an unqualified identifier is allowed in sloppy mode but is 1777 // Delete of an unqualified identifier is allowed in sloppy mode but is
1778 // not allowed in strict mode. Deleting 'this' is allowed in both modes. 1778 // not allowed in strict mode. Deleting 'this' is allowed in both modes.
1779 VariableProxy* proxy = expr->expression()->AsVariableProxy(); 1779 VariableProxy* proxy = expr->expression()->AsVariableProxy();
1780 Variable* variable = proxy->var(); 1780 Variable* variable = proxy->var();
1781 DCHECK(is_sloppy(language_mode()) || variable->HasThisName(isolate())); 1781 DCHECK(is_sloppy(language_mode()) || variable->HasThisName(isolate()));
1782 switch (variable->location()) { 1782 switch (variable->location()) {
1783 case VariableLocation::GLOBAL: 1783 case VariableLocation::GLOBAL:
1784 case VariableLocation::UNALLOCATED: { 1784 case VariableLocation::UNALLOCATED: {
1785 // Global var, let, const or variables not explicitly declared. 1785 // Global var, let, const or variables not explicitly declared.
1786 Register native_context = execution_result()->NewRegister();
1787 Register global_object = execution_result()->NewRegister(); 1786 Register global_object = execution_result()->NewRegister();
1788 builder() 1787 builder()
1789 ->LoadContextSlot(execution_context()->reg(), 1788 ->LoadContextSlot(execution_context()->reg(),
1790 Context::NATIVE_CONTEXT_INDEX) 1789 Context::GLOBAL_OBJECT_INDEX)
1791 .StoreAccumulatorInRegister(native_context)
1792 .LoadContextSlot(native_context, Context::EXTENSION_INDEX)
1793 .StoreAccumulatorInRegister(global_object) 1790 .StoreAccumulatorInRegister(global_object)
1794 .LoadLiteral(variable->name()) 1791 .LoadLiteral(variable->name())
1795 .Delete(global_object, language_mode()); 1792 .Delete(global_object, language_mode());
1796 break; 1793 break;
1797 } 1794 }
1798 case VariableLocation::PARAMETER: 1795 case VariableLocation::PARAMETER:
1799 case VariableLocation::LOCAL: 1796 case VariableLocation::LOCAL:
1800 case VariableLocation::CONTEXT: { 1797 case VariableLocation::CONTEXT: {
1801 // Deleting local var/let/const, context variables, and arguments 1798 // Deleting local var/let/const, context variables, and arguments
1802 // does not have any effect. 1799 // does not have any effect.
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
2228 } 2225 }
2229 2226
2230 2227
2231 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { 2228 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const {
2232 return info()->feedback_vector()->GetIndex(slot); 2229 return info()->feedback_vector()->GetIndex(slot);
2233 } 2230 }
2234 2231
2235 } // namespace interpreter 2232 } // namespace interpreter
2236 } // namespace internal 2233 } // namespace internal
2237 } // namespace v8 2234 } // namespace v8
OLDNEW
« no previous file with comments | « src/ic/x64/handler-compiler-x64.cc ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698