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 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
8 | 8 |
| 9 #include "src/ic/call-optimization.h" |
9 #include "src/ic/ic-compiler.h" | 10 #include "src/ic/ic-compiler.h" |
10 | 11 |
11 namespace v8 { | 12 namespace v8 { |
12 namespace internal { | 13 namespace internal { |
13 | 14 |
14 #define __ ACCESS_MASM(masm) | 15 #define __ ACCESS_MASM(masm) |
15 | 16 |
16 void PropertyHandlerCompiler::GenerateDictionaryNegativeLookup( | 17 void PropertyHandlerCompiler::GenerateDictionaryNegativeLookup( |
17 MacroAssembler* masm, Label* miss_label, Register receiver, | 18 MacroAssembler* masm, Label* miss_label, Register receiver, |
18 Handle<Name> name, Register scratch0, Register scratch1) { | 19 Handle<Name> name, Register scratch0, Register scratch1) { |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 __ mov(scratch, Immediate(cell)); | 200 __ mov(scratch, Immediate(cell)); |
200 __ cmp(FieldOperand(scratch, PropertyCell::kValueOffset), | 201 __ cmp(FieldOperand(scratch, PropertyCell::kValueOffset), |
201 Immediate(the_hole)); | 202 Immediate(the_hole)); |
202 } else { | 203 } else { |
203 __ cmp(Operand::ForCell(cell), Immediate(the_hole)); | 204 __ cmp(Operand::ForCell(cell), Immediate(the_hole)); |
204 } | 205 } |
205 __ j(not_equal, miss); | 206 __ j(not_equal, miss); |
206 } | 207 } |
207 | 208 |
208 | 209 |
209 void PropertyAccessCompiler::GenerateTailCall(MacroAssembler* masm, | |
210 Handle<Code> code) { | |
211 __ jmp(code, RelocInfo::CODE_TARGET); | |
212 } | |
213 | |
214 | |
215 #undef __ | 210 #undef __ |
216 #define __ ACCESS_MASM(masm()) | 211 #define __ ACCESS_MASM(masm()) |
217 | 212 |
218 | 213 |
219 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, | 214 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, |
220 Handle<Name> name) { | 215 Handle<Name> name) { |
221 if (!label->is_unused()) { | 216 if (!label->is_unused()) { |
222 __ bind(label); | 217 __ bind(label); |
223 __ mov(this->name(), Immediate(name)); | 218 __ mov(this->name(), Immediate(name)); |
224 } | 219 } |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 } | 768 } |
774 } | 769 } |
775 __ bind(&miss); | 770 __ bind(&miss); |
776 TailCallBuiltin(masm(), MissBuiltin(kind())); | 771 TailCallBuiltin(masm(), MissBuiltin(kind())); |
777 | 772 |
778 // Return the generated code. | 773 // Return the generated code. |
779 return GetCode(kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); | 774 return GetCode(kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); |
780 } | 775 } |
781 | 776 |
782 | 777 |
783 Register* PropertyAccessCompiler::load_calling_convention() { | |
784 // receiver, name, scratch1, scratch2, scratch3, scratch4. | |
785 Register receiver = LoadIC::ReceiverRegister(); | |
786 Register name = LoadIC::NameRegister(); | |
787 static Register registers[] = {receiver, name, ebx, eax, edi, no_reg}; | |
788 return registers; | |
789 } | |
790 | |
791 | |
792 Register* PropertyAccessCompiler::store_calling_convention() { | |
793 // receiver, name, scratch1, scratch2, scratch3. | |
794 Register receiver = StoreIC::ReceiverRegister(); | |
795 Register name = StoreIC::NameRegister(); | |
796 DCHECK(ebx.is(KeyedStoreIC::MapRegister())); | |
797 static Register registers[] = {receiver, name, ebx, edi, no_reg}; | |
798 return registers; | |
799 } | |
800 | |
801 | |
802 Register NamedStoreHandlerCompiler::value() { return StoreIC::ValueRegister(); } | 778 Register NamedStoreHandlerCompiler::value() { return StoreIC::ValueRegister(); } |
803 | 779 |
804 | 780 |
805 #undef __ | 781 #undef __ |
806 #define __ ACCESS_MASM(masm) | 782 #define __ ACCESS_MASM(masm) |
807 | 783 |
808 | 784 |
809 void NamedLoadHandlerCompiler::GenerateLoadViaGetter( | 785 void NamedLoadHandlerCompiler::GenerateLoadViaGetter( |
810 MacroAssembler* masm, Handle<HeapType> type, Register receiver, | 786 MacroAssembler* masm, Handle<HeapType> type, Register receiver, |
811 Handle<JSFunction> getter) { | 787 Handle<JSFunction> getter) { |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 // Do tail-call to runtime routine. | 972 // Do tail-call to runtime routine. |
997 __ TailCallRuntime(Runtime::kSetProperty, 4, 1); | 973 __ TailCallRuntime(Runtime::kSetProperty, 4, 1); |
998 } | 974 } |
999 | 975 |
1000 | 976 |
1001 #undef __ | 977 #undef __ |
1002 } | 978 } |
1003 } // namespace v8::internal | 979 } // namespace v8::internal |
1004 | 980 |
1005 #endif // V8_TARGET_ARCH_X87 | 981 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |