| 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 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
| 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(LoadIC::ReceiverRegister())); | 25 DCHECK(edx.is(LoadConvention::ReceiverRegister())); |
| 26 DCHECK(ecx.is(LoadIC::NameRegister())); | 26 DCHECK(ecx.is(LoadConvention::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 = StoreIC::ReceiverRegister(); | 330 Register receiver = StoreConvention::ReceiverRegister(); |
| 331 Register name = StoreIC::NameRegister(); | 331 Register name = StoreConvention::NameRegister(); |
| 332 Register value = StoreIC::ValueRegister(); | 332 Register value = StoreConvention::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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 // Do tail-call to the runtime system. | 845 // Do tail-call to the runtime system. |
| 846 ExternalReference store_ic_property = ExternalReference( | 846 ExternalReference store_ic_property = ExternalReference( |
| 847 IC_Utility(IC::kStorePropertyWithInterceptor), isolate()); | 847 IC_Utility(IC::kStorePropertyWithInterceptor), isolate()); |
| 848 __ TailCallExternalReference(store_ic_property, 3, 1); | 848 __ TailCallExternalReference(store_ic_property, 3, 1); |
| 849 | 849 |
| 850 // Return the generated code. | 850 // Return the generated code. |
| 851 return GetCode(kind(), Code::FAST, name); | 851 return GetCode(kind(), Code::FAST, name); |
| 852 } | 852 } |
| 853 | 853 |
| 854 | 854 |
| 855 Register NamedStoreHandlerCompiler::value() { return StoreIC::ValueRegister(); } | 855 Register NamedStoreHandlerCompiler::value() { |
| 856 return StoreConvention::ValueRegister(); |
| 857 } |
| 856 | 858 |
| 857 | 859 |
| 858 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( | 860 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( |
| 859 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { | 861 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { |
| 860 Label miss; | 862 Label miss; |
| 861 | 863 |
| 862 FrontendHeader(receiver(), name, &miss); | 864 FrontendHeader(receiver(), name, &miss); |
| 863 // Get the value from the cell. | 865 // Get the value from the cell. |
| 864 Register result = StoreIC::ValueRegister(); | 866 Register result = StoreConvention::ValueRegister(); |
| 865 if (masm()->serializer_enabled()) { | 867 if (masm()->serializer_enabled()) { |
| 866 __ mov(result, Immediate(cell)); | 868 __ mov(result, Immediate(cell)); |
| 867 __ mov(result, FieldOperand(result, PropertyCell::kValueOffset)); | 869 __ mov(result, FieldOperand(result, PropertyCell::kValueOffset)); |
| 868 } else { | 870 } else { |
| 869 __ mov(result, Operand::ForCell(cell)); | 871 __ mov(result, Operand::ForCell(cell)); |
| 870 } | 872 } |
| 871 | 873 |
| 872 // Check for deleted property if property can actually be deleted. | 874 // Check for deleted property if property can actually be deleted. |
| 873 if (is_configurable) { | 875 if (is_configurable) { |
| 874 __ cmp(result, factory()->the_hole_value()); | 876 __ cmp(result, factory()->the_hole_value()); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 888 // Return the generated code. | 890 // Return the generated code. |
| 889 return GetCode(kind(), Code::NORMAL, name); | 891 return GetCode(kind(), Code::NORMAL, name); |
| 890 } | 892 } |
| 891 | 893 |
| 892 | 894 |
| 893 #undef __ | 895 #undef __ |
| 894 } | 896 } |
| 895 } // namespace v8::internal | 897 } // namespace v8::internal |
| 896 | 898 |
| 897 #endif // V8_TARGET_ARCH_IA32 | 899 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |