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 2860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2871 | 2871 |
2872 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2872 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2873 DCHECK(ToRegister(instr->context()).is(rsi)); | 2873 DCHECK(ToRegister(instr->context()).is(rsi)); |
2874 DCHECK(ToRegister(instr->global_object()) | 2874 DCHECK(ToRegister(instr->global_object()) |
2875 .is(LoadDescriptor::ReceiverRegister())); | 2875 .is(LoadDescriptor::ReceiverRegister())); |
2876 DCHECK(ToRegister(instr->result()).is(rax)); | 2876 DCHECK(ToRegister(instr->result()).is(rax)); |
2877 | 2877 |
2878 __ Move(LoadDescriptor::NameRegister(), instr->name()); | 2878 __ Move(LoadDescriptor::NameRegister(), instr->name()); |
2879 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2879 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2880 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2880 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
2881 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, | 2881 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, SLOPPY, |
2882 PREMONOMORPHIC).code(); | 2882 PREMONOMORPHIC).code(); |
2883 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2883 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2884 } | 2884 } |
2885 | 2885 |
2886 | 2886 |
2887 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2887 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2888 Register context = ToRegister(instr->context()); | 2888 Register context = ToRegister(instr->context()); |
2889 Register result = ToRegister(instr->result()); | 2889 Register result = ToRegister(instr->result()); |
2890 __ movp(result, ContextOperand(context, instr->slot_index())); | 2890 __ movp(result, ContextOperand(context, instr->slot_index())); |
2891 if (instr->hydrogen()->RequiresHoleCheck()) { | 2891 if (instr->hydrogen()->RequiresHoleCheck()) { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2987 } | 2987 } |
2988 | 2988 |
2989 | 2989 |
2990 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 2990 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
2991 DCHECK(ToRegister(instr->context()).is(rsi)); | 2991 DCHECK(ToRegister(instr->context()).is(rsi)); |
2992 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 2992 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
2993 DCHECK(ToRegister(instr->result()).is(rax)); | 2993 DCHECK(ToRegister(instr->result()).is(rax)); |
2994 | 2994 |
2995 __ Move(LoadDescriptor::NameRegister(), instr->name()); | 2995 __ Move(LoadDescriptor::NameRegister(), instr->name()); |
2996 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 2996 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
2997 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( | 2997 Handle<Code> ic = |
2998 isolate(), NOT_CONTEXTUAL, | 2998 CodeFactory::LoadICInOptimizedCode( |
2999 instr->hydrogen()->initialization_state()).code(); | 2999 isolate(), NOT_CONTEXTUAL, instr->hydrogen()->language_mode(), |
| 3000 instr->hydrogen()->initialization_state()).code(); |
3000 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3001 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3001 } | 3002 } |
3002 | 3003 |
3003 | 3004 |
3004 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3005 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
3005 Register function = ToRegister(instr->function()); | 3006 Register function = ToRegister(instr->function()); |
3006 Register result = ToRegister(instr->result()); | 3007 Register result = ToRegister(instr->result()); |
3007 | 3008 |
3008 // Get the prototype or initial map from the function. | 3009 // Get the prototype or initial map from the function. |
3009 __ movp(result, | 3010 __ movp(result, |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3285 | 3286 |
3286 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3287 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
3287 DCHECK(ToRegister(instr->context()).is(rsi)); | 3288 DCHECK(ToRegister(instr->context()).is(rsi)); |
3288 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3289 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3289 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | 3290 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
3290 | 3291 |
3291 if (instr->hydrogen()->HasVectorAndSlot()) { | 3292 if (instr->hydrogen()->HasVectorAndSlot()) { |
3292 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | 3293 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
3293 } | 3294 } |
3294 | 3295 |
3295 Handle<Code> ic = | 3296 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode( |
3296 CodeFactory::KeyedLoadICInOptimizedCode( | 3297 isolate(), instr->hydrogen()->language_mode(), |
3297 isolate(), instr->hydrogen()->initialization_state()).code(); | 3298 instr->hydrogen()->initialization_state()).code(); |
3298 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3299 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3299 } | 3300 } |
3300 | 3301 |
3301 | 3302 |
3302 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3303 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
3303 Register result = ToRegister(instr->result()); | 3304 Register result = ToRegister(instr->result()); |
3304 | 3305 |
3305 if (instr->hydrogen()->from_inlined()) { | 3306 if (instr->hydrogen()->from_inlined()) { |
3306 __ leap(result, Operand(rsp, -kFPOnStackSize + -kPCOnStackSize)); | 3307 __ leap(result, Operand(rsp, -kFPOnStackSize + -kPCOnStackSize)); |
3307 } else { | 3308 } else { |
(...skipping 2697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6005 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6006 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6006 } | 6007 } |
6007 | 6008 |
6008 | 6009 |
6009 #undef __ | 6010 #undef __ |
6010 | 6011 |
6011 } // namespace internal | 6012 } // namespace internal |
6012 } // namespace v8 | 6013 } // namespace v8 |
6013 | 6014 |
6014 #endif // V8_TARGET_ARCH_X64 | 6015 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |