OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 3029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3040 | 3040 |
3041 | 3041 |
3042 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 3042 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
3043 DCHECK(ToRegister(instr->context()).is(cp)); | 3043 DCHECK(ToRegister(instr->context()).is(cp)); |
3044 DCHECK(ToRegister(instr->global_object()) | 3044 DCHECK(ToRegister(instr->global_object()) |
3045 .is(LoadDescriptor::ReceiverRegister())); | 3045 .is(LoadDescriptor::ReceiverRegister())); |
3046 DCHECK(ToRegister(instr->result()).is(r3)); | 3046 DCHECK(ToRegister(instr->result()).is(r3)); |
3047 | 3047 |
3048 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 3048 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
3049 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 3049 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
3050 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 3050 Handle<Code> ic = |
3051 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, SLOPPY, | 3051 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), |
3052 PREMONOMORPHIC).code(); | 3052 SLOPPY, PREMONOMORPHIC).code(); |
3053 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3053 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3054 } | 3054 } |
3055 | 3055 |
3056 | 3056 |
3057 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 3057 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
3058 Register context = ToRegister(instr->context()); | 3058 Register context = ToRegister(instr->context()); |
3059 Register result = ToRegister(instr->result()); | 3059 Register result = ToRegister(instr->result()); |
3060 __ LoadP(result, ContextOperand(context, instr->slot_index())); | 3060 __ LoadP(result, ContextOperand(context, instr->slot_index())); |
3061 if (instr->hydrogen()->RequiresHoleCheck()) { | 3061 if (instr->hydrogen()->RequiresHoleCheck()) { |
3062 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 3062 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3159 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3159 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
3160 DCHECK(ToRegister(instr->context()).is(cp)); | 3160 DCHECK(ToRegister(instr->context()).is(cp)); |
3161 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3161 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3162 DCHECK(ToRegister(instr->result()).is(r3)); | 3162 DCHECK(ToRegister(instr->result()).is(r3)); |
3163 | 3163 |
3164 // Name is always in r5. | 3164 // Name is always in r5. |
3165 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 3165 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
3166 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3166 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
3167 Handle<Code> ic = | 3167 Handle<Code> ic = |
3168 CodeFactory::LoadICInOptimizedCode( | 3168 CodeFactory::LoadICInOptimizedCode( |
3169 isolate(), NOT_CONTEXTUAL, instr->hydrogen()->language_mode(), | 3169 isolate(), INSIDE_TYPEOF, instr->hydrogen()->language_mode(), |
3170 instr->hydrogen()->initialization_state()).code(); | 3170 instr->hydrogen()->initialization_state()).code(); |
3171 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3171 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3172 } | 3172 } |
3173 | 3173 |
3174 | 3174 |
3175 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3175 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
3176 Register scratch = scratch0(); | 3176 Register scratch = scratch0(); |
3177 Register function = ToRegister(instr->function()); | 3177 Register function = ToRegister(instr->function()); |
3178 Register result = ToRegister(instr->result()); | 3178 Register result = ToRegister(instr->result()); |
3179 | 3179 |
(...skipping 3087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6267 __ Push(scope_info); | 6267 __ Push(scope_info); |
6268 __ push(ToRegister(instr->function())); | 6268 __ push(ToRegister(instr->function())); |
6269 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6269 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6270 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6270 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6271 } | 6271 } |
6272 | 6272 |
6273 | 6273 |
6274 #undef __ | 6274 #undef __ |
6275 } // namespace internal | 6275 } // namespace internal |
6276 } // namespace v8 | 6276 } // namespace v8 |
OLD | NEW |