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 2934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2945 | 2945 |
2946 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2946 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2947 DCHECK(ToRegister(instr->context()).is(cp)); | 2947 DCHECK(ToRegister(instr->context()).is(cp)); |
2948 DCHECK(ToRegister(instr->global_object()) | 2948 DCHECK(ToRegister(instr->global_object()) |
2949 .is(LoadDescriptor::ReceiverRegister())); | 2949 .is(LoadDescriptor::ReceiverRegister())); |
2950 DCHECK(ToRegister(instr->result()).is(r0)); | 2950 DCHECK(ToRegister(instr->result()).is(r0)); |
2951 | 2951 |
2952 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 2952 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
2953 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2953 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2954 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2954 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
2955 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, SLOPPY, | 2955 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, |
2956 PREMONOMORPHIC).code(); | 2956 PREMONOMORPHIC).code(); |
2957 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2957 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2958 } | 2958 } |
2959 | 2959 |
2960 | 2960 |
2961 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2961 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2962 Register context = ToRegister(instr->context()); | 2962 Register context = ToRegister(instr->context()); |
2963 Register result = ToRegister(instr->result()); | 2963 Register result = ToRegister(instr->result()); |
2964 __ ldr(result, ContextOperand(context, instr->slot_index())); | 2964 __ ldr(result, ContextOperand(context, instr->slot_index())); |
2965 if (instr->hydrogen()->RequiresHoleCheck()) { | 2965 if (instr->hydrogen()->RequiresHoleCheck()) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3041 | 3041 |
3042 | 3042 |
3043 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3043 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
3044 DCHECK(ToRegister(instr->context()).is(cp)); | 3044 DCHECK(ToRegister(instr->context()).is(cp)); |
3045 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3045 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3046 DCHECK(ToRegister(instr->result()).is(r0)); | 3046 DCHECK(ToRegister(instr->result()).is(r0)); |
3047 | 3047 |
3048 // Name is always in r2. | 3048 // Name is always in r2. |
3049 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 3049 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
3050 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3050 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
3051 Handle<Code> ic = | 3051 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( |
3052 CodeFactory::LoadICInOptimizedCode( | 3052 isolate(), NOT_CONTEXTUAL, |
3053 isolate(), NOT_CONTEXTUAL, instr->hydrogen()->language_mode(), | 3053 instr->hydrogen()->initialization_state()).code(); |
3054 instr->hydrogen()->initialization_state()).code(); | |
3055 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 3054 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
3056 } | 3055 } |
3057 | 3056 |
3058 | 3057 |
3059 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3058 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
3060 Register scratch = scratch0(); | 3059 Register scratch = scratch0(); |
3061 Register function = ToRegister(instr->function()); | 3060 Register function = ToRegister(instr->function()); |
3062 Register result = ToRegister(instr->result()); | 3061 Register result = ToRegister(instr->result()); |
3063 | 3062 |
3064 // Get the prototype or initial map from the function. | 3063 // Get the prototype or initial map from the function. |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3351 | 3350 |
3352 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3351 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
3353 DCHECK(ToRegister(instr->context()).is(cp)); | 3352 DCHECK(ToRegister(instr->context()).is(cp)); |
3354 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3353 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3355 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | 3354 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
3356 | 3355 |
3357 if (instr->hydrogen()->HasVectorAndSlot()) { | 3356 if (instr->hydrogen()->HasVectorAndSlot()) { |
3358 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | 3357 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
3359 } | 3358 } |
3360 | 3359 |
3361 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode( | 3360 Handle<Code> ic = |
3362 isolate(), instr->hydrogen()->language_mode(), | 3361 CodeFactory::KeyedLoadICInOptimizedCode( |
3363 instr->hydrogen()->initialization_state()).code(); | 3362 isolate(), instr->hydrogen()->initialization_state()).code(); |
3364 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 3363 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
3365 } | 3364 } |
3366 | 3365 |
3367 | 3366 |
3368 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3367 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
3369 Register scratch = scratch0(); | 3368 Register scratch = scratch0(); |
3370 Register result = ToRegister(instr->result()); | 3369 Register result = ToRegister(instr->result()); |
3371 | 3370 |
3372 if (instr->hydrogen()->from_inlined()) { | 3371 if (instr->hydrogen()->from_inlined()) { |
3373 __ sub(result, sp, Operand(2 * kPointerSize)); | 3372 __ sub(result, sp, Operand(2 * kPointerSize)); |
(...skipping 2587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5961 __ push(ToRegister(instr->function())); | 5960 __ push(ToRegister(instr->function())); |
5962 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5961 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5963 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5962 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5964 } | 5963 } |
5965 | 5964 |
5966 | 5965 |
5967 #undef __ | 5966 #undef __ |
5968 | 5967 |
5969 } // namespace internal | 5968 } // namespace internal |
5970 } // namespace v8 | 5969 } // namespace v8 |
OLD | NEW |