OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ic/handler-compiler.h" | 5 #include "src/ic/handler-compiler.h" |
6 | 6 |
7 #include "src/field-type.h" | 7 #include "src/field-type.h" |
8 #include "src/ic/call-optimization.h" | 8 #include "src/ic/call-optimization.h" |
9 #include "src/ic/handler-configuration-inl.h" | 9 #include "src/ic/handler-configuration-inl.h" |
10 #include "src/ic/ic-inl.h" | 10 #include "src/ic/ic-inl.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 if (!current_map->has_hidden_prototype()) break; | 58 if (!current_map->has_hidden_prototype()) break; |
59 } | 59 } |
60 | 60 |
61 last = handle(JSObject::cast(current_map->prototype())); | 61 last = handle(JSObject::cast(current_map->prototype())); |
62 current_map = handle(last->map()); | 62 current_map = handle(last->map()); |
63 } | 63 } |
64 // Compile the stub that is either shared for all names or | 64 // Compile the stub that is either shared for all names or |
65 // name specific if there are global objects involved. | 65 // name specific if there are global objects involved. |
66 Handle<Code> handler = PropertyHandlerCompiler::Find( | 66 Handle<Code> handler = PropertyHandlerCompiler::Find( |
67 cache_name, stub_holder_map, Code::LOAD_IC, flag); | 67 cache_name, stub_holder_map, Code::LOAD_IC, flag); |
68 if (!handler.is_null()) return handler; | 68 if (!handler.is_null()) { |
| 69 TRACE_HANDLER_STATS(isolate, LoadIC_HandlerCacheHit_NonExistent); |
| 70 return handler; |
| 71 } |
69 | 72 |
70 TRACE_HANDLER_STATS(isolate, LoadIC_LoadNonexistent); | 73 TRACE_HANDLER_STATS(isolate, LoadIC_LoadNonexistent); |
71 NamedLoadHandlerCompiler compiler(isolate, receiver_map, last, flag); | 74 NamedLoadHandlerCompiler compiler(isolate, receiver_map, last, flag); |
72 handler = compiler.CompileLoadNonexistent(cache_name); | 75 handler = compiler.CompileLoadNonexistent(cache_name); |
73 Map::UpdateCodeCache(stub_holder_map, cache_name, handler); | 76 Map::UpdateCodeCache(stub_holder_map, cache_name, handler); |
74 return handler; | 77 return handler; |
75 } | 78 } |
76 | 79 |
77 | 80 |
78 Handle<Code> PropertyHandlerCompiler::GetCode(Code::Kind kind, | 81 Handle<Code> PropertyHandlerCompiler::GetCode(Code::Kind kind, |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 } | 647 } |
645 | 648 |
646 void ElementHandlerCompiler::CompileElementHandlers( | 649 void ElementHandlerCompiler::CompileElementHandlers( |
647 MapHandleList* receiver_maps, List<Handle<Object>>* handlers) { | 650 MapHandleList* receiver_maps, List<Handle<Object>>* handlers) { |
648 for (int i = 0; i < receiver_maps->length(); ++i) { | 651 for (int i = 0; i < receiver_maps->length(); ++i) { |
649 handlers->Add(GetKeyedLoadHandler(receiver_maps->at(i), isolate())); | 652 handlers->Add(GetKeyedLoadHandler(receiver_maps->at(i), isolate())); |
650 } | 653 } |
651 } | 654 } |
652 } // namespace internal | 655 } // namespace internal |
653 } // namespace v8 | 656 } // namespace v8 |
OLD | NEW |