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 | 2964 |
2965 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2965 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2966 DCHECK(ToRegister(instr->context()).is(cp)); | 2966 DCHECK(ToRegister(instr->context()).is(cp)); |
2967 DCHECK(ToRegister(instr->global_object()) | 2967 DCHECK(ToRegister(instr->global_object()) |
2968 .is(LoadDescriptor::ReceiverRegister())); | 2968 .is(LoadDescriptor::ReceiverRegister())); |
2969 DCHECK(ToRegister(instr->result()).is(r0)); | 2969 DCHECK(ToRegister(instr->result()).is(r0)); |
2970 | 2970 |
2971 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 2971 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
2972 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2972 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2973 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2973 Handle<Code> ic = |
2974 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, SLOPPY, | 2974 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), |
2975 PREMONOMORPHIC).code(); | 2975 SLOPPY, PREMONOMORPHIC).code(); |
2976 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2976 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2977 } | 2977 } |
2978 | 2978 |
2979 | 2979 |
2980 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2980 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2981 Register context = ToRegister(instr->context()); | 2981 Register context = ToRegister(instr->context()); |
2982 Register result = ToRegister(instr->result()); | 2982 Register result = ToRegister(instr->result()); |
2983 __ ldr(result, ContextOperand(context, instr->slot_index())); | 2983 __ ldr(result, ContextOperand(context, instr->slot_index())); |
2984 if (instr->hydrogen()->RequiresHoleCheck()) { | 2984 if (instr->hydrogen()->RequiresHoleCheck()) { |
2985 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 2985 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3062 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3062 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
3063 DCHECK(ToRegister(instr->context()).is(cp)); | 3063 DCHECK(ToRegister(instr->context()).is(cp)); |
3064 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3064 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3065 DCHECK(ToRegister(instr->result()).is(r0)); | 3065 DCHECK(ToRegister(instr->result()).is(r0)); |
3066 | 3066 |
3067 // Name is always in r2. | 3067 // Name is always in r2. |
3068 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 3068 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
3069 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3069 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
3070 Handle<Code> ic = | 3070 Handle<Code> ic = |
3071 CodeFactory::LoadICInOptimizedCode( | 3071 CodeFactory::LoadICInOptimizedCode( |
3072 isolate(), NOT_CONTEXTUAL, instr->hydrogen()->language_mode(), | 3072 isolate(), INSIDE_TYPEOF, instr->hydrogen()->language_mode(), |
3073 instr->hydrogen()->initialization_state()).code(); | 3073 instr->hydrogen()->initialization_state()).code(); |
3074 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 3074 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
3075 } | 3075 } |
3076 | 3076 |
3077 | 3077 |
3078 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3078 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
3079 Register scratch = scratch0(); | 3079 Register scratch = scratch0(); |
3080 Register function = ToRegister(instr->function()); | 3080 Register function = ToRegister(instr->function()); |
3081 Register result = ToRegister(instr->result()); | 3081 Register result = ToRegister(instr->result()); |
3082 | 3082 |
(...skipping 2907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5990 __ push(ToRegister(instr->function())); | 5990 __ push(ToRegister(instr->function())); |
5991 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5991 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5992 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5992 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5993 } | 5993 } |
5994 | 5994 |
5995 | 5995 |
5996 #undef __ | 5996 #undef __ |
5997 | 5997 |
5998 } // namespace internal | 5998 } // namespace internal |
5999 } // namespace v8 | 5999 } // namespace v8 |
OLD | NEW |