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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/cpu-profiler.h" | 7 #include "src/cpu-profiler.h" |
8 #include "src/ic/handler-compiler.h" | 8 #include "src/ic/handler-compiler.h" |
9 #include "src/ic/ic-inl.h" | 9 #include "src/ic/ic-inl.h" |
10 #include "src/ic/ic-compiler.h" | 10 #include "src/ic/ic-compiler.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 !(is_strong(LoadICState::GetLanguageMode(extra_ic_state))); | 102 !(is_strong(LoadICState::GetLanguageMode(extra_ic_state))); |
103 Handle<Code> stub; | 103 Handle<Code> stub; |
104 if (receiver_map->has_indexed_interceptor()) { | 104 if (receiver_map->has_indexed_interceptor()) { |
105 stub = LoadIndexedInterceptorStub(isolate).GetCode(); | 105 stub = LoadIndexedInterceptorStub(isolate).GetCode(); |
106 } else if (receiver_map->IsStringMap()) { | 106 } else if (receiver_map->IsStringMap()) { |
107 // We have a string. | 107 // We have a string. |
108 stub = LoadIndexedStringStub(isolate).GetCode(); | 108 stub = LoadIndexedStringStub(isolate).GetCode(); |
109 } else if (receiver_map->has_sloppy_arguments_elements()) { | 109 } else if (receiver_map->has_sloppy_arguments_elements()) { |
110 stub = KeyedLoadSloppyArgumentsStub(isolate).GetCode(); | 110 stub = KeyedLoadSloppyArgumentsStub(isolate).GetCode(); |
111 } else if (receiver_map->has_fast_elements() || | 111 } else if (receiver_map->has_fast_elements() || |
| 112 receiver_map->has_external_array_elements() || |
112 receiver_map->has_fixed_typed_array_elements()) { | 113 receiver_map->has_fixed_typed_array_elements()) { |
113 stub = LoadFastElementStub(isolate, is_js_array, elements_kind, | 114 stub = LoadFastElementStub(isolate, is_js_array, elements_kind, |
114 convert_hole_to_undefined).GetCode(); | 115 convert_hole_to_undefined).GetCode(); |
115 } else { | 116 } else { |
116 stub = LoadDictionaryElementStub(isolate, LoadICState(extra_ic_state)) | 117 stub = LoadDictionaryElementStub(isolate, LoadICState(extra_ic_state)) |
117 .GetCode(); | 118 .GetCode(); |
118 } | 119 } |
119 return stub; | 120 return stub; |
120 } | 121 } |
121 | 122 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 cached_stub = | 362 cached_stub = |
362 ElementsTransitionAndStoreStub(isolate(), elements_kind, | 363 ElementsTransitionAndStoreStub(isolate(), elements_kind, |
363 transitioned_map->elements_kind(), | 364 transitioned_map->elements_kind(), |
364 is_js_array, store_mode).GetCode(); | 365 is_js_array, store_mode).GetCode(); |
365 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { | 366 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { |
366 cached_stub = isolate()->builtins()->KeyedStoreIC_Slow(); | 367 cached_stub = isolate()->builtins()->KeyedStoreIC_Slow(); |
367 } else { | 368 } else { |
368 if (IsSloppyArgumentsElements(elements_kind)) { | 369 if (IsSloppyArgumentsElements(elements_kind)) { |
369 cached_stub = KeyedStoreSloppyArgumentsStub(isolate()).GetCode(); | 370 cached_stub = KeyedStoreSloppyArgumentsStub(isolate()).GetCode(); |
370 } else if (receiver_map->has_fast_elements() || | 371 } else if (receiver_map->has_fast_elements() || |
| 372 receiver_map->has_external_array_elements() || |
371 receiver_map->has_fixed_typed_array_elements()) { | 373 receiver_map->has_fixed_typed_array_elements()) { |
372 cached_stub = StoreFastElementStub(isolate(), is_js_array, | 374 cached_stub = StoreFastElementStub(isolate(), is_js_array, |
373 elements_kind, store_mode).GetCode(); | 375 elements_kind, store_mode).GetCode(); |
374 } else { | 376 } else { |
375 cached_stub = StoreElementStub(isolate(), elements_kind).GetCode(); | 377 cached_stub = StoreElementStub(isolate(), elements_kind).GetCode(); |
376 } | 378 } |
377 } | 379 } |
378 DCHECK(!cached_stub.is_null()); | 380 DCHECK(!cached_stub.is_null()); |
379 handlers.Add(cached_stub); | 381 handlers.Add(cached_stub); |
380 transitioned_maps.Add(transitioned_map); | 382 transitioned_maps.Add(transitioned_map); |
(...skipping 11 matching lines...) Expand all Loading... |
392 | 394 |
393 | 395 |
394 Handle<Code> PropertyICCompiler::CompileKeyedStoreMonomorphic( | 396 Handle<Code> PropertyICCompiler::CompileKeyedStoreMonomorphic( |
395 Handle<Map> receiver_map, KeyedAccessStoreMode store_mode) { | 397 Handle<Map> receiver_map, KeyedAccessStoreMode store_mode) { |
396 ElementsKind elements_kind = receiver_map->elements_kind(); | 398 ElementsKind elements_kind = receiver_map->elements_kind(); |
397 bool is_jsarray = receiver_map->instance_type() == JS_ARRAY_TYPE; | 399 bool is_jsarray = receiver_map->instance_type() == JS_ARRAY_TYPE; |
398 Handle<Code> stub; | 400 Handle<Code> stub; |
399 if (receiver_map->has_sloppy_arguments_elements()) { | 401 if (receiver_map->has_sloppy_arguments_elements()) { |
400 stub = KeyedStoreSloppyArgumentsStub(isolate()).GetCode(); | 402 stub = KeyedStoreSloppyArgumentsStub(isolate()).GetCode(); |
401 } else if (receiver_map->has_fast_elements() || | 403 } else if (receiver_map->has_fast_elements() || |
| 404 receiver_map->has_external_array_elements() || |
402 receiver_map->has_fixed_typed_array_elements()) { | 405 receiver_map->has_fixed_typed_array_elements()) { |
403 stub = StoreFastElementStub(isolate(), is_jsarray, elements_kind, | 406 stub = StoreFastElementStub(isolate(), is_jsarray, elements_kind, |
404 store_mode).GetCode(); | 407 store_mode).GetCode(); |
405 } else { | 408 } else { |
406 stub = StoreElementStub(isolate(), elements_kind).GetCode(); | 409 stub = StoreElementStub(isolate(), elements_kind).GetCode(); |
407 } | 410 } |
408 | 411 |
409 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map); | 412 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map); |
410 | 413 |
411 __ DispatchWeakMap(receiver(), scratch1(), scratch2(), cell, stub, | 414 __ DispatchWeakMap(receiver(), scratch1(), scratch2(), cell, stub, |
412 DO_SMI_CHECK); | 415 DO_SMI_CHECK); |
413 | 416 |
414 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss); | 417 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss); |
415 | 418 |
416 return GetCode(kind(), Code::NORMAL, factory()->empty_string()); | 419 return GetCode(kind(), Code::NORMAL, factory()->empty_string()); |
417 } | 420 } |
418 | 421 |
419 | 422 |
420 #undef __ | 423 #undef __ |
421 } // namespace internal | 424 } // namespace internal |
422 } // namespace v8 | 425 } // namespace v8 |
OLD | NEW |