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

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: Address Michi's comment. 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
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 __ Branch(&non_function_call, ne, t1, Operand(JS_FUNCTION_PROXY_TYPE));
2667 a1, Context::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR_BUILTIN_INDEX); 2666 // TODO(neis): This doesn't match the ES6 spec for [[Construct]] on proxies.
2668 __ jmp(&do_call); 2667 __ lw(a1, FieldMemOperand(a1, JSFunctionProxy::kConstructTrapOffset));
2668 __ Jump(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
2669 2669
2670 __ bind(&non_function_call); 2670 __ bind(&non_function_call);
2671 __ GetBuiltinFunction( 2671 {
2672 a1, Context::CALL_NON_FUNCTION_AS_CONSTRUCTOR_BUILTIN_INDEX); 2672 // Determine the delegate for the target (if any).
2673 __ bind(&do_call); 2673 FrameScope scope(masm, StackFrame::INTERNAL);
2674 // Set expected number of arguments to zero (not changing r0). 2674 __ sll(a0, a0, kSmiTagSize); // Smi tagged.
2675 __ li(a2, Operand(0, RelocInfo::NONE32)); 2675 __ Push(a0, a1);
2676 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), 2676 __ CallRuntime(Runtime::kGetConstructorDelegate, 1);
2677 RelocInfo::CODE_TARGET); 2677 __ mov(a1, v0);
2678 __ Pop(a0);
2679 __ sra(a0, a0, kSmiTagSize); // Un-tag.
2680 }
2681 // The delegate is always a regular function.
2682 __ AssertFunction(a1);
2683 __ Jump(masm->isolate()->builtins()->CallFunction(),
2684 RelocInfo::CODE_TARGET);
2685 }
2678 } 2686 }
2679 2687
2680 2688
2681 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) { 2689 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) {
2682 __ lw(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 2690 __ lw(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
2683 __ lw(vector, FieldMemOperand(vector, 2691 __ lw(vector, FieldMemOperand(vector,
2684 JSFunction::kSharedFunctionInfoOffset)); 2692 JSFunction::kSharedFunctionInfoOffset));
2685 __ lw(vector, FieldMemOperand(vector, 2693 __ lw(vector, FieldMemOperand(vector,
2686 SharedFunctionInfo::kFeedbackVectorOffset)); 2694 SharedFunctionInfo::kFeedbackVectorOffset));
2687 } 2695 }
(...skipping 3059 matching lines...) Expand 10 before | Expand all | Expand 10 after
5747 MemOperand(fp, 6 * kPointerSize), NULL); 5755 MemOperand(fp, 6 * kPointerSize), NULL);
5748 } 5756 }
5749 5757
5750 5758
5751 #undef __ 5759 #undef __
5752 5760
5753 } // namespace internal 5761 } // namespace internal
5754 } // namespace v8 5762 } // namespace v8
5755 5763
5756 #endif // V8_TARGET_ARCH_MIPS 5764 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698