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/call-optimization.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
11 | 11 |
12 namespace v8 { | 12 namespace v8 { |
13 namespace internal { | 13 namespace internal { |
14 | 14 |
15 #define __ ACCESS_MASM(masm) | 15 #define __ ACCESS_MASM(masm) |
16 | 16 |
17 | 17 |
18 void ElementHandlerCompiler::GenerateLoadDictionaryElement( | 18 void ElementHandlerCompiler::GenerateLoadDictionaryElement( |
19 MacroAssembler* masm) { | 19 MacroAssembler* masm) { |
20 // ----------- S t a t e ------------- | 20 // ----------- S t a t e ------------- |
21 // -- ecx : key | 21 // -- ecx : key |
22 // -- edx : receiver | 22 // -- edx : receiver |
23 // -- esp[0] : return address | 23 // -- esp[0] : return address |
24 // ----------------------------------- | 24 // ----------------------------------- |
25 DCHECK(edx.is(LoadConvention::ReceiverRegister())); | 25 DCHECK(edx.is(LoadDescriptor::ReceiverRegister())); |
26 DCHECK(ecx.is(LoadConvention::NameRegister())); | 26 DCHECK(ecx.is(LoadDescriptor::NameRegister())); |
27 Label slow, miss; | 27 Label slow, miss; |
28 | 28 |
29 // This stub is meant to be tail-jumped to, the receiver must already | 29 // This stub is meant to be tail-jumped to, the receiver must already |
30 // have been verified by the caller to not be a smi. | 30 // have been verified by the caller to not be a smi. |
31 __ JumpIfNotSmi(ecx, &miss); | 31 __ JumpIfNotSmi(ecx, &miss); |
32 __ mov(ebx, ecx); | 32 __ mov(ebx, ecx); |
33 __ SmiUntag(ebx); | 33 __ SmiUntag(ebx); |
34 __ mov(eax, FieldOperand(edx, JSObject::kElementsOffset)); | 34 __ mov(eax, FieldOperand(edx, JSObject::kElementsOffset)); |
35 | 35 |
36 // Push receiver on the stack to free up a register for the dictionary | 36 // Push receiver on the stack to free up a register for the dictionary |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 static void CompileCallLoadPropertyWithInterceptor( | 320 static void CompileCallLoadPropertyWithInterceptor( |
321 MacroAssembler* masm, Register receiver, Register holder, Register name, | 321 MacroAssembler* masm, Register receiver, Register holder, Register name, |
322 Handle<JSObject> holder_obj, IC::UtilityId id) { | 322 Handle<JSObject> holder_obj, IC::UtilityId id) { |
323 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | 323 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); |
324 __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()), | 324 __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()), |
325 NamedLoadHandlerCompiler::kInterceptorArgsLength); | 325 NamedLoadHandlerCompiler::kInterceptorArgsLength); |
326 } | 326 } |
327 | 327 |
328 | 328 |
329 static void StoreIC_PushArgs(MacroAssembler* masm) { | 329 static void StoreIC_PushArgs(MacroAssembler* masm) { |
330 Register receiver = StoreConvention::ReceiverRegister(); | 330 Register receiver = StoreDescriptor::ReceiverRegister(); |
331 Register name = StoreConvention::NameRegister(); | 331 Register name = StoreDescriptor::NameRegister(); |
332 Register value = StoreConvention::ValueRegister(); | 332 Register value = StoreDescriptor::ValueRegister(); |
333 | 333 |
334 DCHECK(!ebx.is(receiver) && !ebx.is(name) && !ebx.is(value)); | 334 DCHECK(!ebx.is(receiver) && !ebx.is(name) && !ebx.is(value)); |
335 | 335 |
336 __ pop(ebx); | 336 __ pop(ebx); |
337 __ push(receiver); | 337 __ push(receiver); |
338 __ push(name); | 338 __ push(name); |
339 __ push(value); | 339 __ push(value); |
340 __ push(ebx); | 340 __ push(ebx); |
341 } | 341 } |
342 | 342 |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 ExternalReference store_ic_property = ExternalReference( | 847 ExternalReference store_ic_property = ExternalReference( |
848 IC_Utility(IC::kStorePropertyWithInterceptor), isolate()); | 848 IC_Utility(IC::kStorePropertyWithInterceptor), isolate()); |
849 __ TailCallExternalReference(store_ic_property, 3, 1); | 849 __ TailCallExternalReference(store_ic_property, 3, 1); |
850 | 850 |
851 // Return the generated code. | 851 // Return the generated code. |
852 return GetCode(kind(), Code::FAST, name); | 852 return GetCode(kind(), Code::FAST, name); |
853 } | 853 } |
854 | 854 |
855 | 855 |
856 Register NamedStoreHandlerCompiler::value() { | 856 Register NamedStoreHandlerCompiler::value() { |
857 return StoreConvention::ValueRegister(); | 857 return StoreDescriptor::ValueRegister(); |
858 } | 858 } |
859 | 859 |
860 | 860 |
861 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( | 861 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( |
862 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { | 862 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { |
863 Label miss; | 863 Label miss; |
864 | 864 |
865 FrontendHeader(receiver(), name, &miss); | 865 FrontendHeader(receiver(), name, &miss); |
866 // Get the value from the cell. | 866 // Get the value from the cell. |
867 Register result = StoreConvention::ValueRegister(); | 867 Register result = StoreDescriptor::ValueRegister(); |
868 if (masm()->serializer_enabled()) { | 868 if (masm()->serializer_enabled()) { |
869 __ mov(result, Immediate(cell)); | 869 __ mov(result, Immediate(cell)); |
870 __ mov(result, FieldOperand(result, PropertyCell::kValueOffset)); | 870 __ mov(result, FieldOperand(result, PropertyCell::kValueOffset)); |
871 } else { | 871 } else { |
872 __ mov(result, Operand::ForCell(cell)); | 872 __ mov(result, Operand::ForCell(cell)); |
873 } | 873 } |
874 | 874 |
875 // Check for deleted property if property can actually be deleted. | 875 // Check for deleted property if property can actually be deleted. |
876 if (is_configurable) { | 876 if (is_configurable) { |
877 __ cmp(result, factory()->the_hole_value()); | 877 __ cmp(result, factory()->the_hole_value()); |
(...skipping 13 matching lines...) Expand all Loading... |
891 // Return the generated code. | 891 // Return the generated code. |
892 return GetCode(kind(), Code::NORMAL, name); | 892 return GetCode(kind(), Code::NORMAL, name); |
893 } | 893 } |
894 | 894 |
895 | 895 |
896 #undef __ | 896 #undef __ |
897 } | 897 } |
898 } // namespace v8::internal | 898 } // namespace v8::internal |
899 | 899 |
900 #endif // V8_TARGET_ARCH_X87 | 900 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |