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 2947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2958 | 2958 |
2959 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2959 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2960 DCHECK(ToRegister(instr->context()).is(cp)); | 2960 DCHECK(ToRegister(instr->context()).is(cp)); |
2961 DCHECK(ToRegister(instr->global_object()) | 2961 DCHECK(ToRegister(instr->global_object()) |
2962 .is(LoadDescriptor::ReceiverRegister())); | 2962 .is(LoadDescriptor::ReceiverRegister())); |
2963 DCHECK(ToRegister(instr->result()).is(v0)); | 2963 DCHECK(ToRegister(instr->result()).is(v0)); |
2964 | 2964 |
2965 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); | 2965 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); |
2966 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2966 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2967 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2967 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
2968 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, | 2968 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, SLOPPY, |
2969 PREMONOMORPHIC).code(); | 2969 PREMONOMORPHIC).code(); |
2970 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2970 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2971 } | 2971 } |
2972 | 2972 |
2973 | 2973 |
2974 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2974 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2975 Register context = ToRegister(instr->context()); | 2975 Register context = ToRegister(instr->context()); |
2976 Register result = ToRegister(instr->result()); | 2976 Register result = ToRegister(instr->result()); |
2977 | 2977 |
2978 __ ld(result, ContextOperand(context, instr->slot_index())); | 2978 __ ld(result, ContextOperand(context, instr->slot_index())); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3073 | 3073 |
3074 | 3074 |
3075 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3075 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
3076 DCHECK(ToRegister(instr->context()).is(cp)); | 3076 DCHECK(ToRegister(instr->context()).is(cp)); |
3077 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3077 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3078 DCHECK(ToRegister(instr->result()).is(v0)); | 3078 DCHECK(ToRegister(instr->result()).is(v0)); |
3079 | 3079 |
3080 // Name is always in a2. | 3080 // Name is always in a2. |
3081 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); | 3081 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); |
3082 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3082 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
3083 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( | 3083 Handle<Code> ic = |
3084 isolate(), NOT_CONTEXTUAL, | 3084 CodeFactory::LoadICInOptimizedCode( |
3085 instr->hydrogen()->initialization_state()).code(); | 3085 isolate(), NOT_CONTEXTUAL, instr->hydrogen()->language_mode(), |
| 3086 instr->hydrogen()->initialization_state()).code(); |
3086 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3087 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3087 } | 3088 } |
3088 | 3089 |
3089 | 3090 |
3090 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3091 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
3091 Register scratch = scratch0(); | 3092 Register scratch = scratch0(); |
3092 Register function = ToRegister(instr->function()); | 3093 Register function = ToRegister(instr->function()); |
3093 Register result = ToRegister(instr->result()); | 3094 Register result = ToRegister(instr->result()); |
3094 | 3095 |
3095 // Get the prototype or initial map from the function. | 3096 // Get the prototype or initial map from the function. |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3444 DCHECK(ToRegister(instr->context()).is(cp)); | 3445 DCHECK(ToRegister(instr->context()).is(cp)); |
3445 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3446 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3446 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | 3447 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
3447 | 3448 |
3448 if (instr->hydrogen()->HasVectorAndSlot()) { | 3449 if (instr->hydrogen()->HasVectorAndSlot()) { |
3449 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | 3450 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
3450 } | 3451 } |
3451 | 3452 |
3452 Handle<Code> ic = | 3453 Handle<Code> ic = |
3453 CodeFactory::KeyedLoadICInOptimizedCode( | 3454 CodeFactory::KeyedLoadICInOptimizedCode( |
3454 isolate(), instr->hydrogen()->initialization_state()).code(); | 3455 isolate(), instr->hydrogen()->language_mode(), |
| 3456 instr->hydrogen()->initialization_state()).code(); |
3455 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3457 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3456 } | 3458 } |
3457 | 3459 |
3458 | 3460 |
3459 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3461 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
3460 Register scratch = scratch0(); | 3462 Register scratch = scratch0(); |
3461 Register temp = scratch1(); | 3463 Register temp = scratch1(); |
3462 Register result = ToRegister(instr->result()); | 3464 Register result = ToRegister(instr->result()); |
3463 | 3465 |
3464 if (instr->hydrogen()->from_inlined()) { | 3466 if (instr->hydrogen()->from_inlined()) { |
(...skipping 2699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6164 __ Push(at, ToRegister(instr->function())); | 6166 __ Push(at, ToRegister(instr->function())); |
6165 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6167 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6166 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6168 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6167 } | 6169 } |
6168 | 6170 |
6169 | 6171 |
6170 #undef __ | 6172 #undef __ |
6171 | 6173 |
6172 } // namespace internal | 6174 } // namespace internal |
6173 } // namespace v8 | 6175 } // namespace v8 |
OLD | NEW |