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/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 2952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2963 | 2963 |
2964 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2964 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2965 DCHECK(ToRegister(instr->context()).is(cp)); | 2965 DCHECK(ToRegister(instr->context()).is(cp)); |
2966 DCHECK(ToRegister(instr->global_object()) | 2966 DCHECK(ToRegister(instr->global_object()) |
2967 .is(LoadDescriptor::ReceiverRegister())); | 2967 .is(LoadDescriptor::ReceiverRegister())); |
2968 DCHECK(ToRegister(instr->result()).is(v0)); | 2968 DCHECK(ToRegister(instr->result()).is(v0)); |
2969 | 2969 |
2970 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); | 2970 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); |
2971 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2971 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2972 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2972 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
2973 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, | 2973 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, SLOPPY, |
2974 PREMONOMORPHIC).code(); | 2974 PREMONOMORPHIC).code(); |
2975 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2975 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2976 } | 2976 } |
2977 | 2977 |
2978 | 2978 |
2979 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2979 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2980 Register context = ToRegister(instr->context()); | 2980 Register context = ToRegister(instr->context()); |
2981 Register result = ToRegister(instr->result()); | 2981 Register result = ToRegister(instr->result()); |
2982 | 2982 |
2983 __ ld(result, ContextOperand(context, instr->slot_index())); | 2983 __ ld(result, ContextOperand(context, instr->slot_index())); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3078 | 3078 |
3079 | 3079 |
3080 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3080 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
3081 DCHECK(ToRegister(instr->context()).is(cp)); | 3081 DCHECK(ToRegister(instr->context()).is(cp)); |
3082 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3082 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3083 DCHECK(ToRegister(instr->result()).is(v0)); | 3083 DCHECK(ToRegister(instr->result()).is(v0)); |
3084 | 3084 |
3085 // Name is always in a2. | 3085 // Name is always in a2. |
3086 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); | 3086 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); |
3087 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3087 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
3088 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( | 3088 Handle<Code> ic = |
3089 isolate(), NOT_CONTEXTUAL, | 3089 CodeFactory::LoadICInOptimizedCode( |
3090 instr->hydrogen()->initialization_state()).code(); | 3090 isolate(), NOT_CONTEXTUAL, instr->hydrogen()->language_mode(), |
| 3091 instr->hydrogen()->initialization_state()).code(); |
3091 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3092 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3092 } | 3093 } |
3093 | 3094 |
3094 | 3095 |
3095 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3096 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
3096 Register scratch = scratch0(); | 3097 Register scratch = scratch0(); |
3097 Register function = ToRegister(instr->function()); | 3098 Register function = ToRegister(instr->function()); |
3098 Register result = ToRegister(instr->result()); | 3099 Register result = ToRegister(instr->result()); |
3099 | 3100 |
3100 // Get the prototype or initial map from the function. | 3101 // Get the prototype or initial map from the function. |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3447 | 3448 |
3448 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3449 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
3449 DCHECK(ToRegister(instr->context()).is(cp)); | 3450 DCHECK(ToRegister(instr->context()).is(cp)); |
3450 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3451 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3451 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | 3452 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
3452 | 3453 |
3453 if (instr->hydrogen()->HasVectorAndSlot()) { | 3454 if (instr->hydrogen()->HasVectorAndSlot()) { |
3454 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | 3455 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
3455 } | 3456 } |
3456 | 3457 |
3457 Handle<Code> ic = | 3458 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode( |
3458 CodeFactory::KeyedLoadICInOptimizedCode( | 3459 isolate(), instr->hydrogen()->language_mode(), |
3459 isolate(), instr->hydrogen()->initialization_state()).code(); | 3460 instr->hydrogen()->initialization_state()).code(); |
3460 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3461 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3461 } | 3462 } |
3462 | 3463 |
3463 | 3464 |
3464 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3465 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
3465 Register scratch = scratch0(); | 3466 Register scratch = scratch0(); |
3466 Register temp = scratch1(); | 3467 Register temp = scratch1(); |
3467 Register result = ToRegister(instr->result()); | 3468 Register result = ToRegister(instr->result()); |
3468 | 3469 |
3469 if (instr->hydrogen()->from_inlined()) { | 3470 if (instr->hydrogen()->from_inlined()) { |
(...skipping 2699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6169 __ Push(at, ToRegister(instr->function())); | 6170 __ Push(at, ToRegister(instr->function())); |
6170 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6171 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6171 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6172 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6172 } | 6173 } |
6173 | 6174 |
6174 | 6175 |
6175 #undef __ | 6176 #undef __ |
6176 | 6177 |
6177 } // namespace internal | 6178 } // namespace internal |
6178 } // namespace v8 | 6179 } // namespace v8 |
OLD | NEW |