OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef V8_CODE_STUB_ASSEMBLER_H_ | 5 #ifndef V8_CODE_STUB_ASSEMBLER_H_ |
6 #define V8_CODE_STUB_ASSEMBLER_H_ | 6 #define V8_CODE_STUB_ASSEMBLER_H_ |
7 | 7 |
8 #include <functional> | 8 #include <functional> |
9 | 9 |
10 #include "src/compiler/code-assembler.h" | 10 #include "src/compiler/code-assembler.h" |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 compiler::Node* TryMonomorphicCase(const LoadICParameters* p, | 503 compiler::Node* TryMonomorphicCase(const LoadICParameters* p, |
504 compiler::Node* receiver_map, | 504 compiler::Node* receiver_map, |
505 Label* if_handler, Variable* var_handler, | 505 Label* if_handler, Variable* var_handler, |
506 Label* if_miss); | 506 Label* if_miss); |
507 void HandlePolymorphicCase(const LoadICParameters* p, | 507 void HandlePolymorphicCase(const LoadICParameters* p, |
508 compiler::Node* receiver_map, | 508 compiler::Node* receiver_map, |
509 compiler::Node* feedback, Label* if_handler, | 509 compiler::Node* feedback, Label* if_handler, |
510 Variable* var_handler, Label* if_miss, | 510 Variable* var_handler, Label* if_miss, |
511 int unroll_count); | 511 int unroll_count); |
512 | 512 |
513 void HandleLoadICHandlerCase(const LoadICParameters* p, | |
514 compiler::Node* handler, Label* miss); | |
515 | |
516 compiler::Node* StubCachePrimaryOffset(compiler::Node* name, | 513 compiler::Node* StubCachePrimaryOffset(compiler::Node* name, |
517 compiler::Node* map); | 514 compiler::Node* map); |
518 | 515 |
519 compiler::Node* StubCacheSecondaryOffset(compiler::Node* name, | 516 compiler::Node* StubCacheSecondaryOffset(compiler::Node* name, |
520 compiler::Node* seed); | 517 compiler::Node* seed); |
521 | 518 |
522 // This enum is used here as a replacement for StubCache::Table to avoid | 519 // This enum is used here as a replacement for StubCache::Table to avoid |
523 // including stub cache header. | 520 // including stub cache header. |
524 enum StubCacheTable : int; | 521 enum StubCacheTable : int; |
525 | 522 |
(...skipping 27 matching lines...) Expand all Loading... |
553 compiler::Node* value); | 550 compiler::Node* value); |
554 | 551 |
555 compiler::Node* GetFixedAarrayAllocationSize(compiler::Node* element_count, | 552 compiler::Node* GetFixedAarrayAllocationSize(compiler::Node* element_count, |
556 ElementsKind kind, | 553 ElementsKind kind, |
557 ParameterMode mode) { | 554 ParameterMode mode) { |
558 return ElementOffsetFromIndex(element_count, kind, mode, | 555 return ElementOffsetFromIndex(element_count, kind, mode, |
559 FixedArray::kHeaderSize); | 556 FixedArray::kHeaderSize); |
560 } | 557 } |
561 | 558 |
562 private: | 559 private: |
| 560 enum ElementSupport { kOnlyProperties, kSupportElements }; |
| 561 |
| 562 void HandleLoadICHandlerCase( |
| 563 const LoadICParameters* p, compiler::Node* handler, Label* miss, |
| 564 ElementSupport support_elements = kOnlyProperties); |
| 565 compiler::Node* TryToIntptr(compiler::Node* key, Label* miss); |
| 566 void EmitBoundsCheck(compiler::Node* object, compiler::Node* elements, |
| 567 compiler::Node* intptr_key, compiler::Node* is_jsarray, |
| 568 Label* miss); |
| 569 void EmitElementLoad(compiler::Node* object, compiler::Node* elements, |
| 570 compiler::Node* elements_kind, compiler::Node* key, |
| 571 Label* if_hole, Label* rebox_double, |
| 572 Variable* var_double_value, Label* miss); |
| 573 |
563 compiler::Node* ElementOffsetFromIndex(compiler::Node* index, | 574 compiler::Node* ElementOffsetFromIndex(compiler::Node* index, |
564 ElementsKind kind, ParameterMode mode, | 575 ElementsKind kind, ParameterMode mode, |
565 int base_size = 0); | 576 int base_size = 0); |
566 | 577 |
567 compiler::Node* AllocateRawAligned(compiler::Node* size_in_bytes, | 578 compiler::Node* AllocateRawAligned(compiler::Node* size_in_bytes, |
568 AllocationFlags flags, | 579 AllocationFlags flags, |
569 compiler::Node* top_address, | 580 compiler::Node* top_address, |
570 compiler::Node* limit_address); | 581 compiler::Node* limit_address); |
571 compiler::Node* AllocateRawUnaligned(compiler::Node* size_in_bytes, | 582 compiler::Node* AllocateRawUnaligned(compiler::Node* size_in_bytes, |
572 AllocationFlags flags, | 583 AllocationFlags flags, |
573 compiler::Node* top_adddress, | 584 compiler::Node* top_adddress, |
574 compiler::Node* limit_address); | 585 compiler::Node* limit_address); |
575 | 586 |
576 static const int kElementLoopUnrollThreshold = 8; | 587 static const int kElementLoopUnrollThreshold = 8; |
577 }; | 588 }; |
578 | 589 |
579 } // namespace internal | 590 } // namespace internal |
580 } // namespace v8 | 591 } // namespace v8 |
581 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 592 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |