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