OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
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 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1165 } | 1165 } |
1166 | 1166 |
1167 | 1167 |
1168 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, | 1168 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, |
1169 TypeofMode typeof_mode, | 1169 TypeofMode typeof_mode, |
1170 Label* slow) { | 1170 Label* slow) { |
1171 Register current = cp; | 1171 Register current = cp; |
1172 Register next = x10; | 1172 Register next = x10; |
1173 Register temp = x11; | 1173 Register temp = x11; |
1174 | 1174 |
1175 Scope* s = scope(); | 1175 int to_check = scope()->ContextChainLengthUntilOutermostSloppyEval(); |
1176 while (s != NULL) { | 1176 for (Scope* s = scope(); to_check > 0; s = s->outer_scope()) { |
1177 if (s->num_heap_slots() > 0) { | 1177 if (!s->NeedsContext()) continue; |
1178 if (s->calls_sloppy_eval()) { | 1178 if (s->calls_sloppy_eval()) { |
1179 // Check that extension is "the hole". | 1179 // Check that extension is "the hole". |
1180 __ Ldr(temp, ContextMemOperand(current, Context::EXTENSION_INDEX)); | 1180 __ Ldr(temp, ContextMemOperand(current, Context::EXTENSION_INDEX)); |
1181 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); | 1181 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); |
1182 } | |
1183 // Load next context in chain. | |
1184 __ Ldr(next, ContextMemOperand(current, Context::PREVIOUS_INDEX)); | |
1185 // Walk the rest of the chain without clobbering cp. | |
1186 current = next; | |
1187 } | 1182 } |
1188 // If no outer scope calls eval, we do not need to check more | 1183 // Load next context in chain. |
1189 // context extensions. | 1184 __ Ldr(next, ContextMemOperand(current, Context::PREVIOUS_INDEX)); |
1190 if (!s->outer_scope_calls_sloppy_eval()) break; | 1185 // Walk the rest of the chain without clobbering cp. |
1191 s = s->outer_scope(); | 1186 current = next; |
| 1187 to_check--; |
1192 } | 1188 } |
1193 | 1189 |
1194 // All extension objects were empty and it is safe to use a normal global | 1190 // All extension objects were empty and it is safe to use a normal global |
1195 // load machinery. | 1191 // load machinery. |
1196 EmitGlobalVariableLoad(proxy, typeof_mode); | 1192 EmitGlobalVariableLoad(proxy, typeof_mode); |
1197 } | 1193 } |
1198 | 1194 |
1199 | 1195 |
1200 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, | 1196 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
1201 Label* slow) { | 1197 Label* slow) { |
(...skipping 2628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3830 } | 3826 } |
3831 | 3827 |
3832 return INTERRUPT; | 3828 return INTERRUPT; |
3833 } | 3829 } |
3834 | 3830 |
3835 | 3831 |
3836 } // namespace internal | 3832 } // namespace internal |
3837 } // namespace v8 | 3833 } // namespace v8 |
3838 | 3834 |
3839 #endif // V8_TARGET_ARCH_ARM64 | 3835 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |