Chromium Code Reviews| 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 // Overwrite the original receiver with the (original) target (not necessary |
| 2535 __ GetBuiltinFunction( | 2534 // in case of rdi being smi, when we jump directly to non_function_call |
| 2536 r1, Context::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR_BUILTIN_INDEX); | 2535 // below). |
| 2537 __ jmp(&do_call); | 2536 __ str(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2)); |
|
Michael Starzinger
2015/09/11 09:17:37
This is confusing. Why do we suddenly need to patc
Benedikt Meurer
2015/09/11 09:20:28
You're right, receiver stays the same.
| |
| 2538 | 2537 |
| 2539 __ bind(&non_function_call); | 2538 __ cmp(r5, Operand(JS_FUNCTION_PROXY_TYPE)); |
| 2540 __ GetBuiltinFunction( | 2539 __ b(ne, &non_function_call); |
| 2541 r1, Context::CALL_NON_FUNCTION_AS_CONSTRUCTOR_BUILTIN_INDEX); | 2540 // TODO(neis): This doesn't match the ES6 spec for [[Construct]] on proxies. |
| 2542 __ bind(&do_call); | 2541 __ ldr(r1, FieldMemOperand(r1, JSFunctionProxy::kConstructTrapOffset)); |
| 2543 // Set expected number of arguments to zero (not changing r0). | 2542 __ Jump(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
| 2544 __ mov(r2, Operand::Zero()); | 2543 |
| 2545 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), | 2544 __ bind(&non_function_call); |
| 2546 RelocInfo::CODE_TARGET); | 2545 { |
| 2546 // Determine the delegate for the target (if any). | |
| 2547 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | |
| 2548 __ SmiTag(r0); | |
| 2549 __ Push(r0, r1); | |
| 2550 __ CallRuntime(Runtime::kGetConstructorDelegate, 1); | |
| 2551 __ mov(r1, r0); | |
| 2552 __ Pop(r0); | |
| 2553 __ SmiUntag(r0); | |
| 2554 } | |
| 2555 // The delegate is always a regular function. | |
| 2556 __ AssertFunction(r1); | |
| 2557 __ Jump(masm->isolate()->builtins()->CallFunction(), | |
| 2558 RelocInfo::CODE_TARGET); | |
| 2559 } | |
| 2547 } | 2560 } |
| 2548 | 2561 |
| 2549 | 2562 |
| 2550 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) { | 2563 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) { |
| 2551 __ ldr(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 2564 __ ldr(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 2552 __ ldr(vector, FieldMemOperand(vector, | 2565 __ ldr(vector, FieldMemOperand(vector, |
| 2553 JSFunction::kSharedFunctionInfoOffset)); | 2566 JSFunction::kSharedFunctionInfoOffset)); |
| 2554 __ ldr(vector, FieldMemOperand(vector, | 2567 __ ldr(vector, FieldMemOperand(vector, |
| 2555 SharedFunctionInfo::kFeedbackVectorOffset)); | 2568 SharedFunctionInfo::kFeedbackVectorOffset)); |
| 2556 } | 2569 } |
| (...skipping 2990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5547 MemOperand(fp, 6 * kPointerSize), NULL); | 5560 MemOperand(fp, 6 * kPointerSize), NULL); |
| 5548 } | 5561 } |
| 5549 | 5562 |
| 5550 | 5563 |
| 5551 #undef __ | 5564 #undef __ |
| 5552 | 5565 |
| 5553 } // namespace internal | 5566 } // namespace internal |
| 5554 } // namespace v8 | 5567 } // namespace v8 |
| 5555 | 5568 |
| 5556 #endif // V8_TARGET_ARCH_ARM | 5569 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |