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

Side by Side Diff: src/mips64/code-stubs-mips64.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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/ic/handler-compiler.h" 10 #include "src/ic/handler-compiler.h"
(...skipping 2678 matching lines...) Expand 10 before | Expand all | Expand 10 after
2689 Register jmp_reg = a4; 2689 Register jmp_reg = a4;
2690 __ ld(jmp_reg, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); 2690 __ ld(jmp_reg, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
2691 __ ld(jmp_reg, FieldMemOperand(jmp_reg, 2691 __ ld(jmp_reg, FieldMemOperand(jmp_reg,
2692 SharedFunctionInfo::kConstructStubOffset)); 2692 SharedFunctionInfo::kConstructStubOffset));
2693 __ Daddu(at, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); 2693 __ Daddu(at, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag));
2694 __ Jump(at); 2694 __ Jump(at);
2695 2695
2696 // a0: number of arguments 2696 // a0: number of arguments
2697 // a1: called object 2697 // a1: called object
2698 // a5: object type 2698 // a5: object type
2699 Label do_call;
2700 __ bind(&slow); 2699 __ bind(&slow);
2701 __ Branch(&non_function_call, ne, a5, Operand(JS_FUNCTION_PROXY_TYPE)); 2700 {
2702 __ GetBuiltinFunction( 2701 // Overwrite the original receiver with the (original) target (not necessary
2703 a1, Context::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR_BUILTIN_INDEX); 2702 // in case of rdi being smi, when we jump directly to non_function_call
2704 __ jmp(&do_call); 2703 // below).
2704 __ dsll(at, a0, kPointerSizeLog2);
2705 __ daddu(at, sp, at);
2706 __ sd(a1, MemOperand(at));
2705 2707
2706 __ bind(&non_function_call); 2708 __ Branch(&non_function_call, ne, a5, Operand(JS_FUNCTION_PROXY_TYPE));
2707 __ GetBuiltinFunction( 2709 // TODO(neis): This doesn't match the ES6 spec for [[Construct]] on proxies.
2708 a1, Context::CALL_NON_FUNCTION_AS_CONSTRUCTOR_BUILTIN_INDEX); 2710 __ ld(a1, FieldMemOperand(a1, JSFunctionProxy::kConstructTrapOffset));
2709 __ bind(&do_call); 2711 __ Jump(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
2710 // Set expected number of arguments to zero (not changing r0). 2712
2711 __ li(a2, Operand(0, RelocInfo::NONE32)); 2713 __ bind(&non_function_call);
2712 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), 2714 {
2713 RelocInfo::CODE_TARGET); 2715 // Determine the delegate for the target (if any).
2716 FrameScope scope(masm, StackFrame::INTERNAL);
2717 __ SmiTag(a0);
2718 __ Push(a0, a1);
2719 __ CallRuntime(Runtime::kGetConstructorDelegate, 1);
2720 __ mov(a1, v0);
2721 __ Pop(a0);
2722 __ SmiUntag(a0);
2723 }
2724 // The delegate is always a regular function.
2725 __ AssertFunction(a1);
2726 __ Jump(masm->isolate()->builtins()->CallFunction(),
2727 RelocInfo::CODE_TARGET);
2728 }
2714 } 2729 }
2715 2730
2716 2731
2717 // StringCharCodeAtGenerator. 2732 // StringCharCodeAtGenerator.
2718 void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) { 2733 void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) {
2719 DCHECK(!a4.is(index_)); 2734 DCHECK(!a4.is(index_));
2720 DCHECK(!a4.is(result_)); 2735 DCHECK(!a4.is(result_));
2721 DCHECK(!a4.is(object_)); 2736 DCHECK(!a4.is(object_));
2722 2737
2723 // If the receiver is a smi trigger the non-string case. 2738 // If the receiver is a smi trigger the non-string case.
(...skipping 3049 matching lines...) Expand 10 before | Expand all | Expand 10 after
5773 MemOperand(fp, 6 * kPointerSize), NULL); 5788 MemOperand(fp, 6 * kPointerSize), NULL);
5774 } 5789 }
5775 5790
5776 5791
5777 #undef __ 5792 #undef __
5778 5793
5779 } // namespace internal 5794 } // namespace internal
5780 } // namespace v8 5795 } // namespace v8
5781 5796
5782 #endif // V8_TARGET_ARCH_MIPS64 5797 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« src/arm/code-stubs-arm.cc ('K') | « src/mips/code-stubs-mips.cc ('k') | src/runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698