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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic-inl.h" | 10 #include "src/ic-inl.h" |
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 | 1116 |
1117 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor( | 1117 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor( |
1118 Handle<JSObject> object, Handle<Name> name) { | 1118 Handle<JSObject> object, Handle<Name> name) { |
1119 __ pop(scratch1()); // remove the return address | 1119 __ pop(scratch1()); // remove the return address |
1120 __ push(receiver()); | 1120 __ push(receiver()); |
1121 __ push(this->name()); | 1121 __ push(this->name()); |
1122 __ push(value()); | 1122 __ push(value()); |
1123 __ push(scratch1()); // restore return address | 1123 __ push(scratch1()); // restore return address |
1124 | 1124 |
1125 // Do tail-call to the runtime system. | 1125 // Do tail-call to the runtime system. |
1126 ExternalReference store_ic_property = | 1126 ExternalReference store_ic_property = ExternalReference( |
1127 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty), isolate()); | 1127 IC_Utility(IC::kStorePropertyWithInterceptor), isolate()); |
1128 __ TailCallExternalReference(store_ic_property, 3, 1); | 1128 __ TailCallExternalReference(store_ic_property, 3, 1); |
1129 | 1129 |
1130 // Return the generated code. | 1130 // Return the generated code. |
1131 return GetCode(kind(), Code::FAST, name); | 1131 return GetCode(kind(), Code::FAST, name); |
1132 } | 1132 } |
1133 | 1133 |
1134 | 1134 |
1135 void NamedStoreHandlerCompiler::GenerateStoreArrayLength() { | 1135 void NamedStoreHandlerCompiler::GenerateStoreArrayLength() { |
1136 // Prepare tail call to StoreIC_ArrayLength. | 1136 // Prepare tail call to StoreIC_ArrayLength. |
1137 __ pop(scratch1()); // remove the return address | 1137 __ pop(scratch1()); // remove the return address |
1138 __ push(receiver()); | 1138 __ push(receiver()); |
1139 __ push(value()); | 1139 __ push(value()); |
1140 __ push(scratch1()); // restore return address | 1140 __ push(scratch1()); // restore return address |
1141 | 1141 |
1142 ExternalReference ref = | 1142 ExternalReference ref = |
1143 ExternalReference(IC_Utility(IC::kStoreIC_ArrayLength), | 1143 ExternalReference(IC_Utility(IC::kStoreIC_ArrayLength), |
1144 masm()->isolate()); | 1144 masm()->isolate()); |
1145 __ TailCallExternalReference(ref, 2, 1); | 1145 __ TailCallExternalReference(ref, 2, 1); |
1146 } | 1146 } |
1147 | 1147 |
1148 | 1148 |
1149 Handle<Code> PropertyICCompiler::CompileIndexedStorePolymorphic( | 1149 Handle<Code> PropertyICCompiler::CompileKeyedStorePolymorphic( |
1150 MapHandleList* receiver_maps, CodeHandleList* handler_stubs, | 1150 MapHandleList* receiver_maps, CodeHandleList* handler_stubs, |
1151 MapHandleList* transitioned_maps) { | 1151 MapHandleList* transitioned_maps) { |
1152 Label miss; | 1152 Label miss; |
1153 __ JumpIfSmi(receiver(), &miss, Label::kNear); | 1153 __ JumpIfSmi(receiver(), &miss, Label::kNear); |
1154 __ mov(scratch1(), FieldOperand(receiver(), HeapObject::kMapOffset)); | 1154 __ mov(scratch1(), FieldOperand(receiver(), HeapObject::kMapOffset)); |
1155 for (int i = 0; i < receiver_maps->length(); ++i) { | 1155 for (int i = 0; i < receiver_maps->length(); ++i) { |
1156 __ cmp(scratch1(), receiver_maps->at(i)); | 1156 __ cmp(scratch1(), receiver_maps->at(i)); |
1157 if (transitioned_maps->at(i).is_null()) { | 1157 if (transitioned_maps->at(i).is_null()) { |
1158 __ j(equal, handler_stubs->at(i)); | 1158 __ j(equal, handler_stubs->at(i)); |
1159 } else { | 1159 } else { |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1337 InlineCacheState state = | 1337 InlineCacheState state = |
1338 number_of_handled_maps > 1 ? POLYMORPHIC : MONOMORPHIC; | 1338 number_of_handled_maps > 1 ? POLYMORPHIC : MONOMORPHIC; |
1339 return GetCode(kind(), type, name, state); | 1339 return GetCode(kind(), type, name, state); |
1340 } | 1340 } |
1341 | 1341 |
1342 | 1342 |
1343 #undef __ | 1343 #undef __ |
1344 #define __ ACCESS_MASM(masm) | 1344 #define __ ACCESS_MASM(masm) |
1345 | 1345 |
1346 | 1346 |
1347 void IndexedHandlerCompiler::GenerateLoadDictionaryElement( | 1347 void ElementHandlerCompiler::GenerateLoadDictionaryElement( |
1348 MacroAssembler* masm) { | 1348 MacroAssembler* masm) { |
1349 // ----------- S t a t e ------------- | 1349 // ----------- S t a t e ------------- |
1350 // -- ecx : key | 1350 // -- ecx : key |
1351 // -- edx : receiver | 1351 // -- edx : receiver |
1352 // -- esp[0] : return address | 1352 // -- esp[0] : return address |
1353 // ----------------------------------- | 1353 // ----------------------------------- |
1354 ASSERT(edx.is(LoadIC::ReceiverRegister())); | 1354 ASSERT(edx.is(LoadIC::ReceiverRegister())); |
1355 ASSERT(ecx.is(LoadIC::NameRegister())); | 1355 ASSERT(ecx.is(LoadIC::NameRegister())); |
1356 Label slow, miss; | 1356 Label slow, miss; |
1357 | 1357 |
(...skipping 30 matching lines...) Expand all Loading... |
1388 // ----------------------------------- | 1388 // ----------------------------------- |
1389 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1389 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1390 } | 1390 } |
1391 | 1391 |
1392 | 1392 |
1393 #undef __ | 1393 #undef __ |
1394 | 1394 |
1395 } } // namespace v8::internal | 1395 } } // namespace v8::internal |
1396 | 1396 |
1397 #endif // V8_TARGET_ARCH_IA32 | 1397 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |