| 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 2880 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2891   Handle<Code> ic = | 2891   Handle<Code> ic = | 
| 2892       CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), | 2892       CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), | 
| 2893                                          SLOPPY, PREMONOMORPHIC).code(); | 2893                                          SLOPPY, PREMONOMORPHIC).code(); | 
| 2894   CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2894   CallCode(ic, RelocInfo::CODE_TARGET, instr); | 
| 2895 } | 2895 } | 
| 2896 | 2896 | 
| 2897 | 2897 | 
| 2898 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) { | 2898 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) { | 
| 2899   DCHECK(ToRegister(instr->context()).is(rsi)); | 2899   DCHECK(ToRegister(instr->context()).is(rsi)); | 
| 2900   DCHECK(ToRegister(instr->result()).is(rax)); | 2900   DCHECK(ToRegister(instr->result()).is(rax)); | 
| 2901 | 2901   int const slot = instr->slot_index(); | 
| 2902   __ Move(LoadGlobalViaContextDescriptor::DepthRegister(), | 2902   int const depth = instr->depth(); | 
| 2903           Smi::FromInt(instr->depth())); | 2903   if (depth <= LoadGlobalViaContextStub::kMaximumDepth) { | 
| 2904   __ Move(LoadGlobalViaContextDescriptor::SlotRegister(), | 2904     __ Set(LoadGlobalViaContextDescriptor::SlotRegister(), slot); | 
| 2905           Smi::FromInt(instr->slot_index())); | 2905     __ Move(LoadGlobalViaContextDescriptor::NameRegister(), instr->name()); | 
| 2906   __ Move(LoadGlobalViaContextDescriptor::NameRegister(), instr->name()); | 2906     Handle<Code> stub = | 
| 2907 | 2907         CodeFactory::LoadGlobalViaContext(isolate(), depth).code(); | 
| 2908   Handle<Code> stub = | 2908     CallCode(stub, RelocInfo::CODE_TARGET, instr); | 
| 2909       CodeFactory::LoadGlobalViaContext(isolate(), instr->depth()).code(); | 2909   } else { | 
| 2910   CallCode(stub, RelocInfo::CODE_TARGET, instr); | 2910     __ Push(Smi::FromInt(slot)); | 
|  | 2911     __ Push(instr->name()); | 
|  | 2912     __ CallRuntime(Runtime::kLoadGlobalViaContext, 2); | 
|  | 2913   } | 
| 2911 } | 2914 } | 
| 2912 | 2915 | 
| 2913 | 2916 | 
| 2914 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2917 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 
| 2915   Register context = ToRegister(instr->context()); | 2918   Register context = ToRegister(instr->context()); | 
| 2916   Register result = ToRegister(instr->result()); | 2919   Register result = ToRegister(instr->result()); | 
| 2917   __ movp(result, ContextOperand(context, instr->slot_index())); | 2920   __ movp(result, ContextOperand(context, instr->slot_index())); | 
| 2918   if (instr->hydrogen()->RequiresHoleCheck()) { | 2921   if (instr->hydrogen()->RequiresHoleCheck()) { | 
| 2919     __ CompareRoot(result, Heap::kTheHoleValueRootIndex); | 2922     __ CompareRoot(result, Heap::kTheHoleValueRootIndex); | 
| 2920     if (instr->hydrogen()->DeoptimizesOnHole()) { | 2923     if (instr->hydrogen()->DeoptimizesOnHole()) { | 
| (...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4265                         isolate(), instr->language_mode(), | 4268                         isolate(), instr->language_mode(), | 
| 4266                         instr->hydrogen()->initialization_state()).code(); | 4269                         instr->hydrogen()->initialization_state()).code(); | 
| 4267   CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4270   CallCode(ic, RelocInfo::CODE_TARGET, instr); | 
| 4268 } | 4271 } | 
| 4269 | 4272 | 
| 4270 | 4273 | 
| 4271 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) { | 4274 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) { | 
| 4272   DCHECK(ToRegister(instr->context()).is(rsi)); | 4275   DCHECK(ToRegister(instr->context()).is(rsi)); | 
| 4273   DCHECK(ToRegister(instr->value()) | 4276   DCHECK(ToRegister(instr->value()) | 
| 4274              .is(StoreGlobalViaContextDescriptor::ValueRegister())); | 4277              .is(StoreGlobalViaContextDescriptor::ValueRegister())); | 
| 4275 | 4278   int const slot = instr->slot_index(); | 
| 4276   __ Move(StoreGlobalViaContextDescriptor::DepthRegister(), | 4279   int const depth = instr->depth(); | 
| 4277           Smi::FromInt(instr->depth())); | 4280   if (depth <= StoreGlobalViaContextStub::kMaximumDepth) { | 
| 4278   __ Move(StoreGlobalViaContextDescriptor::SlotRegister(), | 4281     __ Set(StoreGlobalViaContextDescriptor::SlotRegister(), slot); | 
| 4279           Smi::FromInt(instr->slot_index())); | 4282     __ Move(StoreGlobalViaContextDescriptor::NameRegister(), instr->name()); | 
| 4280   __ Move(StoreGlobalViaContextDescriptor::NameRegister(), instr->name()); | 4283     Handle<Code> stub = CodeFactory::StoreGlobalViaContext( | 
| 4281 | 4284                             isolate(), depth, instr->language_mode()) | 
| 4282   Handle<Code> stub = | 4285                             .code(); | 
| 4283       CodeFactory::StoreGlobalViaContext(isolate(), instr->depth(), | 4286     CallCode(stub, RelocInfo::CODE_TARGET, instr); | 
| 4284                                          instr->language_mode()).code(); | 4287   } else { | 
| 4285   CallCode(stub, RelocInfo::CODE_TARGET, instr); | 4288     __ Push(Smi::FromInt(slot)); | 
|  | 4289     __ Push(instr->name()); | 
|  | 4290     __ Push(StoreGlobalViaContextDescriptor::ValueRegister()); | 
|  | 4291     __ CallRuntime(is_strict(instr->language_mode()) | 
|  | 4292                        ? Runtime::kStoreGlobalViaContext_Strict | 
|  | 4293                        : Runtime::kStoreGlobalViaContext_Sloppy, | 
|  | 4294                    3); | 
|  | 4295   } | 
| 4286 } | 4296 } | 
| 4287 | 4297 | 
| 4288 | 4298 | 
| 4289 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4299 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 
| 4290   Representation representation = instr->hydrogen()->length()->representation(); | 4300   Representation representation = instr->hydrogen()->length()->representation(); | 
| 4291   DCHECK(representation.Equals(instr->hydrogen()->index()->representation())); | 4301   DCHECK(representation.Equals(instr->hydrogen()->index()->representation())); | 
| 4292   DCHECK(representation.IsSmiOrInteger32()); | 4302   DCHECK(representation.IsSmiOrInteger32()); | 
| 4293 | 4303 | 
| 4294   Condition cc = instr->hydrogen()->allow_equality() ? below : below_equal; | 4304   Condition cc = instr->hydrogen()->allow_equality() ? below : below_equal; | 
| 4295   if (instr->length()->IsConstantOperand()) { | 4305   if (instr->length()->IsConstantOperand()) { | 
| (...skipping 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 6063   RecordSafepoint(Safepoint::kNoLazyDeopt); | 6073   RecordSafepoint(Safepoint::kNoLazyDeopt); | 
| 6064 } | 6074 } | 
| 6065 | 6075 | 
| 6066 | 6076 | 
| 6067 #undef __ | 6077 #undef __ | 
| 6068 | 6078 | 
| 6069 }  // namespace internal | 6079 }  // namespace internal | 
| 6070 }  // namespace v8 | 6080 }  // namespace v8 | 
| 6071 | 6081 | 
| 6072 #endif  // V8_TARGET_ARCH_X64 | 6082 #endif  // V8_TARGET_ARCH_X64 | 
| OLD | NEW | 
|---|