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/arm/lithium-codegen-arm.h" | 7 #include "src/arm/lithium-codegen-arm.h" |
8 #include "src/arm/lithium-gap-resolver-arm.h" | 8 #include "src/arm/lithium-gap-resolver-arm.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 3017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3028 DCHECK(ToRegister(instr->context()).is(cp)); | 3028 DCHECK(ToRegister(instr->context()).is(cp)); |
3029 DCHECK(ToRegister(instr->global_object()) | 3029 DCHECK(ToRegister(instr->global_object()) |
3030 .is(LoadDescriptor::ReceiverRegister())); | 3030 .is(LoadDescriptor::ReceiverRegister())); |
3031 DCHECK(ToRegister(instr->result()).is(r0)); | 3031 DCHECK(ToRegister(instr->result()).is(r0)); |
3032 | 3032 |
3033 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 3033 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
3034 if (FLAG_vector_ics) { | 3034 if (FLAG_vector_ics) { |
3035 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 3035 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
3036 } | 3036 } |
3037 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 3037 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
3038 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode).code(); | 3038 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, |
| 3039 PREMONOMORPHIC).code(); |
3039 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3040 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3040 } | 3041 } |
3041 | 3042 |
3042 | 3043 |
3043 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { | 3044 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { |
3044 Register value = ToRegister(instr->value()); | 3045 Register value = ToRegister(instr->value()); |
3045 Register cell = scratch0(); | 3046 Register cell = scratch0(); |
3046 | 3047 |
3047 // Load the cell. | 3048 // Load the cell. |
3048 __ mov(cell, Operand(instr->hydrogen()->cell().handle())); | 3049 __ mov(cell, Operand(instr->hydrogen()->cell().handle())); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3150 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3151 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
3151 DCHECK(ToRegister(instr->context()).is(cp)); | 3152 DCHECK(ToRegister(instr->context()).is(cp)); |
3152 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3153 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3153 DCHECK(ToRegister(instr->result()).is(r0)); | 3154 DCHECK(ToRegister(instr->result()).is(r0)); |
3154 | 3155 |
3155 // Name is always in r2. | 3156 // Name is always in r2. |
3156 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 3157 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
3157 if (FLAG_vector_ics) { | 3158 if (FLAG_vector_ics) { |
3158 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3159 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
3159 } | 3160 } |
3160 Handle<Code> ic = | 3161 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( |
3161 CodeFactory::LoadICInOptimizedCode(isolate(), NOT_CONTEXTUAL).code(); | 3162 isolate(), NOT_CONTEXTUAL, |
| 3163 instr->hydrogen()->initialization_state()).code(); |
3162 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 3164 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
3163 } | 3165 } |
3164 | 3166 |
3165 | 3167 |
3166 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3168 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
3167 Register scratch = scratch0(); | 3169 Register scratch = scratch0(); |
3168 Register function = ToRegister(instr->function()); | 3170 Register function = ToRegister(instr->function()); |
3169 Register result = ToRegister(instr->result()); | 3171 Register result = ToRegister(instr->result()); |
3170 | 3172 |
3171 // Get the prototype or initial map from the function. | 3173 // Get the prototype or initial map from the function. |
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4303 } | 4305 } |
4304 } | 4306 } |
4305 | 4307 |
4306 | 4308 |
4307 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4309 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4308 DCHECK(ToRegister(instr->context()).is(cp)); | 4310 DCHECK(ToRegister(instr->context()).is(cp)); |
4309 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | 4311 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
4310 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | 4312 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
4311 | 4313 |
4312 __ mov(StoreDescriptor::NameRegister(), Operand(instr->name())); | 4314 __ mov(StoreDescriptor::NameRegister(), Operand(instr->name())); |
4313 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->language_mode()); | 4315 Handle<Code> ic = |
| 4316 StoreIC::initialize_stub(isolate(), instr->language_mode(), |
| 4317 instr->hydrogen()->initialization_state()); |
4314 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 4318 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
4315 } | 4319 } |
4316 | 4320 |
4317 | 4321 |
4318 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4322 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4319 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; | 4323 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; |
4320 if (instr->index()->IsConstantOperand()) { | 4324 if (instr->index()->IsConstantOperand()) { |
4321 Operand index = ToOperand(instr->index()); | 4325 Operand index = ToOperand(instr->index()); |
4322 Register length = ToRegister(instr->length()); | 4326 Register length = ToRegister(instr->length()); |
4323 __ cmp(length, index); | 4327 __ cmp(length, index); |
(...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5978 __ Push(scope_info); | 5982 __ Push(scope_info); |
5979 __ push(ToRegister(instr->function())); | 5983 __ push(ToRegister(instr->function())); |
5980 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5984 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5981 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5985 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5982 } | 5986 } |
5983 | 5987 |
5984 | 5988 |
5985 #undef __ | 5989 #undef __ |
5986 | 5990 |
5987 } } // namespace v8::internal | 5991 } } // namespace v8::internal |
OLD | NEW |