OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2896 | 2896 |
2897 | 2897 |
2898 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) { | 2898 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) { |
2899 DCHECK(ToRegister(instr->context()).is(cp)); | 2899 DCHECK(ToRegister(instr->context()).is(cp)); |
2900 DCHECK(ToRegister(instr->result()).is(v0)); | 2900 DCHECK(ToRegister(instr->result()).is(v0)); |
2901 | 2901 |
2902 int const slot = instr->slot_index(); | 2902 int const slot = instr->slot_index(); |
2903 int const depth = instr->depth(); | 2903 int const depth = instr->depth(); |
2904 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) { | 2904 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) { |
2905 __ li(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); | 2905 __ li(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); |
2906 __ li(LoadGlobalViaContextDescriptor::NameRegister(), | |
2907 Operand(instr->name())); | |
2908 Handle<Code> stub = | 2906 Handle<Code> stub = |
2909 CodeFactory::LoadGlobalViaContext(isolate(), depth).code(); | 2907 CodeFactory::LoadGlobalViaContext(isolate(), depth).code(); |
2910 CallCode(stub, RelocInfo::CODE_TARGET, instr); | 2908 CallCode(stub, RelocInfo::CODE_TARGET, instr); |
2911 } else { | 2909 } else { |
2912 __ Push(Smi::FromInt(slot)); | 2910 __ Push(Smi::FromInt(slot)); |
2913 __ Push(instr->name()); | 2911 __ CallRuntime(Runtime::kLoadGlobalViaContext, 1); |
2914 __ CallRuntime(Runtime::kLoadGlobalViaContext, 2); | |
2915 } | 2912 } |
2916 } | 2913 } |
2917 | 2914 |
2918 | 2915 |
2919 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2916 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2920 Register context = ToRegister(instr->context()); | 2917 Register context = ToRegister(instr->context()); |
2921 Register result = ToRegister(instr->result()); | 2918 Register result = ToRegister(instr->result()); |
2922 | 2919 |
2923 __ lw(result, ContextOperand(context, instr->slot_index())); | 2920 __ lw(result, ContextOperand(context, instr->slot_index())); |
2924 if (instr->hydrogen()->RequiresHoleCheck()) { | 2921 if (instr->hydrogen()->RequiresHoleCheck()) { |
(...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4211 | 4208 |
4212 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) { | 4209 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) { |
4213 DCHECK(ToRegister(instr->context()).is(cp)); | 4210 DCHECK(ToRegister(instr->context()).is(cp)); |
4214 DCHECK(ToRegister(instr->value()) | 4211 DCHECK(ToRegister(instr->value()) |
4215 .is(StoreGlobalViaContextDescriptor::ValueRegister())); | 4212 .is(StoreGlobalViaContextDescriptor::ValueRegister())); |
4216 | 4213 |
4217 int const slot = instr->slot_index(); | 4214 int const slot = instr->slot_index(); |
4218 int const depth = instr->depth(); | 4215 int const depth = instr->depth(); |
4219 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) { | 4216 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) { |
4220 __ li(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); | 4217 __ li(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); |
4221 __ li(StoreGlobalViaContextDescriptor::NameRegister(), | |
4222 Operand(instr->name())); | |
4223 Handle<Code> stub = CodeFactory::StoreGlobalViaContext( | 4218 Handle<Code> stub = CodeFactory::StoreGlobalViaContext( |
4224 isolate(), depth, instr->language_mode()) | 4219 isolate(), depth, instr->language_mode()) |
4225 .code(); | 4220 .code(); |
4226 CallCode(stub, RelocInfo::CODE_TARGET, instr); | 4221 CallCode(stub, RelocInfo::CODE_TARGET, instr); |
4227 } else { | 4222 } else { |
4228 __ Push(Smi::FromInt(slot)); | 4223 __ Push(Smi::FromInt(slot)); |
4229 __ Push(instr->name()); | |
4230 __ Push(StoreGlobalViaContextDescriptor::ValueRegister()); | 4224 __ Push(StoreGlobalViaContextDescriptor::ValueRegister()); |
4231 __ CallRuntime(is_strict(language_mode()) | 4225 __ CallRuntime(is_strict(language_mode()) |
4232 ? Runtime::kStoreGlobalViaContext_Strict | 4226 ? Runtime::kStoreGlobalViaContext_Strict |
4233 : Runtime::kStoreGlobalViaContext_Sloppy, | 4227 : Runtime::kStoreGlobalViaContext_Sloppy, |
4234 3); | 4228 2); |
4235 } | 4229 } |
4236 } | 4230 } |
4237 | 4231 |
4238 | 4232 |
4239 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4233 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4240 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; | 4234 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; |
4241 Operand operand(0); | 4235 Operand operand(0); |
4242 Register reg; | 4236 Register reg; |
4243 if (instr->index()->IsConstantOperand()) { | 4237 if (instr->index()->IsConstantOperand()) { |
4244 operand = ToOperand(instr->index()); | 4238 operand = ToOperand(instr->index()); |
(...skipping 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6092 __ Push(at, ToRegister(instr->function())); | 6086 __ Push(at, ToRegister(instr->function())); |
6093 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6087 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6094 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6088 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6095 } | 6089 } |
6096 | 6090 |
6097 | 6091 |
6098 #undef __ | 6092 #undef __ |
6099 | 6093 |
6100 } // namespace internal | 6094 } // namespace internal |
6101 } // namespace v8 | 6095 } // namespace v8 |
OLD | NEW |