| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
| 8 | 8 |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/debug.h" | 10 #include "src/debug.h" |
| (...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1383 ParameterCount expected(0); | 1383 ParameterCount expected(0); |
| 1384 __ InvokeCode(r3, expected, expected, JUMP_FUNCTION, NullCallWrapper()); | 1384 __ InvokeCode(r3, expected, expected, JUMP_FUNCTION, NullCallWrapper()); |
| 1385 } | 1385 } |
| 1386 | 1386 |
| 1387 | 1387 |
| 1388 static void Generate_PushAppliedArguments(MacroAssembler* masm, | 1388 static void Generate_PushAppliedArguments(MacroAssembler* masm, |
| 1389 const int argumentsOffset, | 1389 const int argumentsOffset, |
| 1390 const int indexOffset, | 1390 const int indexOffset, |
| 1391 const int limitOffset) { | 1391 const int limitOffset) { |
| 1392 Label entry, loop; | 1392 Label entry, loop; |
| 1393 __ ldr(r0, MemOperand(fp, indexOffset)); | 1393 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 1394 Register key = LoadDescriptor::NameRegister(); |
| 1395 |
| 1396 __ ldr(key, MemOperand(fp, indexOffset)); |
| 1394 __ b(&entry); | 1397 __ b(&entry); |
| 1395 | 1398 |
| 1396 // Load the current argument from the arguments array and push it to the | 1399 // Load the current argument from the arguments array. |
| 1397 // stack. | |
| 1398 // r0: current argument index | |
| 1399 __ bind(&loop); | 1400 __ bind(&loop); |
| 1400 __ ldr(r1, MemOperand(fp, argumentsOffset)); | 1401 __ ldr(receiver, MemOperand(fp, argumentsOffset)); |
| 1401 __ Push(r1, r0); | |
| 1402 | 1402 |
| 1403 // Call the runtime to access the property in the arguments array. | 1403 // Use inline caching to speed up access to arguments. |
| 1404 __ CallRuntime(Runtime::kGetProperty, 2); | 1404 Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Megamorphic(); |
| 1405 __ Call(ic, RelocInfo::CODE_TARGET); |
| 1406 |
| 1407 // Push the nth argument. |
| 1405 __ push(r0); | 1408 __ push(r0); |
| 1406 | 1409 |
| 1407 // Use inline caching to access the arguments. | 1410 __ ldr(key, MemOperand(fp, indexOffset)); |
| 1408 __ ldr(r0, MemOperand(fp, indexOffset)); | 1411 __ add(key, key, Operand(1 << kSmiTagSize)); |
| 1409 __ add(r0, r0, Operand(1 << kSmiTagSize)); | 1412 __ str(key, MemOperand(fp, indexOffset)); |
| 1410 __ str(r0, MemOperand(fp, indexOffset)); | |
| 1411 | 1413 |
| 1412 // Test if the copy loop has finished copying all the elements from the | 1414 // Test if the copy loop has finished copying all the elements from the |
| 1413 // arguments object. | 1415 // arguments object. |
| 1414 __ bind(&entry); | 1416 __ bind(&entry); |
| 1415 __ ldr(r1, MemOperand(fp, limitOffset)); | 1417 __ ldr(r1, MemOperand(fp, limitOffset)); |
| 1416 __ cmp(r0, r1); | 1418 __ cmp(key, r1); |
| 1417 __ b(ne, &loop); | 1419 __ b(ne, &loop); |
| 1418 | 1420 |
| 1419 // On exit, the pushed arguments count is in r0, untagged | 1421 // On exit, the pushed arguments count is in r0, untagged |
| 1422 __ mov(r0, key); |
| 1420 __ SmiUntag(r0); | 1423 __ SmiUntag(r0); |
| 1421 } | 1424 } |
| 1422 | 1425 |
| 1423 | 1426 |
| 1424 // Used by FunctionApply and ReflectApply | 1427 // Used by FunctionApply and ReflectApply |
| 1425 static void Generate_ApplyHelper(MacroAssembler* masm, bool targetIsArgument) { | 1428 static void Generate_ApplyHelper(MacroAssembler* masm, bool targetIsArgument) { |
| 1426 const int kFormalParameters = targetIsArgument ? 3 : 2; | 1429 const int kFormalParameters = targetIsArgument ? 3 : 2; |
| 1427 const int kStackSize = kFormalParameters + 1; | 1430 const int kStackSize = kFormalParameters + 1; |
| 1428 | 1431 |
| 1429 { | 1432 { |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1785 __ bkpt(0); | 1788 __ bkpt(0); |
| 1786 } | 1789 } |
| 1787 } | 1790 } |
| 1788 | 1791 |
| 1789 | 1792 |
| 1790 #undef __ | 1793 #undef __ |
| 1791 | 1794 |
| 1792 } } // namespace v8::internal | 1795 } } // namespace v8::internal |
| 1793 | 1796 |
| 1794 #endif // V8_TARGET_ARCH_ARM | 1797 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |