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/ic/handler-compiler.h" | 7 #include "src/ic/handler-compiler.h" |
8 #include "src/ic/ic-inl.h" | 8 #include "src/ic/ic-inl.h" |
9 #include "src/ic/ic-compiler.h" | 9 #include "src/ic/ic-compiler.h" |
10 | 10 |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 is_js_array, store_mode).GetCode(); | 402 is_js_array, store_mode).GetCode(); |
403 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { | 403 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { |
404 cached_stub = isolate()->builtins()->KeyedStoreIC_Slow(); | 404 cached_stub = isolate()->builtins()->KeyedStoreIC_Slow(); |
405 } else { | 405 } else { |
406 if (receiver_map->has_fast_elements() || | 406 if (receiver_map->has_fast_elements() || |
407 receiver_map->has_external_array_elements() || | 407 receiver_map->has_external_array_elements() || |
408 receiver_map->has_fixed_typed_array_elements()) { | 408 receiver_map->has_fixed_typed_array_elements()) { |
409 cached_stub = StoreFastElementStub(isolate(), is_js_array, | 409 cached_stub = StoreFastElementStub(isolate(), is_js_array, |
410 elements_kind, store_mode).GetCode(); | 410 elements_kind, store_mode).GetCode(); |
411 } else { | 411 } else { |
412 cached_stub = StoreElementStub(isolate(), is_js_array, elements_kind, | 412 cached_stub = StoreElementStub(isolate(), elements_kind).GetCode(); |
413 store_mode).GetCode(); | |
414 } | 413 } |
415 } | 414 } |
416 DCHECK(!cached_stub.is_null()); | 415 DCHECK(!cached_stub.is_null()); |
417 handlers.Add(cached_stub); | 416 handlers.Add(cached_stub); |
418 transitioned_maps.Add(transitioned_map); | 417 transitioned_maps.Add(transitioned_map); |
419 } | 418 } |
420 | 419 |
421 Handle<Code> code = CompileKeyedStorePolymorphic(receiver_maps, &handlers, | 420 Handle<Code> code = CompileKeyedStorePolymorphic(receiver_maps, &handlers, |
422 &transitioned_maps); | 421 &transitioned_maps); |
423 isolate()->counters()->keyed_store_polymorphic_stubs()->Increment(); | 422 isolate()->counters()->keyed_store_polymorphic_stubs()->Increment(); |
424 PROFILE(isolate(), CodeCreateEvent(log_kind(code), *code, 0)); | 423 PROFILE(isolate(), CodeCreateEvent(log_kind(code), *code, 0)); |
425 return code; | 424 return code; |
426 } | 425 } |
427 | 426 |
428 | 427 |
429 #define __ ACCESS_MASM(masm()) | 428 #define __ ACCESS_MASM(masm()) |
430 | 429 |
431 | 430 |
432 Handle<Code> PropertyICCompiler::CompileKeyedStoreMonomorphic( | 431 Handle<Code> PropertyICCompiler::CompileKeyedStoreMonomorphic( |
433 Handle<Map> receiver_map, KeyedAccessStoreMode store_mode) { | 432 Handle<Map> receiver_map, KeyedAccessStoreMode store_mode) { |
434 ElementsKind elements_kind = receiver_map->elements_kind(); | 433 ElementsKind elements_kind = receiver_map->elements_kind(); |
435 bool is_jsarray = receiver_map->instance_type() == JS_ARRAY_TYPE; | 434 bool is_jsarray = receiver_map->instance_type() == JS_ARRAY_TYPE; |
436 Handle<Code> stub; | 435 Handle<Code> stub; |
437 if (receiver_map->has_fast_elements() || | 436 if (receiver_map->has_fast_elements() || |
438 receiver_map->has_external_array_elements() || | 437 receiver_map->has_external_array_elements() || |
439 receiver_map->has_fixed_typed_array_elements()) { | 438 receiver_map->has_fixed_typed_array_elements()) { |
440 stub = StoreFastElementStub(isolate(), is_jsarray, elements_kind, | 439 stub = StoreFastElementStub(isolate(), is_jsarray, elements_kind, |
441 store_mode).GetCode(); | 440 store_mode).GetCode(); |
442 } else { | 441 } else { |
443 stub = StoreElementStub(isolate(), is_jsarray, elements_kind, store_mode) | 442 stub = StoreElementStub(isolate(), elements_kind).GetCode(); |
444 .GetCode(); | |
445 } | 443 } |
446 | 444 |
447 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK); | 445 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK); |
448 | 446 |
449 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss); | 447 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss); |
450 | 448 |
451 return GetCode(kind(), Code::NORMAL, factory()->empty_string()); | 449 return GetCode(kind(), Code::NORMAL, factory()->empty_string()); |
452 } | 450 } |
453 | 451 |
454 | 452 |
455 #undef __ | 453 #undef __ |
456 } | 454 } |
457 } // namespace v8::internal | 455 } // namespace v8::internal |
OLD | NEW |