OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
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 2846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2857 | 2857 |
2858 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2858 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2859 DCHECK(ToRegister(instr->context()).is(rsi)); | 2859 DCHECK(ToRegister(instr->context()).is(rsi)); |
2860 DCHECK(ToRegister(instr->global_object()) | 2860 DCHECK(ToRegister(instr->global_object()) |
2861 .is(LoadDescriptor::ReceiverRegister())); | 2861 .is(LoadDescriptor::ReceiverRegister())); |
2862 DCHECK(ToRegister(instr->result()).is(rax)); | 2862 DCHECK(ToRegister(instr->result()).is(rax)); |
2863 | 2863 |
2864 __ Move(LoadDescriptor::NameRegister(), instr->name()); | 2864 __ Move(LoadDescriptor::NameRegister(), instr->name()); |
2865 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2865 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2866 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2866 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
2867 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, SLOPPY, | 2867 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, |
2868 PREMONOMORPHIC).code(); | 2868 PREMONOMORPHIC).code(); |
2869 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2869 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2870 } | 2870 } |
2871 | 2871 |
2872 | 2872 |
2873 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2873 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2874 Register context = ToRegister(instr->context()); | 2874 Register context = ToRegister(instr->context()); |
2875 Register result = ToRegister(instr->result()); | 2875 Register result = ToRegister(instr->result()); |
2876 __ movp(result, ContextOperand(context, instr->slot_index())); | 2876 __ movp(result, ContextOperand(context, instr->slot_index())); |
2877 if (instr->hydrogen()->RequiresHoleCheck()) { | 2877 if (instr->hydrogen()->RequiresHoleCheck()) { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2973 } | 2973 } |
2974 | 2974 |
2975 | 2975 |
2976 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 2976 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
2977 DCHECK(ToRegister(instr->context()).is(rsi)); | 2977 DCHECK(ToRegister(instr->context()).is(rsi)); |
2978 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 2978 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
2979 DCHECK(ToRegister(instr->result()).is(rax)); | 2979 DCHECK(ToRegister(instr->result()).is(rax)); |
2980 | 2980 |
2981 __ Move(LoadDescriptor::NameRegister(), instr->name()); | 2981 __ Move(LoadDescriptor::NameRegister(), instr->name()); |
2982 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 2982 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
2983 Handle<Code> ic = | 2983 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( |
2984 CodeFactory::LoadICInOptimizedCode( | 2984 isolate(), NOT_CONTEXTUAL, |
2985 isolate(), NOT_CONTEXTUAL, instr->hydrogen()->language_mode(), | 2985 instr->hydrogen()->initialization_state()).code(); |
2986 instr->hydrogen()->initialization_state()).code(); | |
2987 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2986 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2988 } | 2987 } |
2989 | 2988 |
2990 | 2989 |
2991 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 2990 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
2992 Register function = ToRegister(instr->function()); | 2991 Register function = ToRegister(instr->function()); |
2993 Register result = ToRegister(instr->result()); | 2992 Register result = ToRegister(instr->result()); |
2994 | 2993 |
2995 // Get the prototype or initial map from the function. | 2994 // Get the prototype or initial map from the function. |
2996 __ movp(result, | 2995 __ movp(result, |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3272 | 3271 |
3273 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3272 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
3274 DCHECK(ToRegister(instr->context()).is(rsi)); | 3273 DCHECK(ToRegister(instr->context()).is(rsi)); |
3275 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3274 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3276 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | 3275 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
3277 | 3276 |
3278 if (instr->hydrogen()->HasVectorAndSlot()) { | 3277 if (instr->hydrogen()->HasVectorAndSlot()) { |
3279 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | 3278 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
3280 } | 3279 } |
3281 | 3280 |
3282 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode( | 3281 Handle<Code> ic = |
3283 isolate(), instr->hydrogen()->language_mode(), | 3282 CodeFactory::KeyedLoadICInOptimizedCode( |
3284 instr->hydrogen()->initialization_state()).code(); | 3283 isolate(), instr->hydrogen()->initialization_state()).code(); |
3285 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3284 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3286 } | 3285 } |
3287 | 3286 |
3288 | 3287 |
3289 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3288 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
3290 Register result = ToRegister(instr->result()); | 3289 Register result = ToRegister(instr->result()); |
3291 | 3290 |
3292 if (instr->hydrogen()->from_inlined()) { | 3291 if (instr->hydrogen()->from_inlined()) { |
3293 __ leap(result, Operand(rsp, -kFPOnStackSize + -kPCOnStackSize)); | 3292 __ leap(result, Operand(rsp, -kFPOnStackSize + -kPCOnStackSize)); |
3294 } else { | 3293 } else { |
(...skipping 2689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5984 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5983 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5985 } | 5984 } |
5986 | 5985 |
5987 | 5986 |
5988 #undef __ | 5987 #undef __ |
5989 | 5988 |
5990 } // namespace internal | 5989 } // namespace internal |
5991 } // namespace v8 | 5990 } // namespace v8 |
5992 | 5991 |
5993 #endif // V8_TARGET_ARCH_X64 | 5992 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |