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/v8.h" | 5 #include "src/v8.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/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 3992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4003 Register name = ToRegister(instr->name()); | 4003 Register name = ToRegister(instr->name()); |
4004 DCHECK(receiver.is(LoadDescriptor::ReceiverRegister())); | 4004 DCHECK(receiver.is(LoadDescriptor::ReceiverRegister())); |
4005 DCHECK(name.is(LoadDescriptor::NameRegister())); | 4005 DCHECK(name.is(LoadDescriptor::NameRegister())); |
4006 DCHECK(receiver.is(a1)); | 4006 DCHECK(receiver.is(a1)); |
4007 DCHECK(name.is(a2)); | 4007 DCHECK(name.is(a2)); |
4008 | 4008 |
4009 Register scratch = a4; | 4009 Register scratch = a4; |
4010 Register extra = a5; | 4010 Register extra = a5; |
4011 Register extra2 = a6; | 4011 Register extra2 = a6; |
4012 Register extra3 = t1; | 4012 Register extra3 = t1; |
4013 #ifdef DEBUG | |
4014 Register slot = FLAG_vector_ics ? ToRegister(instr->slot()) : no_reg; | |
4015 Register vector = FLAG_vector_ics ? ToRegister(instr->vector()) : no_reg; | |
4016 DCHECK(!FLAG_vector_ics || | |
4017 !AreAliased(slot, vector, scratch, extra, extra2, extra3)); | |
4018 #endif | |
4019 | 4013 |
4020 // Important for the tail-call. | 4014 // The probe will tail call to a handler if found. |
4021 bool must_teardown_frame = NeedsEagerFrame(); | 4015 isolate()->stub_cache()->GenerateProbe( |
4022 | 4016 masm(), Code::LOAD_IC, instr->hydrogen()->flags(), false, receiver, name, |
4023 if (!instr->hydrogen()->is_just_miss()) { | 4017 scratch, extra, extra2, extra3); |
4024 DCHECK(!instr->hydrogen()->is_keyed_load()); | |
4025 | |
4026 // The probe will tail call to a handler if found. | |
4027 isolate()->stub_cache()->GenerateProbe( | |
4028 masm(), Code::LOAD_IC, instr->hydrogen()->flags(), must_teardown_frame, | |
4029 receiver, name, scratch, extra, extra2, extra3); | |
4030 } | |
4031 | 4018 |
4032 // Tail call to miss if we ended up here. | 4019 // Tail call to miss if we ended up here. |
4033 if (must_teardown_frame) __ LeaveFrame(StackFrame::INTERNAL); | 4020 LoadIC::GenerateMiss(masm()); |
4034 if (instr->hydrogen()->is_keyed_load()) { | |
4035 KeyedLoadIC::GenerateMiss(masm()); | |
4036 } else { | |
4037 LoadIC::GenerateMiss(masm()); | |
4038 } | |
4039 } | 4021 } |
4040 | 4022 |
4041 | 4023 |
4042 void LCodeGen::DoCallWithDescriptor(LCallWithDescriptor* instr) { | 4024 void LCodeGen::DoCallWithDescriptor(LCallWithDescriptor* instr) { |
4043 DCHECK(ToRegister(instr->result()).is(v0)); | 4025 DCHECK(ToRegister(instr->result()).is(v0)); |
4044 | 4026 |
4045 if (instr->hydrogen()->IsTailCall()) { | 4027 if (instr->hydrogen()->IsTailCall()) { |
4046 if (NeedsEagerFrame()) __ LeaveFrame(StackFrame::INTERNAL); | 4028 if (NeedsEagerFrame()) __ LeaveFrame(StackFrame::INTERNAL); |
4047 | 4029 |
4048 if (instr->target()->IsConstantOperand()) { | 4030 if (instr->target()->IsConstantOperand()) { |
(...skipping 1991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6040 __ li(at, scope_info); | 6022 __ li(at, scope_info); |
6041 __ Push(at, ToRegister(instr->function())); | 6023 __ Push(at, ToRegister(instr->function())); |
6042 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6024 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6043 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6025 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6044 } | 6026 } |
6045 | 6027 |
6046 | 6028 |
6047 #undef __ | 6029 #undef __ |
6048 | 6030 |
6049 } } // namespace v8::internal | 6031 } } // namespace v8::internal |
OLD | NEW |