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

Side by Side Diff: src/crankshaft/mips64/lithium-codegen-mips64.cc

Issue 1609893003: [es6] Tail calls support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebasing Created 4 years, 10 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/crankshaft/mips/lithium-codegen-mips.cc ('k') | src/crankshaft/x64/lithium-codegen-x64.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 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/crankshaft/hydrogen-osr.h" 9 #include "src/crankshaft/hydrogen-osr.h"
10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h"
(...skipping 3856 matching lines...) Expand 10 before | Expand all | Expand 10 after
3867 3867
3868 // Load the code entry address 3868 // Load the code entry address
3869 __ ld(at, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); 3869 __ ld(at, FieldMemOperand(a1, JSFunction::kCodeEntryOffset));
3870 __ Call(at); 3870 __ Call(at);
3871 3871
3872 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); 3872 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT);
3873 } 3873 }
3874 3874
3875 3875
3876 void LCodeGen::DoCallFunction(LCallFunction* instr) { 3876 void LCodeGen::DoCallFunction(LCallFunction* instr) {
3877 HCallFunction* hinstr = instr->hydrogen();
3877 DCHECK(ToRegister(instr->context()).is(cp)); 3878 DCHECK(ToRegister(instr->context()).is(cp));
3878 DCHECK(ToRegister(instr->function()).is(a1)); 3879 DCHECK(ToRegister(instr->function()).is(a1));
3879 DCHECK(ToRegister(instr->result()).is(v0)); 3880 DCHECK(ToRegister(instr->result()).is(v0));
3880 3881
3881 int arity = instr->arity(); 3882 int arity = instr->arity();
3882 ConvertReceiverMode mode = instr->hydrogen()->convert_mode(); 3883 ConvertReceiverMode mode = hinstr->convert_mode();
3883 if (instr->hydrogen()->HasVectorAndSlot()) { 3884 TailCallMode tail_call_mode = hinstr->tail_call_mode();
3885 if (hinstr->HasVectorAndSlot()) {
3884 Register slot_register = ToRegister(instr->temp_slot()); 3886 Register slot_register = ToRegister(instr->temp_slot());
3885 Register vector_register = ToRegister(instr->temp_vector()); 3887 Register vector_register = ToRegister(instr->temp_vector());
3886 DCHECK(slot_register.is(a3)); 3888 DCHECK(slot_register.is(a3));
3887 DCHECK(vector_register.is(a2)); 3889 DCHECK(vector_register.is(a2));
3888 3890
3889 AllowDeferredHandleDereference vector_structure_check; 3891 AllowDeferredHandleDereference vector_structure_check;
3890 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); 3892 Handle<TypeFeedbackVector> vector = hinstr->feedback_vector();
3891 int index = vector->GetIndex(instr->hydrogen()->slot()); 3893 int index = vector->GetIndex(hinstr->slot());
3892 3894
3893 __ li(vector_register, vector); 3895 __ li(vector_register, vector);
3894 __ li(slot_register, Operand(Smi::FromInt(index))); 3896 __ li(slot_register, Operand(Smi::FromInt(index)));
3895 3897
3896 Handle<Code> ic = 3898 Handle<Code> ic = CodeFactory::CallICInOptimizedCode(isolate(), arity, mode,
3897 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); 3899 tail_call_mode)
3900 .code();
3898 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3901 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3899 } else { 3902 } else {
3900 __ li(a0, Operand(arity)); 3903 __ li(a0, Operand(arity));
3901 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); 3904 CallCode(isolate()->builtins()->Call(mode, tail_call_mode),
3905 RelocInfo::CODE_TARGET, instr);
3902 } 3906 }
3903 } 3907 }
3904 3908
3905 3909
3906 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { 3910 void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
3907 DCHECK(ToRegister(instr->context()).is(cp)); 3911 DCHECK(ToRegister(instr->context()).is(cp));
3908 DCHECK(ToRegister(instr->constructor()).is(a1)); 3912 DCHECK(ToRegister(instr->constructor()).is(a1));
3909 DCHECK(ToRegister(instr->result()).is(v0)); 3913 DCHECK(ToRegister(instr->result()).is(v0));
3910 3914
3911 __ li(a0, Operand(instr->arity())); 3915 __ li(a0, Operand(instr->arity()));
(...skipping 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after
5802 __ Push(at, ToRegister(instr->function())); 5806 __ Push(at, ToRegister(instr->function()));
5803 CallRuntime(Runtime::kPushBlockContext, instr); 5807 CallRuntime(Runtime::kPushBlockContext, instr);
5804 RecordSafepoint(Safepoint::kNoLazyDeopt); 5808 RecordSafepoint(Safepoint::kNoLazyDeopt);
5805 } 5809 }
5806 5810
5807 5811
5808 #undef __ 5812 #undef __
5809 5813
5810 } // namespace internal 5814 } // namespace internal
5811 } // namespace v8 5815 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/mips/lithium-codegen-mips.cc ('k') | src/crankshaft/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698