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/hydrogen-osr.h" | 9 #include "src/hydrogen-osr.h" |
10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
(...skipping 2892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2903 DCHECK(ToRegister(instr->context()).is(cp)); | 2903 DCHECK(ToRegister(instr->context()).is(cp)); |
2904 DCHECK(ToRegister(instr->global_object()) | 2904 DCHECK(ToRegister(instr->global_object()) |
2905 .is(LoadDescriptor::ReceiverRegister())); | 2905 .is(LoadDescriptor::ReceiverRegister())); |
2906 DCHECK(ToRegister(instr->result()).is(v0)); | 2906 DCHECK(ToRegister(instr->result()).is(v0)); |
2907 | 2907 |
2908 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); | 2908 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); |
2909 if (FLAG_vector_ics) { | 2909 if (FLAG_vector_ics) { |
2910 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2910 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2911 } | 2911 } |
2912 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2912 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
2913 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode).code(); | 2913 Handle<Code> ic = |
2914 CodeFactory::LoadICInOptimizedCode(isolate(), mode, UNINITIALIZED).code(); | |
Toon Verwaest
2015/02/09 14:27:59
PREMONOMORPHIC
| |
2914 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2915 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2915 } | 2916 } |
2916 | 2917 |
2917 | 2918 |
2918 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { | 2919 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { |
2919 Register value = ToRegister(instr->value()); | 2920 Register value = ToRegister(instr->value()); |
2920 Register cell = scratch0(); | 2921 Register cell = scratch0(); |
2921 | 2922 |
2922 // Load the cell. | 2923 // Load the cell. |
2923 __ li(cell, Operand(instr->hydrogen()->cell().handle())); | 2924 __ li(cell, Operand(instr->hydrogen()->cell().handle())); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3044 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3045 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
3045 DCHECK(ToRegister(instr->context()).is(cp)); | 3046 DCHECK(ToRegister(instr->context()).is(cp)); |
3046 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3047 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3047 DCHECK(ToRegister(instr->result()).is(v0)); | 3048 DCHECK(ToRegister(instr->result()).is(v0)); |
3048 | 3049 |
3049 // Name is always in a2. | 3050 // Name is always in a2. |
3050 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); | 3051 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); |
3051 if (FLAG_vector_ics) { | 3052 if (FLAG_vector_ics) { |
3052 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3053 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
3053 } | 3054 } |
3054 Handle<Code> ic = | 3055 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( |
3055 CodeFactory::LoadICInOptimizedCode(isolate(), NOT_CONTEXTUAL).code(); | 3056 isolate(), NOT_CONTEXTUAL, |
3057 instr->hydrogen()->initialization_state()).code(); | |
3056 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3058 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3057 } | 3059 } |
3058 | 3060 |
3059 | 3061 |
3060 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3062 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
3061 Register scratch = scratch0(); | 3063 Register scratch = scratch0(); |
3062 Register function = ToRegister(instr->function()); | 3064 Register function = ToRegister(instr->function()); |
3063 Register result = ToRegister(instr->result()); | 3065 Register result = ToRegister(instr->result()); |
3064 | 3066 |
3065 // Get the prototype or initial map from the function. | 3067 // Get the prototype or initial map from the function. |
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4304 } | 4306 } |
4305 } | 4307 } |
4306 | 4308 |
4307 | 4309 |
4308 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4310 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4309 DCHECK(ToRegister(instr->context()).is(cp)); | 4311 DCHECK(ToRegister(instr->context()).is(cp)); |
4310 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | 4312 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
4311 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | 4313 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
4312 | 4314 |
4313 __ li(StoreDescriptor::NameRegister(), Operand(instr->name())); | 4315 __ li(StoreDescriptor::NameRegister(), Operand(instr->name())); |
4314 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->language_mode()); | 4316 Handle<Code> ic = |
4317 StoreIC::initialize_stub(isolate(), instr->language_mode(), | |
4318 instr->hydrogen()->initialization_state()); | |
4315 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4319 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4316 } | 4320 } |
4317 | 4321 |
4318 | 4322 |
4319 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4323 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4320 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; | 4324 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; |
4321 Operand operand((int64_t)0); | 4325 Operand operand((int64_t)0); |
4322 Register reg; | 4326 Register reg; |
4323 if (instr->index()->IsConstantOperand()) { | 4327 if (instr->index()->IsConstantOperand()) { |
4324 operand = ToOperand(instr->index()); | 4328 operand = ToOperand(instr->index()); |
(...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6056 __ li(at, scope_info); | 6060 __ li(at, scope_info); |
6057 __ Push(at, ToRegister(instr->function())); | 6061 __ Push(at, ToRegister(instr->function())); |
6058 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6062 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6059 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6063 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6060 } | 6064 } |
6061 | 6065 |
6062 | 6066 |
6063 #undef __ | 6067 #undef __ |
6064 | 6068 |
6065 } } // namespace v8::internal | 6069 } } // namespace v8::internal |
OLD | NEW |