| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 __ b(ne, &non_function_call); | 498 __ b(ne, &non_function_call); |
| 499 | 499 |
| 500 // Jump to the function-specific construct stub. | 500 // Jump to the function-specific construct stub. |
| 501 __ ldr(r2, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); | 501 __ ldr(r2, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); |
| 502 __ ldr(r2, FieldMemOperand(r2, SharedFunctionInfo::kConstructStubOffset)); | 502 __ ldr(r2, FieldMemOperand(r2, SharedFunctionInfo::kConstructStubOffset)); |
| 503 __ add(pc, r2, Operand(Code::kHeaderSize - kHeapObjectTag)); | 503 __ add(pc, r2, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 504 | 504 |
| 505 // r0: number of arguments | 505 // r0: number of arguments |
| 506 // r1: called object | 506 // r1: called object |
| 507 __ bind(&non_function_call); | 507 __ bind(&non_function_call); |
| 508 // CALL_NON_FUNCTION expects the non-function constructor as receiver | |
| 509 // (instead of the original receiver from the call site). The receiver is | |
| 510 // stack element argc. | |
| 511 __ str(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2)); | |
| 512 // Set expected number of arguments to zero (not changing r0). | 508 // Set expected number of arguments to zero (not changing r0). |
| 513 __ mov(r2, Operand(0)); | 509 __ mov(r2, Operand(0)); |
| 514 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); | 510 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); |
| 515 __ Jump(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)), | 511 __ Jump(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)), |
| 516 RelocInfo::CODE_TARGET); | 512 RelocInfo::CODE_TARGET); |
| 517 } | 513 } |
| 518 | 514 |
| 519 | 515 |
| 520 static void Generate_JSConstructStubHelper(MacroAssembler* masm, | 516 static void Generate_JSConstructStubHelper(MacroAssembler* masm, |
| 521 bool is_api_function) { | 517 bool is_api_function) { |
| (...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1333 __ bind(&dont_adapt_arguments); | 1329 __ bind(&dont_adapt_arguments); |
| 1334 __ Jump(r3); | 1330 __ Jump(r3); |
| 1335 } | 1331 } |
| 1336 | 1332 |
| 1337 | 1333 |
| 1338 #undef __ | 1334 #undef __ |
| 1339 | 1335 |
| 1340 } } // namespace v8::internal | 1336 } } // namespace v8::internal |
| 1341 | 1337 |
| 1342 #endif // V8_TARGET_ARCH_ARM | 1338 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |