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 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 Token::Value op; | 547 Token::Value op; |
548 ICCompareStub::DecodeMinorKey(target->stub_info(), NULL, NULL, | 548 ICCompareStub::DecodeMinorKey(target->stub_info(), NULL, NULL, |
549 &handler_state, &op); | 549 &handler_state, &op); |
550 // Only clear CompareICs that can retain objects. | 550 // Only clear CompareICs that can retain objects. |
551 if (handler_state != KNOWN_OBJECT) return; | 551 if (handler_state != KNOWN_OBJECT) return; |
552 SetTargetAtAddress(address, GetRawUninitialized(isolate, op), constant_pool); | 552 SetTargetAtAddress(address, GetRawUninitialized(isolate, op), constant_pool); |
553 PatchInlinedSmiCode(address, DISABLE_INLINED_SMI_CHECK); | 553 PatchInlinedSmiCode(address, DISABLE_INLINED_SMI_CHECK); |
554 } | 554 } |
555 | 555 |
556 | 556 |
557 Handle<Code> KeyedLoadIC::megamorphic_stub() { | |
558 if (FLAG_compiled_keyed_generic_loads) { | |
559 return KeyedLoadGenericElementStub(isolate()).GetCode(); | |
560 } else { | |
561 return isolate()->builtins()->KeyedLoadIC_Generic(); | |
562 } | |
563 } | |
564 | |
565 Handle<Code> KeyedLoadIC::generic_stub() const { | |
566 if (FLAG_compiled_keyed_generic_loads) { | |
567 return KeyedLoadGenericElementStub(isolate()).GetCode(); | |
568 } else { | |
569 return isolate()->builtins()->KeyedLoadIC_Generic(); | |
570 } | |
571 } | |
572 | |
573 | |
574 static bool MigrateDeprecated(Handle<Object> object) { | 557 static bool MigrateDeprecated(Handle<Object> object) { |
575 if (!object->IsJSObject()) return false; | 558 if (!object->IsJSObject()) return false; |
576 Handle<JSObject> receiver = Handle<JSObject>::cast(object); | 559 Handle<JSObject> receiver = Handle<JSObject>::cast(object); |
577 if (!receiver->map()->is_deprecated()) return false; | 560 if (!receiver->map()->is_deprecated()) return false; |
578 JSObject::MigrateInstance(Handle<JSObject>::cast(object)); | 561 JSObject::MigrateInstance(Handle<JSObject>::cast(object)); |
579 return true; | 562 return true; |
580 } | 563 } |
581 | 564 |
582 | 565 |
583 MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<String> name) { | 566 MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<String> name) { |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 } else if (receiver->HasIndexedInterceptor()) { | 1147 } else if (receiver->HasIndexedInterceptor()) { |
1165 stub = indexed_interceptor_stub(); | 1148 stub = indexed_interceptor_stub(); |
1166 } else if (!Object::ToSmi(isolate(), key).is_null() && | 1149 } else if (!Object::ToSmi(isolate(), key).is_null() && |
1167 (!target().is_identical_to(sloppy_arguments_stub()))) { | 1150 (!target().is_identical_to(sloppy_arguments_stub()))) { |
1168 stub = LoadElementStub(receiver); | 1151 stub = LoadElementStub(receiver); |
1169 } | 1152 } |
1170 } | 1153 } |
1171 } | 1154 } |
1172 | 1155 |
1173 if (!is_target_set()) { | 1156 if (!is_target_set()) { |
1174 Code* generic = *generic_stub(); | 1157 if (*stub == *generic_stub()) { |
1175 if (*stub == generic) { | |
1176 TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "set generic"); | 1158 TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "set generic"); |
1177 } | 1159 } |
1178 set_target(*stub); | 1160 set_target(*stub); |
1179 TRACE_IC("LoadIC", key); | 1161 TRACE_IC("LoadIC", key); |
1180 } | 1162 } |
1181 | 1163 |
1182 if (!load_handle.is_null()) return load_handle; | 1164 if (!load_handle.is_null()) return load_handle; |
1183 Handle<Object> result; | 1165 Handle<Object> result; |
1184 ASSIGN_RETURN_ON_EXCEPTION( | 1166 ASSIGN_RETURN_ON_EXCEPTION( |
1185 isolate(), | 1167 isolate(), |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1810 if (store_handle.is_null()) { | 1792 if (store_handle.is_null()) { |
1811 ASSIGN_RETURN_ON_EXCEPTION( | 1793 ASSIGN_RETURN_ON_EXCEPTION( |
1812 isolate(), | 1794 isolate(), |
1813 store_handle, | 1795 store_handle, |
1814 Runtime::SetObjectProperty( | 1796 Runtime::SetObjectProperty( |
1815 isolate(), object, key, value, NONE, strict_mode()), | 1797 isolate(), object, key, value, NONE, strict_mode()), |
1816 Object); | 1798 Object); |
1817 } | 1799 } |
1818 | 1800 |
1819 if (!is_target_set()) { | 1801 if (!is_target_set()) { |
1820 Code* generic = *generic_stub(); | 1802 if (*stub == *generic_stub()) { |
1821 if (*stub == generic) { | |
1822 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "set generic"); | 1803 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "set generic"); |
1823 } | 1804 } |
1824 ASSERT(!stub.is_null()); | 1805 ASSERT(!stub.is_null()); |
1825 set_target(*stub); | 1806 set_target(*stub); |
1826 TRACE_IC("StoreIC", key); | 1807 TRACE_IC("StoreIC", key); |
1827 } | 1808 } |
1828 | 1809 |
1829 return store_handle; | 1810 return store_handle; |
1830 } | 1811 } |
1831 | 1812 |
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3099 #undef ADDR | 3080 #undef ADDR |
3100 }; | 3081 }; |
3101 | 3082 |
3102 | 3083 |
3103 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 3084 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
3104 return IC_utilities[id]; | 3085 return IC_utilities[id]; |
3105 } | 3086 } |
3106 | 3087 |
3107 | 3088 |
3108 } } // namespace v8::internal | 3089 } } // namespace v8::internal |
OLD | NEW |