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