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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 2510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2521 // Jump to the function-specific construct stub. | 2521 // Jump to the function-specific construct stub. |
2522 Register jmp_reg = r4; | 2522 Register jmp_reg = r4; |
2523 __ ldr(jmp_reg, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); | 2523 __ ldr(jmp_reg, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); |
2524 __ ldr(jmp_reg, FieldMemOperand(jmp_reg, | 2524 __ ldr(jmp_reg, FieldMemOperand(jmp_reg, |
2525 SharedFunctionInfo::kConstructStubOffset)); | 2525 SharedFunctionInfo::kConstructStubOffset)); |
2526 __ add(pc, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); | 2526 __ add(pc, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); |
2527 | 2527 |
2528 // r0: number of arguments | 2528 // r0: number of arguments |
2529 // r1: called object | 2529 // r1: called object |
2530 // r5: object type | 2530 // r5: object type |
2531 Label do_call; | |
2532 __ bind(&slow); | 2531 __ bind(&slow); |
2533 __ cmp(r5, Operand(JS_FUNCTION_PROXY_TYPE)); | 2532 { |
2534 __ b(ne, &non_function_call); | 2533 __ cmp(r5, Operand(JS_FUNCTION_PROXY_TYPE)); |
2535 __ GetBuiltinFunction( | 2534 __ b(ne, &non_function_call); |
2536 r1, Context::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR_BUILTIN_INDEX); | 2535 // TODO(neis): This doesn't match the ES6 spec for [[Construct]] on proxies. |
2537 __ jmp(&do_call); | 2536 __ ldr(r1, FieldMemOperand(r1, JSFunctionProxy::kConstructTrapOffset)); |
| 2537 __ Jump(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
2538 | 2538 |
2539 __ bind(&non_function_call); | 2539 __ bind(&non_function_call); |
2540 __ GetBuiltinFunction( | 2540 { |
2541 r1, Context::CALL_NON_FUNCTION_AS_CONSTRUCTOR_BUILTIN_INDEX); | 2541 // Determine the delegate for the target (if any). |
2542 __ bind(&do_call); | 2542 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
2543 // Set expected number of arguments to zero (not changing r0). | 2543 __ SmiTag(r0); |
2544 __ mov(r2, Operand::Zero()); | 2544 __ Push(r0, r1); |
2545 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), | 2545 __ CallRuntime(Runtime::kGetConstructorDelegate, 1); |
2546 RelocInfo::CODE_TARGET); | 2546 __ mov(r1, r0); |
| 2547 __ Pop(r0); |
| 2548 __ SmiUntag(r0); |
| 2549 } |
| 2550 // The delegate is always a regular function. |
| 2551 __ AssertFunction(r1); |
| 2552 __ Jump(masm->isolate()->builtins()->CallFunction(), |
| 2553 RelocInfo::CODE_TARGET); |
| 2554 } |
2547 } | 2555 } |
2548 | 2556 |
2549 | 2557 |
2550 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) { | 2558 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) { |
2551 __ ldr(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 2559 __ ldr(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
2552 __ ldr(vector, FieldMemOperand(vector, | 2560 __ ldr(vector, FieldMemOperand(vector, |
2553 JSFunction::kSharedFunctionInfoOffset)); | 2561 JSFunction::kSharedFunctionInfoOffset)); |
2554 __ ldr(vector, FieldMemOperand(vector, | 2562 __ ldr(vector, FieldMemOperand(vector, |
2555 SharedFunctionInfo::kFeedbackVectorOffset)); | 2563 SharedFunctionInfo::kFeedbackVectorOffset)); |
2556 } | 2564 } |
(...skipping 2990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5547 MemOperand(fp, 6 * kPointerSize), NULL); | 5555 MemOperand(fp, 6 * kPointerSize), NULL); |
5548 } | 5556 } |
5549 | 5557 |
5550 | 5558 |
5551 #undef __ | 5559 #undef __ |
5552 | 5560 |
5553 } // namespace internal | 5561 } // namespace internal |
5554 } // namespace v8 | 5562 } // namespace v8 |
5555 | 5563 |
5556 #endif // V8_TARGET_ARCH_ARM | 5564 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |