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 2952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2963 | 2963 |
2964 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2964 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2965 DCHECK(ToRegister(instr->context()).is(cp)); | 2965 DCHECK(ToRegister(instr->context()).is(cp)); |
2966 DCHECK(ToRegister(instr->global_object()) | 2966 DCHECK(ToRegister(instr->global_object()) |
2967 .is(LoadDescriptor::ReceiverRegister())); | 2967 .is(LoadDescriptor::ReceiverRegister())); |
2968 DCHECK(ToRegister(instr->result()).is(r0)); | 2968 DCHECK(ToRegister(instr->result()).is(r0)); |
2969 | 2969 |
2970 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 2970 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
2971 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2971 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2972 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2972 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
2973 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, | 2973 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, SLOPPY, |
2974 PREMONOMORPHIC).code(); | 2974 PREMONOMORPHIC).code(); |
2975 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2975 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2976 } | 2976 } |
2977 | 2977 |
2978 | 2978 |
2979 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2979 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2980 Register context = ToRegister(instr->context()); | 2980 Register context = ToRegister(instr->context()); |
2981 Register result = ToRegister(instr->result()); | 2981 Register result = ToRegister(instr->result()); |
2982 __ ldr(result, ContextOperand(context, instr->slot_index())); | 2982 __ ldr(result, ContextOperand(context, instr->slot_index())); |
2983 if (instr->hydrogen()->RequiresHoleCheck()) { | 2983 if (instr->hydrogen()->RequiresHoleCheck()) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3059 | 3059 |
3060 | 3060 |
3061 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3061 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
3062 DCHECK(ToRegister(instr->context()).is(cp)); | 3062 DCHECK(ToRegister(instr->context()).is(cp)); |
3063 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3063 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3064 DCHECK(ToRegister(instr->result()).is(r0)); | 3064 DCHECK(ToRegister(instr->result()).is(r0)); |
3065 | 3065 |
3066 // Name is always in r2. | 3066 // Name is always in r2. |
3067 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 3067 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
3068 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3068 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
3069 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( | 3069 Handle<Code> ic = |
3070 isolate(), NOT_CONTEXTUAL, | 3070 CodeFactory::LoadICInOptimizedCode( |
3071 instr->hydrogen()->initialization_state()).code(); | 3071 isolate(), NOT_CONTEXTUAL, instr->hydrogen()->language_mode(), |
| 3072 instr->hydrogen()->initialization_state()).code(); |
3072 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 3073 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
3073 } | 3074 } |
3074 | 3075 |
3075 | 3076 |
3076 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3077 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
3077 Register scratch = scratch0(); | 3078 Register scratch = scratch0(); |
3078 Register function = ToRegister(instr->function()); | 3079 Register function = ToRegister(instr->function()); |
3079 Register result = ToRegister(instr->result()); | 3080 Register result = ToRegister(instr->result()); |
3080 | 3081 |
3081 // Get the prototype or initial map from the function. | 3082 // Get the prototype or initial map from the function. |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3368 | 3369 |
3369 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3370 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
3370 DCHECK(ToRegister(instr->context()).is(cp)); | 3371 DCHECK(ToRegister(instr->context()).is(cp)); |
3371 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3372 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3372 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | 3373 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
3373 | 3374 |
3374 if (instr->hydrogen()->HasVectorAndSlot()) { | 3375 if (instr->hydrogen()->HasVectorAndSlot()) { |
3375 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | 3376 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
3376 } | 3377 } |
3377 | 3378 |
3378 Handle<Code> ic = | 3379 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode( |
3379 CodeFactory::KeyedLoadICInOptimizedCode( | 3380 isolate(), instr->hydrogen()->language_mode(), |
3380 isolate(), instr->hydrogen()->initialization_state()).code(); | 3381 instr->hydrogen()->initialization_state()).code(); |
3381 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 3382 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
3382 } | 3383 } |
3383 | 3384 |
3384 | 3385 |
3385 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3386 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
3386 Register scratch = scratch0(); | 3387 Register scratch = scratch0(); |
3387 Register result = ToRegister(instr->result()); | 3388 Register result = ToRegister(instr->result()); |
3388 | 3389 |
3389 if (instr->hydrogen()->from_inlined()) { | 3390 if (instr->hydrogen()->from_inlined()) { |
3390 __ sub(result, sp, Operand(2 * kPointerSize)); | 3391 __ sub(result, sp, Operand(2 * kPointerSize)); |
(...skipping 2595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5986 __ push(ToRegister(instr->function())); | 5987 __ push(ToRegister(instr->function())); |
5987 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5988 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5988 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5989 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5989 } | 5990 } |
5990 | 5991 |
5991 | 5992 |
5992 #undef __ | 5993 #undef __ |
5993 | 5994 |
5994 } // namespace internal | 5995 } // namespace internal |
5995 } // namespace v8 | 5996 } // namespace v8 |
OLD | NEW |