| 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 |
| 557 static bool MigrateDeprecated(Handle<Object> object) { | 574 static bool MigrateDeprecated(Handle<Object> object) { |
| 558 if (!object->IsJSObject()) return false; | 575 if (!object->IsJSObject()) return false; |
| 559 Handle<JSObject> receiver = Handle<JSObject>::cast(object); | 576 Handle<JSObject> receiver = Handle<JSObject>::cast(object); |
| 560 if (!receiver->map()->is_deprecated()) return false; | 577 if (!receiver->map()->is_deprecated()) return false; |
| 561 JSObject::MigrateInstance(Handle<JSObject>::cast(object)); | 578 JSObject::MigrateInstance(Handle<JSObject>::cast(object)); |
| 562 return true; | 579 return true; |
| 563 } | 580 } |
| 564 | 581 |
| 565 | 582 |
| 566 MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<String> name) { | 583 MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<String> name) { |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 } else if (receiver->HasIndexedInterceptor()) { | 1164 } else if (receiver->HasIndexedInterceptor()) { |
| 1148 stub = indexed_interceptor_stub(); | 1165 stub = indexed_interceptor_stub(); |
| 1149 } else if (!Object::ToSmi(isolate(), key).is_null() && | 1166 } else if (!Object::ToSmi(isolate(), key).is_null() && |
| 1150 (!target().is_identical_to(sloppy_arguments_stub()))) { | 1167 (!target().is_identical_to(sloppy_arguments_stub()))) { |
| 1151 stub = LoadElementStub(receiver); | 1168 stub = LoadElementStub(receiver); |
| 1152 } | 1169 } |
| 1153 } | 1170 } |
| 1154 } | 1171 } |
| 1155 | 1172 |
| 1156 if (!is_target_set()) { | 1173 if (!is_target_set()) { |
| 1157 if (*stub == *generic_stub()) { | 1174 Code* generic = *generic_stub(); |
| 1175 if (*stub == generic) { |
| 1158 TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "set generic"); | 1176 TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "set generic"); |
| 1159 } | 1177 } |
| 1160 set_target(*stub); | 1178 set_target(*stub); |
| 1161 TRACE_IC("LoadIC", key); | 1179 TRACE_IC("LoadIC", key); |
| 1162 } | 1180 } |
| 1163 | 1181 |
| 1164 if (!load_handle.is_null()) return load_handle; | 1182 if (!load_handle.is_null()) return load_handle; |
| 1165 Handle<Object> result; | 1183 Handle<Object> result; |
| 1166 ASSIGN_RETURN_ON_EXCEPTION( | 1184 ASSIGN_RETURN_ON_EXCEPTION( |
| 1167 isolate(), | 1185 isolate(), |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1792 if (store_handle.is_null()) { | 1810 if (store_handle.is_null()) { |
| 1793 ASSIGN_RETURN_ON_EXCEPTION( | 1811 ASSIGN_RETURN_ON_EXCEPTION( |
| 1794 isolate(), | 1812 isolate(), |
| 1795 store_handle, | 1813 store_handle, |
| 1796 Runtime::SetObjectProperty( | 1814 Runtime::SetObjectProperty( |
| 1797 isolate(), object, key, value, NONE, strict_mode()), | 1815 isolate(), object, key, value, NONE, strict_mode()), |
| 1798 Object); | 1816 Object); |
| 1799 } | 1817 } |
| 1800 | 1818 |
| 1801 if (!is_target_set()) { | 1819 if (!is_target_set()) { |
| 1802 if (*stub == *generic_stub()) { | 1820 Code* generic = *generic_stub(); |
| 1821 if (*stub == generic) { |
| 1803 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "set generic"); | 1822 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "set generic"); |
| 1804 } | 1823 } |
| 1805 ASSERT(!stub.is_null()); | 1824 ASSERT(!stub.is_null()); |
| 1806 set_target(*stub); | 1825 set_target(*stub); |
| 1807 TRACE_IC("StoreIC", key); | 1826 TRACE_IC("StoreIC", key); |
| 1808 } | 1827 } |
| 1809 | 1828 |
| 1810 return store_handle; | 1829 return store_handle; |
| 1811 } | 1830 } |
| 1812 | 1831 |
| (...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3080 #undef ADDR | 3099 #undef ADDR |
| 3081 }; | 3100 }; |
| 3082 | 3101 |
| 3083 | 3102 |
| 3084 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 3103 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
| 3085 return IC_utilities[id]; | 3104 return IC_utilities[id]; |
| 3086 } | 3105 } |
| 3087 | 3106 |
| 3088 | 3107 |
| 3089 } } // namespace v8::internal | 3108 } } // namespace v8::internal |
| OLD | NEW |