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 #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 3988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3999 Handle<Code> ic = | 3999 Handle<Code> ic = |
4000 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); | 4000 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); |
4001 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4001 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4002 } else { | 4002 } else { |
4003 __ li(a0, Operand(arity)); | 4003 __ li(a0, Operand(arity)); |
4004 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); | 4004 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); |
4005 } | 4005 } |
4006 } | 4006 } |
4007 | 4007 |
4008 | 4008 |
4009 void LCodeGen::DoCallNew(LCallNew* instr) { | |
4010 DCHECK(ToRegister(instr->context()).is(cp)); | |
4011 DCHECK(ToRegister(instr->constructor()).is(a1)); | |
4012 DCHECK(ToRegister(instr->result()).is(v0)); | |
4013 | |
4014 __ li(a0, Operand(instr->arity())); | |
4015 // No cell in a2 for construct type feedback in optimized code | |
4016 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); | |
4017 CallConstructStub stub(isolate(), NO_CALL_CONSTRUCTOR_FLAGS); | |
4018 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | |
4019 } | |
4020 | |
4021 | |
4022 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 4009 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
4023 DCHECK(ToRegister(instr->context()).is(cp)); | 4010 DCHECK(ToRegister(instr->context()).is(cp)); |
4024 DCHECK(ToRegister(instr->constructor()).is(a1)); | 4011 DCHECK(ToRegister(instr->constructor()).is(a1)); |
4025 DCHECK(ToRegister(instr->result()).is(v0)); | 4012 DCHECK(ToRegister(instr->result()).is(v0)); |
4026 | 4013 |
4027 __ li(a0, Operand(instr->arity())); | 4014 __ li(a0, Operand(instr->arity())); |
4028 if (instr->arity() == 1) { | 4015 if (instr->arity() == 1) { |
4029 // We only need the allocation site for the case we have a length argument. | 4016 // We only need the allocation site for the case we have a length argument. |
4030 // The case may bail out to the runtime, which will determine the correct | 4017 // The case may bail out to the runtime, which will determine the correct |
4031 // elements kind with the site. | 4018 // elements kind with the site. |
(...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6016 __ Push(at, ToRegister(instr->function())); | 6003 __ Push(at, ToRegister(instr->function())); |
6017 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6004 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6018 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6005 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6019 } | 6006 } |
6020 | 6007 |
6021 | 6008 |
6022 #undef __ | 6009 #undef __ |
6023 | 6010 |
6024 } // namespace internal | 6011 } // namespace internal |
6025 } // namespace v8 | 6012 } // namespace v8 |
OLD | NEW |