OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 | 908 |
909 // Call the function. | 909 // Call the function. |
910 // r0: number of arguments | 910 // r0: number of arguments |
911 // r1: constructor function | 911 // r1: constructor function |
912 if (is_api_function) { | 912 if (is_api_function) { |
913 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); | 913 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); |
914 Handle<Code> code = | 914 Handle<Code> code = |
915 masm->isolate()->builtins()->HandleApiCallConstruct(); | 915 masm->isolate()->builtins()->HandleApiCallConstruct(); |
916 ParameterCount expected(0); | 916 ParameterCount expected(0); |
917 __ InvokeCode(code, expected, expected, | 917 __ InvokeCode(code, expected, expected, |
918 RelocInfo::CODE_TARGET, CALL_FUNCTION); | 918 RelocInfo::CODE_TARGET, CALL_FUNCTION, CALL_AS_METHOD); |
919 } else { | 919 } else { |
920 ParameterCount actual(r0); | 920 ParameterCount actual(r0); |
921 __ InvokeFunction(r1, actual, CALL_FUNCTION); | 921 __ InvokeFunction(r1, actual, CALL_FUNCTION, |
| 922 NullCallWrapper(), CALL_AS_METHOD); |
922 } | 923 } |
923 | 924 |
924 // Pop the function from the stack. | 925 // Pop the function from the stack. |
925 // sp[0]: constructor function | 926 // sp[0]: constructor function |
926 // sp[2]: receiver | 927 // sp[2]: receiver |
927 // sp[3]: constructor function | 928 // sp[3]: constructor function |
928 // sp[4]: number of arguments (smi-tagged) | 929 // sp[4]: number of arguments (smi-tagged) |
929 __ pop(); | 930 __ pop(); |
930 | 931 |
931 // Restore context from the frame. | 932 // Restore context from the frame. |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 __ mov(r9, Operand(r4)); | 1044 __ mov(r9, Operand(r4)); |
1044 } | 1045 } |
1045 | 1046 |
1046 // Invoke the code and pass argc as r0. | 1047 // Invoke the code and pass argc as r0. |
1047 __ mov(r0, Operand(r3)); | 1048 __ mov(r0, Operand(r3)); |
1048 if (is_construct) { | 1049 if (is_construct) { |
1049 __ Call(masm->isolate()->builtins()->JSConstructCall(), | 1050 __ Call(masm->isolate()->builtins()->JSConstructCall(), |
1050 RelocInfo::CODE_TARGET); | 1051 RelocInfo::CODE_TARGET); |
1051 } else { | 1052 } else { |
1052 ParameterCount actual(r0); | 1053 ParameterCount actual(r0); |
1053 __ InvokeFunction(r1, actual, CALL_FUNCTION); | 1054 __ InvokeFunction(r1, actual, CALL_FUNCTION, |
| 1055 NullCallWrapper(), CALL_AS_METHOD); |
1054 } | 1056 } |
1055 | 1057 |
1056 // Exit the JS frame and remove the parameters (except function), and return. | 1058 // Exit the JS frame and remove the parameters (except function), and return. |
1057 // Respect ABI stack constraint. | 1059 // Respect ABI stack constraint. |
1058 __ LeaveInternalFrame(); | 1060 __ LeaveInternalFrame(); |
1059 __ Jump(lr); | 1061 __ Jump(lr); |
1060 | 1062 |
1061 // r0: result | 1063 // r0: result |
1062 } | 1064 } |
1063 | 1065 |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1372 FieldMemOperand(r3, SharedFunctionInfo::kFormalParameterCountOffset)); | 1374 FieldMemOperand(r3, SharedFunctionInfo::kFormalParameterCountOffset)); |
1373 __ mov(r2, Operand(r2, ASR, kSmiTagSize)); | 1375 __ mov(r2, Operand(r2, ASR, kSmiTagSize)); |
1374 __ ldr(r3, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); | 1376 __ ldr(r3, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); |
1375 __ SetCallKind(r5, CALL_AS_METHOD); | 1377 __ SetCallKind(r5, CALL_AS_METHOD); |
1376 __ cmp(r2, r0); // Check formal and actual parameter counts. | 1378 __ cmp(r2, r0); // Check formal and actual parameter counts. |
1377 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), | 1379 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), |
1378 RelocInfo::CODE_TARGET, | 1380 RelocInfo::CODE_TARGET, |
1379 ne); | 1381 ne); |
1380 | 1382 |
1381 ParameterCount expected(0); | 1383 ParameterCount expected(0); |
1382 __ InvokeCode(r3, expected, expected, JUMP_FUNCTION); | 1384 __ InvokeCode(r3, expected, expected, JUMP_FUNCTION, |
| 1385 NullCallWrapper(), CALL_AS_METHOD); |
1383 } | 1386 } |
1384 | 1387 |
1385 | 1388 |
1386 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { | 1389 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { |
1387 const int kIndexOffset = -5 * kPointerSize; | 1390 const int kIndexOffset = -5 * kPointerSize; |
1388 const int kLimitOffset = -4 * kPointerSize; | 1391 const int kLimitOffset = -4 * kPointerSize; |
1389 const int kArgsOffset = 2 * kPointerSize; | 1392 const int kArgsOffset = 2 * kPointerSize; |
1390 const int kRecvOffset = 3 * kPointerSize; | 1393 const int kRecvOffset = 3 * kPointerSize; |
1391 const int kFunctionOffset = 4 * kPointerSize; | 1394 const int kFunctionOffset = 4 * kPointerSize; |
1392 | 1395 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1508 // arguments object. | 1511 // arguments object. |
1509 __ bind(&entry); | 1512 __ bind(&entry); |
1510 __ ldr(r1, MemOperand(fp, kLimitOffset)); | 1513 __ ldr(r1, MemOperand(fp, kLimitOffset)); |
1511 __ cmp(r0, r1); | 1514 __ cmp(r0, r1); |
1512 __ b(ne, &loop); | 1515 __ b(ne, &loop); |
1513 | 1516 |
1514 // Invoke the function. | 1517 // Invoke the function. |
1515 ParameterCount actual(r0); | 1518 ParameterCount actual(r0); |
1516 __ mov(r0, Operand(r0, ASR, kSmiTagSize)); | 1519 __ mov(r0, Operand(r0, ASR, kSmiTagSize)); |
1517 __ ldr(r1, MemOperand(fp, kFunctionOffset)); | 1520 __ ldr(r1, MemOperand(fp, kFunctionOffset)); |
1518 __ InvokeFunction(r1, actual, CALL_FUNCTION); | 1521 __ InvokeFunction(r1, actual, CALL_FUNCTION, |
| 1522 NullCallWrapper(), CALL_AS_METHOD); |
1519 | 1523 |
1520 // Tear down the internal frame and remove function, receiver and args. | 1524 // Tear down the internal frame and remove function, receiver and args. |
1521 __ LeaveInternalFrame(); | 1525 __ LeaveInternalFrame(); |
1522 __ add(sp, sp, Operand(3 * kPointerSize)); | 1526 __ add(sp, sp, Operand(3 * kPointerSize)); |
1523 __ Jump(lr); | 1527 __ Jump(lr); |
1524 } | 1528 } |
1525 | 1529 |
1526 | 1530 |
1527 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { | 1531 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { |
1528 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); | 1532 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1649 __ bind(&dont_adapt_arguments); | 1653 __ bind(&dont_adapt_arguments); |
1650 __ Jump(r3); | 1654 __ Jump(r3); |
1651 } | 1655 } |
1652 | 1656 |
1653 | 1657 |
1654 #undef __ | 1658 #undef __ |
1655 | 1659 |
1656 } } // namespace v8::internal | 1660 } } // namespace v8::internal |
1657 | 1661 |
1658 #endif // V8_TARGET_ARCH_ARM | 1662 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |