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 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } | 1182 } |
1183 // Load next context in chain. | 1183 // Load next context in chain. |
1184 __ Ldr(next, ContextMemOperand(current, Context::PREVIOUS_INDEX)); | 1184 __ Ldr(next, ContextMemOperand(current, Context::PREVIOUS_INDEX)); |
1185 // Walk the rest of the chain without clobbering cp. | 1185 // Walk the rest of the chain without clobbering cp. |
1186 current = next; | 1186 current = next; |
1187 } | 1187 } |
1188 // If no outer scope calls eval, we do not need to check more | 1188 // If no outer scope calls eval, we do not need to check more |
1189 // context extensions. | 1189 // context extensions. |
1190 if (!s->outer_scope_calls_sloppy_eval() || s->is_eval_scope()) break; | 1190 if (!s->outer_scope_calls_sloppy_eval()) break; |
1191 s = s->outer_scope(); | 1191 s = s->outer_scope(); |
1192 } | 1192 } |
1193 | 1193 |
1194 if (s->is_eval_scope()) { | |
1195 Label loop, fast; | |
1196 __ Mov(next, current); | |
1197 | |
1198 __ Bind(&loop); | |
1199 // Terminate at native context. | |
1200 __ Ldr(temp, FieldMemOperand(next, HeapObject::kMapOffset)); | |
1201 __ JumpIfRoot(temp, Heap::kNativeContextMapRootIndex, &fast); | |
1202 // Check that extension is "the hole". | |
1203 __ Ldr(temp, ContextMemOperand(next, Context::EXTENSION_INDEX)); | |
1204 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); | |
1205 // Load next context in chain. | |
1206 __ Ldr(next, ContextMemOperand(next, Context::PREVIOUS_INDEX)); | |
1207 __ B(&loop); | |
1208 __ Bind(&fast); | |
1209 } | |
1210 | |
1211 // All extension objects were empty and it is safe to use a normal global | 1194 // All extension objects were empty and it is safe to use a normal global |
1212 // load machinery. | 1195 // load machinery. |
1213 EmitGlobalVariableLoad(proxy, typeof_mode); | 1196 EmitGlobalVariableLoad(proxy, typeof_mode); |
1214 } | 1197 } |
1215 | 1198 |
1216 | 1199 |
1217 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, | 1200 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
1218 Label* slow) { | 1201 Label* slow) { |
1219 DCHECK(var->IsContextSlot()); | 1202 DCHECK(var->IsContextSlot()); |
1220 Register context = cp; | 1203 Register context = cp; |
(...skipping 2626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3847 } | 3830 } |
3848 | 3831 |
3849 return INTERRUPT; | 3832 return INTERRUPT; |
3850 } | 3833 } |
3851 | 3834 |
3852 | 3835 |
3853 } // namespace internal | 3836 } // namespace internal |
3854 } // namespace v8 | 3837 } // namespace v8 |
3855 | 3838 |
3856 #endif // V8_TARGET_ARCH_ARM64 | 3839 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |