| OLD | NEW |
| 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 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1262 TypeofMode typeof_mode, | 1262 TypeofMode typeof_mode, |
| 1263 Label* slow) { | 1263 Label* slow) { |
| 1264 Register current = cp; | 1264 Register current = cp; |
| 1265 Register next = r1; | 1265 Register next = r1; |
| 1266 Register temp = r2; | 1266 Register temp = r2; |
| 1267 | 1267 |
| 1268 Scope* s = scope(); | 1268 Scope* s = scope(); |
| 1269 while (s != NULL) { | 1269 while (s != NULL) { |
| 1270 if (s->num_heap_slots() > 0) { | 1270 if (s->num_heap_slots() > 0) { |
| 1271 if (s->calls_sloppy_eval()) { | 1271 if (s->calls_sloppy_eval()) { |
| 1272 // Check that extension is NULL. | 1272 // Check that extension is "the hole". |
| 1273 __ ldr(temp, ContextMemOperand(current, Context::EXTENSION_INDEX)); | 1273 __ ldr(temp, ContextMemOperand(current, Context::EXTENSION_INDEX)); |
| 1274 __ tst(temp, temp); | 1274 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); |
| 1275 __ b(ne, slow); | |
| 1276 } | 1275 } |
| 1277 // Load next context in chain. | 1276 // Load next context in chain. |
| 1278 __ ldr(next, ContextMemOperand(current, Context::PREVIOUS_INDEX)); | 1277 __ ldr(next, ContextMemOperand(current, Context::PREVIOUS_INDEX)); |
| 1279 // Walk the rest of the chain without clobbering cp. | 1278 // Walk the rest of the chain without clobbering cp. |
| 1280 current = next; | 1279 current = next; |
| 1281 } | 1280 } |
| 1282 // If no outer scope calls eval, we do not need to check more | 1281 // If no outer scope calls eval, we do not need to check more |
| 1283 // context extensions. | 1282 // context extensions. |
| 1284 if (!s->outer_scope_calls_sloppy_eval() || s->is_eval_scope()) break; | 1283 if (!s->outer_scope_calls_sloppy_eval() || s->is_eval_scope()) break; |
| 1285 s = s->outer_scope(); | 1284 s = s->outer_scope(); |
| 1286 } | 1285 } |
| 1287 | 1286 |
| 1288 if (s->is_eval_scope()) { | 1287 if (s->is_eval_scope()) { |
| 1289 Label loop, fast; | 1288 Label loop, fast; |
| 1290 if (!current.is(next)) { | 1289 if (!current.is(next)) { |
| 1291 __ Move(next, current); | 1290 __ Move(next, current); |
| 1292 } | 1291 } |
| 1293 __ bind(&loop); | 1292 __ bind(&loop); |
| 1294 // Terminate at native context. | 1293 // Terminate at native context. |
| 1295 __ ldr(temp, FieldMemOperand(next, HeapObject::kMapOffset)); | 1294 __ ldr(temp, FieldMemOperand(next, HeapObject::kMapOffset)); |
| 1296 __ LoadRoot(ip, Heap::kNativeContextMapRootIndex); | 1295 __ LoadRoot(ip, Heap::kNativeContextMapRootIndex); |
| 1297 __ cmp(temp, ip); | 1296 __ cmp(temp, ip); |
| 1298 __ b(eq, &fast); | 1297 __ b(eq, &fast); |
| 1299 // Check that extension is NULL. | 1298 // Check that extension is "the hole". |
| 1300 __ ldr(temp, ContextMemOperand(next, Context::EXTENSION_INDEX)); | 1299 __ ldr(temp, ContextMemOperand(next, Context::EXTENSION_INDEX)); |
| 1301 __ tst(temp, temp); | 1300 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); |
| 1302 __ b(ne, slow); | |
| 1303 // Load next context in chain. | 1301 // Load next context in chain. |
| 1304 __ ldr(next, ContextMemOperand(next, Context::PREVIOUS_INDEX)); | 1302 __ ldr(next, ContextMemOperand(next, Context::PREVIOUS_INDEX)); |
| 1305 __ b(&loop); | 1303 __ b(&loop); |
| 1306 __ bind(&fast); | 1304 __ bind(&fast); |
| 1307 } | 1305 } |
| 1308 | 1306 |
| 1309 // All extension objects were empty and it is safe to use a normal global | 1307 // All extension objects were empty and it is safe to use a normal global |
| 1310 // load machinery. | 1308 // load machinery. |
| 1311 EmitGlobalVariableLoad(proxy, typeof_mode); | 1309 EmitGlobalVariableLoad(proxy, typeof_mode); |
| 1312 } | 1310 } |
| 1313 | 1311 |
| 1314 | 1312 |
| 1315 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, | 1313 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
| 1316 Label* slow) { | 1314 Label* slow) { |
| 1317 DCHECK(var->IsContextSlot()); | 1315 DCHECK(var->IsContextSlot()); |
| 1318 Register context = cp; | 1316 Register context = cp; |
| 1319 Register next = r3; | 1317 Register next = r3; |
| 1320 Register temp = r4; | 1318 Register temp = r4; |
| 1321 | 1319 |
| 1322 for (Scope* s = scope(); s != var->scope(); s = s->outer_scope()) { | 1320 for (Scope* s = scope(); s != var->scope(); s = s->outer_scope()) { |
| 1323 if (s->num_heap_slots() > 0) { | 1321 if (s->num_heap_slots() > 0) { |
| 1324 if (s->calls_sloppy_eval()) { | 1322 if (s->calls_sloppy_eval()) { |
| 1325 // Check that extension is NULL. | 1323 // Check that extension is "the hole". |
| 1326 __ ldr(temp, ContextMemOperand(context, Context::EXTENSION_INDEX)); | 1324 __ ldr(temp, ContextMemOperand(context, Context::EXTENSION_INDEX)); |
| 1327 __ tst(temp, temp); | 1325 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); |
| 1328 __ b(ne, slow); | |
| 1329 } | 1326 } |
| 1330 __ ldr(next, ContextMemOperand(context, Context::PREVIOUS_INDEX)); | 1327 __ ldr(next, ContextMemOperand(context, Context::PREVIOUS_INDEX)); |
| 1331 // Walk the rest of the chain without clobbering cp. | 1328 // Walk the rest of the chain without clobbering cp. |
| 1332 context = next; | 1329 context = next; |
| 1333 } | 1330 } |
| 1334 } | 1331 } |
| 1335 // Check that last extension is NULL. | 1332 // Check that last extension is "the hole". |
| 1336 __ ldr(temp, ContextMemOperand(context, Context::EXTENSION_INDEX)); | 1333 __ ldr(temp, ContextMemOperand(context, Context::EXTENSION_INDEX)); |
| 1337 __ tst(temp, temp); | 1334 __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow); |
| 1338 __ b(ne, slow); | |
| 1339 | 1335 |
| 1340 // This function is used only for loads, not stores, so it's safe to | 1336 // This function is used only for loads, not stores, so it's safe to |
| 1341 // return an cp-based operand (the write barrier cannot be allowed to | 1337 // return an cp-based operand (the write barrier cannot be allowed to |
| 1342 // destroy the cp register). | 1338 // destroy the cp register). |
| 1343 return ContextMemOperand(context, var->index()); | 1339 return ContextMemOperand(context, var->index()); |
| 1344 } | 1340 } |
| 1345 | 1341 |
| 1346 | 1342 |
| 1347 void FullCodeGenerator::EmitDynamicLookupFastCase(VariableProxy* proxy, | 1343 void FullCodeGenerator::EmitDynamicLookupFastCase(VariableProxy* proxy, |
| 1348 TypeofMode typeof_mode, | 1344 TypeofMode typeof_mode, |
| (...skipping 3656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5005 DCHECK(interrupt_address == | 5001 DCHECK(interrupt_address == |
| 5006 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5002 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5007 return OSR_AFTER_STACK_CHECK; | 5003 return OSR_AFTER_STACK_CHECK; |
| 5008 } | 5004 } |
| 5009 | 5005 |
| 5010 | 5006 |
| 5011 } // namespace internal | 5007 } // namespace internal |
| 5012 } // namespace v8 | 5008 } // namespace v8 |
| 5013 | 5009 |
| 5014 #endif // V8_TARGET_ARCH_ARM | 5010 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |