| 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_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 8 | 8 |
| 9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 | 1039 |
| 1040 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor( | 1040 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor( |
| 1041 Handle<JSObject> object, Handle<Name> name) { | 1041 Handle<JSObject> object, Handle<Name> name) { |
| 1042 __ PopReturnAddressTo(scratch1()); | 1042 __ PopReturnAddressTo(scratch1()); |
| 1043 __ Push(receiver()); | 1043 __ Push(receiver()); |
| 1044 __ Push(this->name()); | 1044 __ Push(this->name()); |
| 1045 __ Push(value()); | 1045 __ Push(value()); |
| 1046 __ PushReturnAddressFrom(scratch1()); | 1046 __ PushReturnAddressFrom(scratch1()); |
| 1047 | 1047 |
| 1048 // Do tail-call to the runtime system. | 1048 // Do tail-call to the runtime system. |
| 1049 ExternalReference store_ic_property = | 1049 ExternalReference store_ic_property = ExternalReference( |
| 1050 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty), isolate()); | 1050 IC_Utility(IC::kStorePropertyWithInterceptor), isolate()); |
| 1051 __ TailCallExternalReference(store_ic_property, 3, 1); | 1051 __ TailCallExternalReference(store_ic_property, 3, 1); |
| 1052 | 1052 |
| 1053 // Return the generated code. | 1053 // Return the generated code. |
| 1054 return GetCode(kind(), Code::FAST, name); | 1054 return GetCode(kind(), Code::FAST, name); |
| 1055 } | 1055 } |
| 1056 | 1056 |
| 1057 | 1057 |
| 1058 void NamedStoreHandlerCompiler::GenerateStoreArrayLength() { | 1058 void NamedStoreHandlerCompiler::GenerateStoreArrayLength() { |
| 1059 // Prepare tail call to StoreIC_ArrayLength. | 1059 // Prepare tail call to StoreIC_ArrayLength. |
| 1060 __ PopReturnAddressTo(scratch1()); | 1060 __ PopReturnAddressTo(scratch1()); |
| 1061 __ Push(receiver()); | 1061 __ Push(receiver()); |
| 1062 __ Push(value()); | 1062 __ Push(value()); |
| 1063 __ PushReturnAddressFrom(scratch1()); | 1063 __ PushReturnAddressFrom(scratch1()); |
| 1064 | 1064 |
| 1065 ExternalReference ref = | 1065 ExternalReference ref = |
| 1066 ExternalReference(IC_Utility(IC::kStoreIC_ArrayLength), | 1066 ExternalReference(IC_Utility(IC::kStoreIC_ArrayLength), |
| 1067 masm()->isolate()); | 1067 masm()->isolate()); |
| 1068 __ TailCallExternalReference(ref, 2, 1); | 1068 __ TailCallExternalReference(ref, 2, 1); |
| 1069 } | 1069 } |
| 1070 | 1070 |
| 1071 | 1071 |
| 1072 Handle<Code> PropertyICCompiler::CompileIndexedStorePolymorphic( | 1072 Handle<Code> PropertyICCompiler::CompileKeyedStorePolymorphic( |
| 1073 MapHandleList* receiver_maps, CodeHandleList* handler_stubs, | 1073 MapHandleList* receiver_maps, CodeHandleList* handler_stubs, |
| 1074 MapHandleList* transitioned_maps) { | 1074 MapHandleList* transitioned_maps) { |
| 1075 Label miss; | 1075 Label miss; |
| 1076 __ JumpIfSmi(receiver(), &miss, Label::kNear); | 1076 __ JumpIfSmi(receiver(), &miss, Label::kNear); |
| 1077 | 1077 |
| 1078 __ movp(scratch1(), FieldOperand(receiver(), HeapObject::kMapOffset)); | 1078 __ movp(scratch1(), FieldOperand(receiver(), HeapObject::kMapOffset)); |
| 1079 int receiver_count = receiver_maps->length(); | 1079 int receiver_count = receiver_maps->length(); |
| 1080 for (int i = 0; i < receiver_count; ++i) { | 1080 for (int i = 0; i < receiver_count; ++i) { |
| 1081 // Check map and tail call if there's a match | 1081 // Check map and tail call if there's a match |
| 1082 __ Cmp(scratch1(), receiver_maps->at(i)); | 1082 __ Cmp(scratch1(), receiver_maps->at(i)); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1272 InlineCacheState state = | 1272 InlineCacheState state = |
| 1273 number_of_handled_maps > 1 ? POLYMORPHIC : MONOMORPHIC; | 1273 number_of_handled_maps > 1 ? POLYMORPHIC : MONOMORPHIC; |
| 1274 return GetCode(kind(), type, name, state); | 1274 return GetCode(kind(), type, name, state); |
| 1275 } | 1275 } |
| 1276 | 1276 |
| 1277 | 1277 |
| 1278 #undef __ | 1278 #undef __ |
| 1279 #define __ ACCESS_MASM(masm) | 1279 #define __ ACCESS_MASM(masm) |
| 1280 | 1280 |
| 1281 | 1281 |
| 1282 void IndexedHandlerCompiler::GenerateLoadDictionaryElement( | 1282 void ElementHandlerCompiler::GenerateLoadDictionaryElement( |
| 1283 MacroAssembler* masm) { | 1283 MacroAssembler* masm) { |
| 1284 // ----------- S t a t e ------------- | 1284 // ----------- S t a t e ------------- |
| 1285 // -- rcx : key | 1285 // -- rcx : key |
| 1286 // -- rdx : receiver | 1286 // -- rdx : receiver |
| 1287 // -- rsp[0] : return address | 1287 // -- rsp[0] : return address |
| 1288 // ----------------------------------- | 1288 // ----------------------------------- |
| 1289 ASSERT(rdx.is(LoadIC::ReceiverRegister())); | 1289 ASSERT(rdx.is(LoadIC::ReceiverRegister())); |
| 1290 ASSERT(rcx.is(LoadIC::NameRegister())); | 1290 ASSERT(rcx.is(LoadIC::NameRegister())); |
| 1291 Label slow, miss; | 1291 Label slow, miss; |
| 1292 | 1292 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1321 // ----------------------------------- | 1321 // ----------------------------------- |
| 1322 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1322 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
| 1323 } | 1323 } |
| 1324 | 1324 |
| 1325 | 1325 |
| 1326 #undef __ | 1326 #undef __ |
| 1327 | 1327 |
| 1328 } } // namespace v8::internal | 1328 } } // namespace v8::internal |
| 1329 | 1329 |
| 1330 #endif // V8_TARGET_ARCH_X64 | 1330 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |