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

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.cc

Issue 2263123002: Find the last outer eval scope to check in fullcodegen rather than scope analysis (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add ports Created 4 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 unified diff | Download patch
« no previous file with comments | « src/ast/scopes.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #if V8_TARGET_ARCH_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 } 1177 }
1178 1178
1179 1179
1180 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, 1180 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
1181 TypeofMode typeof_mode, 1181 TypeofMode typeof_mode,
1182 Label* slow) { 1182 Label* slow) {
1183 Register current = cp; 1183 Register current = cp;
1184 Register next = r1; 1184 Register next = r1;
1185 Register temp = r2; 1185 Register temp = r2;
1186 1186
1187 Scope* s = scope(); 1187 int to_check = scope()->ContextChainLengthUntilOutermostSloppyEval();
1188 while (s != NULL) { 1188 for (Scope* s = scope(); to_check > 0; s = s->outer_scope()) {
1189 if (s->num_heap_slots() > 0) { 1189 if (!s->NeedsContext()) continue;
1190 if (s->calls_sloppy_eval()) { 1190 if (s->calls_sloppy_eval()) {
1191 // Check that extension is "the hole". 1191 // Check that extension is "the hole".
1192 __ ldr(temp, ContextMemOperand(current, Context::EXTENSION_INDEX)); 1192 __ ldr(temp, ContextMemOperand(current, Context::EXTENSION_INDEX));
1193 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); 1193 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow);
1194 }
1195 // Load next context in chain.
1196 __ ldr(next, ContextMemOperand(current, Context::PREVIOUS_INDEX));
1197 // Walk the rest of the chain without clobbering cp.
1198 current = next;
1199 } 1194 }
1200 // If no outer scope calls eval, we do not need to check more 1195 // Load next context in chain.
1201 // context extensions. 1196 __ ldr(next, ContextMemOperand(current, Context::PREVIOUS_INDEX));
1202 if (!s->outer_scope_calls_sloppy_eval()) break; 1197 // Walk the rest of the chain without clobbering cp.
1203 s = s->outer_scope(); 1198 current = next;
1199 to_check--;
1204 } 1200 }
1205 1201
1206 // All extension objects were empty and it is safe to use a normal global 1202 // All extension objects were empty and it is safe to use a normal global
1207 // load machinery. 1203 // load machinery.
1208 EmitGlobalVariableLoad(proxy, typeof_mode); 1204 EmitGlobalVariableLoad(proxy, typeof_mode);
1209 } 1205 }
1210 1206
1211 1207
1212 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, 1208 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var,
1213 Label* slow) { 1209 Label* slow) {
(...skipping 2606 matching lines...) Expand 10 before | Expand all | Expand 10 after
3820 DCHECK(interrupt_address == 3816 DCHECK(interrupt_address ==
3821 isolate->builtins()->OnStackReplacement()->entry()); 3817 isolate->builtins()->OnStackReplacement()->entry());
3822 return ON_STACK_REPLACEMENT; 3818 return ON_STACK_REPLACEMENT;
3823 } 3819 }
3824 3820
3825 3821
3826 } // namespace internal 3822 } // namespace internal
3827 } // namespace v8 3823 } // namespace v8
3828 3824
3829 #endif // V8_TARGET_ARCH_ARM 3825 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/ast/scopes.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698