Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: src/mips/code-stubs-mips.cc

Issue 1335723002: [stubs] Simplify the non-function case of CallConstructStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix ia32. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_MIPS 5 #if V8_TARGET_ARCH_MIPS
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 2642 matching lines...) Expand 10 before | Expand all | Expand 10 after
2653 Register jmp_reg = t0; 2653 Register jmp_reg = t0;
2654 __ lw(jmp_reg, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); 2654 __ lw(jmp_reg, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
2655 __ lw(jmp_reg, FieldMemOperand(jmp_reg, 2655 __ lw(jmp_reg, FieldMemOperand(jmp_reg,
2656 SharedFunctionInfo::kConstructStubOffset)); 2656 SharedFunctionInfo::kConstructStubOffset));
2657 __ Addu(at, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); 2657 __ Addu(at, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag));
2658 __ Jump(at); 2658 __ Jump(at);
2659 2659
2660 // a0: number of arguments 2660 // a0: number of arguments
2661 // a1: called object 2661 // a1: called object
2662 // t1: object type 2662 // t1: object type
2663 Label do_call;
2664 __ bind(&slow); 2663 __ bind(&slow);
2665 __ Branch(&non_function_call, ne, t1, Operand(JS_FUNCTION_PROXY_TYPE)); 2664 {
2666 __ GetBuiltinFunction( 2665 // Overwrite the original receiver with the (original) target (not necessary
2667 a1, Context::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR_BUILTIN_INDEX); 2666 // in case of rdi being smi, when we jump directly to non_function_call
2668 __ jmp(&do_call); 2667 // below).
2668 __ sll(at, a0, kPointerSizeLog2);
2669 __ addu(at, sp, at);
2670 __ sw(a1, MemOperand(at));
2669 2671
2670 __ bind(&non_function_call); 2672 __ Branch(&non_function_call, ne, t1, Operand(JS_FUNCTION_PROXY_TYPE));
2671 __ GetBuiltinFunction( 2673 // TODO(neis): This doesn't match the ES6 spec for [[Construct]] on proxies.
2672 a1, Context::CALL_NON_FUNCTION_AS_CONSTRUCTOR_BUILTIN_INDEX); 2674 __ lw(a1, FieldMemOperand(a1, JSFunctionProxy::kConstructTrapOffset));
2673 __ bind(&do_call); 2675 __ Jump(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
2674 // Set expected number of arguments to zero (not changing r0). 2676
2675 __ li(a2, Operand(0, RelocInfo::NONE32)); 2677 __ bind(&non_function_call);
2676 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), 2678 {
2677 RelocInfo::CODE_TARGET); 2679 // Determine the delegate for the target (if any).
2680 FrameScope scope(masm, StackFrame::INTERNAL);
2681 __ sll(a0, a0, kSmiTagSize); // Smi tagged.
2682 __ Push(a0, a1);
2683 __ CallRuntime(Runtime::kGetConstructorDelegate, 1);
2684 __ mov(a1, v0);
2685 __ Pop(a0);
2686 __ sra(a0, a0, kSmiTagSize); // Un-tag.
2687 }
2688 // The delegate is always a regular function.
2689 __ AssertFunction(a1);
2690 __ Jump(masm->isolate()->builtins()->CallFunction(),
2691 RelocInfo::CODE_TARGET);
2692 }
2678 } 2693 }
2679 2694
2680 2695
2681 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) { 2696 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) {
2682 __ lw(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 2697 __ lw(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
2683 __ lw(vector, FieldMemOperand(vector, 2698 __ lw(vector, FieldMemOperand(vector,
2684 JSFunction::kSharedFunctionInfoOffset)); 2699 JSFunction::kSharedFunctionInfoOffset));
2685 __ lw(vector, FieldMemOperand(vector, 2700 __ lw(vector, FieldMemOperand(vector,
2686 SharedFunctionInfo::kFeedbackVectorOffset)); 2701 SharedFunctionInfo::kFeedbackVectorOffset));
2687 } 2702 }
(...skipping 3059 matching lines...) Expand 10 before | Expand all | Expand 10 after
5747 MemOperand(fp, 6 * kPointerSize), NULL); 5762 MemOperand(fp, 6 * kPointerSize), NULL);
5748 } 5763 }
5749 5764
5750 5765
5751 #undef __ 5766 #undef __
5752 5767
5753 } // namespace internal 5768 } // namespace internal
5754 } // namespace v8 5769 } // namespace v8
5755 5770
5756 #endif // V8_TARGET_ARCH_MIPS 5771 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698