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 2869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2880 DCHECK(ToRegister(instr->context()).is(rsi)); | 2880 DCHECK(ToRegister(instr->context()).is(rsi)); |
2881 DCHECK(ToRegister(instr->global_object()) | 2881 DCHECK(ToRegister(instr->global_object()) |
2882 .is(LoadDescriptor::ReceiverRegister())); | 2882 .is(LoadDescriptor::ReceiverRegister())); |
2883 DCHECK(ToRegister(instr->result()).is(rax)); | 2883 DCHECK(ToRegister(instr->result()).is(rax)); |
2884 | 2884 |
2885 __ Move(LoadDescriptor::NameRegister(), instr->name()); | 2885 __ Move(LoadDescriptor::NameRegister(), instr->name()); |
2886 if (FLAG_vector_ics) { | 2886 if (FLAG_vector_ics) { |
2887 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2887 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2888 } | 2888 } |
2889 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2889 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
2890 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode).code(); | 2890 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, |
| 2891 PREMONOMORPHIC).code(); |
2891 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2892 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2892 } | 2893 } |
2893 | 2894 |
2894 | 2895 |
2895 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { | 2896 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { |
2896 Register value = ToRegister(instr->value()); | 2897 Register value = ToRegister(instr->value()); |
2897 Handle<Cell> cell_handle = instr->hydrogen()->cell().handle(); | 2898 Handle<Cell> cell_handle = instr->hydrogen()->cell().handle(); |
2898 | 2899 |
2899 // If the cell we are storing to contains the hole it could have | 2900 // If the cell we are storing to contains the hole it could have |
2900 // been deleted from the property dictionary. In that case, we need | 2901 // been deleted from the property dictionary. In that case, we need |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3023 | 3024 |
3024 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3025 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
3025 DCHECK(ToRegister(instr->context()).is(rsi)); | 3026 DCHECK(ToRegister(instr->context()).is(rsi)); |
3026 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3027 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3027 DCHECK(ToRegister(instr->result()).is(rax)); | 3028 DCHECK(ToRegister(instr->result()).is(rax)); |
3028 | 3029 |
3029 __ Move(LoadDescriptor::NameRegister(), instr->name()); | 3030 __ Move(LoadDescriptor::NameRegister(), instr->name()); |
3030 if (FLAG_vector_ics) { | 3031 if (FLAG_vector_ics) { |
3031 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3032 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
3032 } | 3033 } |
3033 Handle<Code> ic = | 3034 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( |
3034 CodeFactory::LoadICInOptimizedCode(isolate(), NOT_CONTEXTUAL).code(); | 3035 isolate(), NOT_CONTEXTUAL, |
| 3036 instr->hydrogen()->initialization_state()).code(); |
3035 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3037 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3036 } | 3038 } |
3037 | 3039 |
3038 | 3040 |
3039 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3041 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
3040 Register function = ToRegister(instr->function()); | 3042 Register function = ToRegister(instr->function()); |
3041 Register result = ToRegister(instr->result()); | 3043 Register result = ToRegister(instr->result()); |
3042 | 3044 |
3043 // Get the prototype or initial map from the function. | 3045 // Get the prototype or initial map from the function. |
3044 __ movp(result, | 3046 __ movp(result, |
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4264 } | 4266 } |
4265 } | 4267 } |
4266 | 4268 |
4267 | 4269 |
4268 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4270 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4269 DCHECK(ToRegister(instr->context()).is(rsi)); | 4271 DCHECK(ToRegister(instr->context()).is(rsi)); |
4270 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | 4272 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
4271 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | 4273 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
4272 | 4274 |
4273 __ Move(StoreDescriptor::NameRegister(), instr->hydrogen()->name()); | 4275 __ Move(StoreDescriptor::NameRegister(), instr->hydrogen()->name()); |
4274 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->language_mode()); | 4276 Handle<Code> ic = |
| 4277 StoreIC::initialize_stub(isolate(), instr->language_mode(), |
| 4278 instr->hydrogen()->initialization_state()); |
4275 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4279 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4276 } | 4280 } |
4277 | 4281 |
4278 | 4282 |
4279 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4283 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4280 Representation representation = instr->hydrogen()->length()->representation(); | 4284 Representation representation = instr->hydrogen()->length()->representation(); |
4281 DCHECK(representation.Equals(instr->hydrogen()->index()->representation())); | 4285 DCHECK(representation.Equals(instr->hydrogen()->index()->representation())); |
4282 DCHECK(representation.IsSmiOrInteger32()); | 4286 DCHECK(representation.IsSmiOrInteger32()); |
4283 | 4287 |
4284 Condition cc = instr->hydrogen()->allow_equality() ? below : below_equal; | 4288 Condition cc = instr->hydrogen()->allow_equality() ? below : below_equal; |
(...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5932 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5936 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5933 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5937 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5934 } | 5938 } |
5935 | 5939 |
5936 | 5940 |
5937 #undef __ | 5941 #undef __ |
5938 | 5942 |
5939 } } // namespace v8::internal | 5943 } } // namespace v8::internal |
5940 | 5944 |
5941 #endif // V8_TARGET_ARCH_X64 | 5945 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |