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 2979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2990 | 2990 |
2991 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2991 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2992 DCHECK(ToRegister(instr->context()).is(cp)); | 2992 DCHECK(ToRegister(instr->context()).is(cp)); |
2993 DCHECK(ToRegister(instr->global_object()) | 2993 DCHECK(ToRegister(instr->global_object()) |
2994 .is(LoadDescriptor::ReceiverRegister())); | 2994 .is(LoadDescriptor::ReceiverRegister())); |
2995 DCHECK(ToRegister(instr->result()).is(r0)); | 2995 DCHECK(ToRegister(instr->result()).is(r0)); |
2996 | 2996 |
2997 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 2997 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
2998 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2998 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2999 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2999 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
3000 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, | 3000 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, SLOPPY, |
3001 PREMONOMORPHIC).code(); | 3001 PREMONOMORPHIC).code(); |
3002 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3002 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3003 } | 3003 } |
3004 | 3004 |
3005 | 3005 |
3006 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 3006 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
3007 Register context = ToRegister(instr->context()); | 3007 Register context = ToRegister(instr->context()); |
3008 Register result = ToRegister(instr->result()); | 3008 Register result = ToRegister(instr->result()); |
3009 __ ldr(result, ContextOperand(context, instr->slot_index())); | 3009 __ ldr(result, ContextOperand(context, instr->slot_index())); |
3010 if (instr->hydrogen()->RequiresHoleCheck()) { | 3010 if (instr->hydrogen()->RequiresHoleCheck()) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3086 | 3086 |
3087 | 3087 |
3088 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3088 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
3089 DCHECK(ToRegister(instr->context()).is(cp)); | 3089 DCHECK(ToRegister(instr->context()).is(cp)); |
3090 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3090 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3091 DCHECK(ToRegister(instr->result()).is(r0)); | 3091 DCHECK(ToRegister(instr->result()).is(r0)); |
3092 | 3092 |
3093 // Name is always in r2. | 3093 // Name is always in r2. |
3094 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 3094 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
3095 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3095 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
3096 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( | 3096 Handle<Code> ic = |
3097 isolate(), NOT_CONTEXTUAL, | 3097 CodeFactory::LoadICInOptimizedCode( |
3098 instr->hydrogen()->initialization_state()).code(); | 3098 isolate(), NOT_CONTEXTUAL, instr->hydrogen()->language_mode(), |
| 3099 instr->hydrogen()->initialization_state()).code(); |
3099 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 3100 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
3100 } | 3101 } |
3101 | 3102 |
3102 | 3103 |
3103 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3104 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
3104 Register scratch = scratch0(); | 3105 Register scratch = scratch0(); |
3105 Register function = ToRegister(instr->function()); | 3106 Register function = ToRegister(instr->function()); |
3106 Register result = ToRegister(instr->result()); | 3107 Register result = ToRegister(instr->result()); |
3107 | 3108 |
3108 // Get the prototype or initial map from the function. | 3109 // Get the prototype or initial map from the function. |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3395 | 3396 |
3396 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3397 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
3397 DCHECK(ToRegister(instr->context()).is(cp)); | 3398 DCHECK(ToRegister(instr->context()).is(cp)); |
3398 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3399 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3399 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | 3400 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
3400 | 3401 |
3401 if (instr->hydrogen()->HasVectorAndSlot()) { | 3402 if (instr->hydrogen()->HasVectorAndSlot()) { |
3402 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | 3403 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
3403 } | 3404 } |
3404 | 3405 |
3405 Handle<Code> ic = | 3406 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode( |
3406 CodeFactory::KeyedLoadICInOptimizedCode( | 3407 isolate(), instr->hydrogen()->language_mode(), |
3407 isolate(), instr->hydrogen()->initialization_state()).code(); | 3408 instr->hydrogen()->initialization_state()).code(); |
3408 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 3409 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
3409 } | 3410 } |
3410 | 3411 |
3411 | 3412 |
3412 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3413 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
3413 Register scratch = scratch0(); | 3414 Register scratch = scratch0(); |
3414 Register result = ToRegister(instr->result()); | 3415 Register result = ToRegister(instr->result()); |
3415 | 3416 |
3416 if (instr->hydrogen()->from_inlined()) { | 3417 if (instr->hydrogen()->from_inlined()) { |
3417 __ sub(result, sp, Operand(2 * kPointerSize)); | 3418 __ sub(result, sp, Operand(2 * kPointerSize)); |
(...skipping 2587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6005 __ push(ToRegister(instr->function())); | 6006 __ push(ToRegister(instr->function())); |
6006 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6007 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6007 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6008 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6008 } | 6009 } |
6009 | 6010 |
6010 | 6011 |
6011 #undef __ | 6012 #undef __ |
6012 | 6013 |
6013 } // namespace internal | 6014 } // namespace internal |
6014 } // namespace v8 | 6015 } // namespace v8 |
OLD | NEW |