OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 // If there's no appropriate stub we simply avoid updating the caches. | 776 // If there's no appropriate stub we simply avoid updating the caches. |
777 // TODO(verwaest): Install a slow fallback in this case to avoid not learning, | 777 // TODO(verwaest): Install a slow fallback in this case to avoid not learning, |
778 // and deopting Crankshaft code. | 778 // and deopting Crankshaft code. |
779 if (code.is_null()) return; | 779 if (code.is_null()) return; |
780 | 780 |
781 Handle<JSObject> cache_object = object->IsJSObject() | 781 Handle<JSObject> cache_object = object->IsJSObject() |
782 ? Handle<JSObject>::cast(object) | 782 ? Handle<JSObject>::cast(object) |
783 : Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate())), | 783 : Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate())), |
784 isolate()); | 784 isolate()); |
785 | 785 |
786 PatchCache(handle(Type::CurrentOf(cache_object), isolate()), name, code); | 786 PatchCache(handle(Type::OfCurrently(cache_object), isolate()), name, code); |
787 TRACE_IC("CallIC", name); | 787 TRACE_IC("CallIC", name); |
788 } | 788 } |
789 | 789 |
790 | 790 |
791 MaybeObject* KeyedCallIC::LoadFunction(Handle<Object> object, | 791 MaybeObject* KeyedCallIC::LoadFunction(Handle<Object> object, |
792 Handle<Object> key) { | 792 Handle<Object> key) { |
793 if (key->IsInternalizedString()) { | 793 if (key->IsInternalizedString()) { |
794 return CallICBase::LoadFunction(object, Handle<String>::cast(key)); | 794 return CallICBase::LoadFunction(object, Handle<String>::cast(key)); |
795 } | 795 } |
796 | 796 |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 } else if (!lookup->IsProperty()) { | 1141 } else if (!lookup->IsProperty()) { |
1142 if (kind() == Code::LOAD_IC) { | 1142 if (kind() == Code::LOAD_IC) { |
1143 code = isolate()->stub_cache()->ComputeLoadNonexistent(name, object); | 1143 code = isolate()->stub_cache()->ComputeLoadNonexistent(name, object); |
1144 } else { | 1144 } else { |
1145 code = slow_stub(); | 1145 code = slow_stub(); |
1146 } | 1146 } |
1147 } else { | 1147 } else { |
1148 code = ComputeHandler(lookup, object, name); | 1148 code = ComputeHandler(lookup, object, name); |
1149 } | 1149 } |
1150 | 1150 |
1151 PatchCache(handle(Type::CurrentOf(object), isolate()), name, code); | 1151 PatchCache(handle(Type::OfCurrently(object), isolate()), name, code); |
1152 TRACE_IC("LoadIC", name); | 1152 TRACE_IC("LoadIC", name); |
1153 } | 1153 } |
1154 | 1154 |
1155 | 1155 |
1156 void IC::UpdateMegamorphicCache(Type* type, Name* name, Code* code) { | 1156 void IC::UpdateMegamorphicCache(Type* type, Name* name, Code* code) { |
1157 // Cache code holding map should be consistent with | 1157 // Cache code holding map should be consistent with |
1158 // GenerateMonomorphicCacheProbe. | 1158 // GenerateMonomorphicCacheProbe. |
1159 Map* map = *TypeToMap(type, isolate()); | 1159 Map* map = *TypeToMap(type, isolate()); |
1160 isolate()->stub_cache()->Set(name, map, code); | 1160 isolate()->stub_cache()->Set(name, map, code); |
1161 } | 1161 } |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1602 Handle<String> name, | 1602 Handle<String> name, |
1603 Handle<Object> value) { | 1603 Handle<Object> value) { |
1604 ASSERT(!receiver->IsJSGlobalProxy()); | 1604 ASSERT(!receiver->IsJSGlobalProxy()); |
1605 ASSERT(lookup->IsFound()); | 1605 ASSERT(lookup->IsFound()); |
1606 | 1606 |
1607 // These are not cacheable, so we never see such LookupResults here. | 1607 // These are not cacheable, so we never see such LookupResults here. |
1608 ASSERT(!lookup->IsHandler()); | 1608 ASSERT(!lookup->IsHandler()); |
1609 | 1609 |
1610 Handle<Code> code = ComputeHandler(lookup, receiver, name, value); | 1610 Handle<Code> code = ComputeHandler(lookup, receiver, name, value); |
1611 | 1611 |
1612 PatchCache(handle(Type::CurrentOf(receiver), isolate()), name, code); | 1612 PatchCache(handle(Type::OfCurrently(receiver), isolate()), name, code); |
1613 TRACE_IC("StoreIC", name); | 1613 TRACE_IC("StoreIC", name); |
1614 } | 1614 } |
1615 | 1615 |
1616 | 1616 |
1617 Handle<Code> StoreIC::CompileHandler(LookupResult* lookup, | 1617 Handle<Code> StoreIC::CompileHandler(LookupResult* lookup, |
1618 Handle<Object> object, | 1618 Handle<Object> object, |
1619 Handle<String> name, | 1619 Handle<String> name, |
1620 Handle<Object> value, | 1620 Handle<Object> value, |
1621 InlineCacheHolderFlag cache_holder) { | 1621 InlineCacheHolderFlag cache_holder) { |
1622 ASSERT(cache_holder == OWN_MAP); | 1622 ASSERT(cache_holder == OWN_MAP); |
(...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2765 #undef ADDR | 2765 #undef ADDR |
2766 }; | 2766 }; |
2767 | 2767 |
2768 | 2768 |
2769 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2769 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2770 return IC_utilities[id]; | 2770 return IC_utilities[id]; |
2771 } | 2771 } |
2772 | 2772 |
2773 | 2773 |
2774 } } // namespace v8::internal | 2774 } } // namespace v8::internal |
OLD | NEW |