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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 Handle<Object> ElementHandlerCompiler::GetKeyedLoadHandler( | 345 Handle<Object> ElementHandlerCompiler::GetKeyedLoadHandler( |
346 Handle<Map> receiver_map, Isolate* isolate) { | 346 Handle<Map> receiver_map, Isolate* isolate) { |
347 if (receiver_map->has_indexed_interceptor() && | 347 if (receiver_map->has_indexed_interceptor() && |
348 !receiver_map->GetIndexedInterceptor()->getter()->IsUndefined(isolate) && | 348 !receiver_map->GetIndexedInterceptor()->getter()->IsUndefined(isolate) && |
349 !receiver_map->GetIndexedInterceptor()->non_masking()) { | 349 !receiver_map->GetIndexedInterceptor()->non_masking()) { |
350 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_LoadIndexedInterceptorStub); | 350 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_LoadIndexedInterceptorStub); |
351 return LoadIndexedInterceptorStub(isolate).GetCode(); | 351 return LoadIndexedInterceptorStub(isolate).GetCode(); |
352 } | 352 } |
353 if (receiver_map->IsStringMap()) { | 353 if (receiver_map->IsStringMap()) { |
354 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_LoadIndexedStringStub); | 354 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_LoadIndexedStringStub); |
355 return LoadIndexedStringStub(isolate).GetCode(); | 355 return isolate->builtins()->KeyedLoadIC_IndexedString(); |
356 } | 356 } |
357 InstanceType instance_type = receiver_map->instance_type(); | 357 InstanceType instance_type = receiver_map->instance_type(); |
358 if (instance_type < FIRST_JS_RECEIVER_TYPE) { | 358 if (instance_type < FIRST_JS_RECEIVER_TYPE) { |
359 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_SlowStub); | 359 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_SlowStub); |
360 return isolate->builtins()->KeyedLoadIC_Slow(); | 360 return isolate->builtins()->KeyedLoadIC_Slow(); |
361 } | 361 } |
362 | 362 |
363 ElementsKind elements_kind = receiver_map->elements_kind(); | 363 ElementsKind elements_kind = receiver_map->elements_kind(); |
364 if (IsSloppyArgumentsElements(elements_kind)) { | 364 if (IsSloppyArgumentsElements(elements_kind)) { |
365 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_KeyedLoadSloppyArgumentsStub); | 365 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_KeyedLoadSloppyArgumentsStub); |
(...skipping 16 matching lines...) Expand all Loading... |
382 } | 382 } |
383 | 383 |
384 void ElementHandlerCompiler::CompileElementHandlers( | 384 void ElementHandlerCompiler::CompileElementHandlers( |
385 MapHandleList* receiver_maps, List<Handle<Object>>* handlers) { | 385 MapHandleList* receiver_maps, List<Handle<Object>>* handlers) { |
386 for (int i = 0; i < receiver_maps->length(); ++i) { | 386 for (int i = 0; i < receiver_maps->length(); ++i) { |
387 handlers->Add(GetKeyedLoadHandler(receiver_maps->at(i), isolate())); | 387 handlers->Add(GetKeyedLoadHandler(receiver_maps->at(i), isolate())); |
388 } | 388 } |
389 } | 389 } |
390 } // namespace internal | 390 } // namespace internal |
391 } // namespace v8 | 391 } // namespace v8 |
OLD | NEW |