| 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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 Label* if_handler, Variable* var_handler, | 539 Label* if_handler, Variable* var_handler, |
| 540 Label* if_miss); | 540 Label* if_miss); |
| 541 | 541 |
| 542 void TryProbeStubCache(StubCache* stub_cache, compiler::Node* receiver, | 542 void TryProbeStubCache(StubCache* stub_cache, compiler::Node* receiver, |
| 543 compiler::Node* name, Label* if_handler, | 543 compiler::Node* name, Label* if_handler, |
| 544 Variable* var_handler, Label* if_miss); | 544 Variable* var_handler, Label* if_miss); |
| 545 | 545 |
| 546 void LoadIC(const LoadICParameters* p); | 546 void LoadIC(const LoadICParameters* p); |
| 547 void LoadGlobalIC(const LoadICParameters* p); | 547 void LoadGlobalIC(const LoadICParameters* p); |
| 548 void KeyedLoadIC(const LoadICParameters* p); | 548 void KeyedLoadIC(const LoadICParameters* p); |
| 549 void KeyedLoadICGeneric(const LoadICParameters* p); |
| 549 | 550 |
| 550 // Get the enumerable length from |map| and return the result as a Smi. | 551 // Get the enumerable length from |map| and return the result as a Smi. |
| 551 compiler::Node* EnumLength(compiler::Node* map); | 552 compiler::Node* EnumLength(compiler::Node* map); |
| 552 | 553 |
| 553 // Check the cache validity for |receiver|. Branch to |use_cache| if | 554 // Check the cache validity for |receiver|. Branch to |use_cache| if |
| 554 // the cache is valid, otherwise branch to |use_runtime|. | 555 // the cache is valid, otherwise branch to |use_runtime|. |
| 555 void CheckEnumCache(compiler::Node* receiver, | 556 void CheckEnumCache(compiler::Node* receiver, |
| 556 CodeStubAssembler::Label* use_cache, | 557 CodeStubAssembler::Label* use_cache, |
| 557 CodeStubAssembler::Label* use_runtime); | 558 CodeStubAssembler::Label* use_runtime); |
| 558 | 559 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 569 FixedArray::kHeaderSize); | 570 FixedArray::kHeaderSize); |
| 570 } | 571 } |
| 571 | 572 |
| 572 private: | 573 private: |
| 573 enum ElementSupport { kOnlyProperties, kSupportElements }; | 574 enum ElementSupport { kOnlyProperties, kSupportElements }; |
| 574 | 575 |
| 575 void HandleLoadICHandlerCase( | 576 void HandleLoadICHandlerCase( |
| 576 const LoadICParameters* p, compiler::Node* handler, Label* miss, | 577 const LoadICParameters* p, compiler::Node* handler, Label* miss, |
| 577 ElementSupport support_elements = kOnlyProperties); | 578 ElementSupport support_elements = kOnlyProperties); |
| 578 compiler::Node* TryToIntptr(compiler::Node* key, Label* miss); | 579 compiler::Node* TryToIntptr(compiler::Node* key, Label* miss); |
| 579 void EmitBoundsCheck(compiler::Node* object, compiler::Node* elements, | 580 void EmitFastElementsBoundsCheck(compiler::Node* object, |
| 580 compiler::Node* intptr_key, compiler::Node* is_jsarray, | 581 compiler::Node* elements, |
| 581 Label* miss); | 582 compiler::Node* intptr_key, |
| 583 compiler::Node* is_jsarray_condition, |
| 584 Label* miss); |
| 582 void EmitElementLoad(compiler::Node* object, compiler::Node* elements, | 585 void EmitElementLoad(compiler::Node* object, compiler::Node* elements, |
| 583 compiler::Node* elements_kind, compiler::Node* key, | 586 compiler::Node* elements_kind, compiler::Node* key, |
| 584 Label* if_hole, Label* rebox_double, | 587 compiler::Node* is_jsarray_condition, Label* if_hole, |
| 585 Variable* var_double_value, Label* miss); | 588 Label* rebox_double, Variable* var_double_value, |
| 589 Label* unimplemented_elements_kind, Label* out_of_bounds, |
| 590 Label* miss); |
| 591 void BranchIfPrototypesHaveNoElements(compiler::Node* receiver_map, |
| 592 Label* definitely_no_elements, |
| 593 Label* possibly_elements); |
| 586 | 594 |
| 587 compiler::Node* ElementOffsetFromIndex(compiler::Node* index, | 595 compiler::Node* ElementOffsetFromIndex(compiler::Node* index, |
| 588 ElementsKind kind, ParameterMode mode, | 596 ElementsKind kind, ParameterMode mode, |
| 589 int base_size = 0); | 597 int base_size = 0); |
| 590 | 598 |
| 591 compiler::Node* AllocateRawAligned(compiler::Node* size_in_bytes, | 599 compiler::Node* AllocateRawAligned(compiler::Node* size_in_bytes, |
| 592 AllocationFlags flags, | 600 AllocationFlags flags, |
| 593 compiler::Node* top_address, | 601 compiler::Node* top_address, |
| 594 compiler::Node* limit_address); | 602 compiler::Node* limit_address); |
| 595 compiler::Node* AllocateRawUnaligned(compiler::Node* size_in_bytes, | 603 compiler::Node* AllocateRawUnaligned(compiler::Node* size_in_bytes, |
| 596 AllocationFlags flags, | 604 AllocationFlags flags, |
| 597 compiler::Node* top_adddress, | 605 compiler::Node* top_adddress, |
| 598 compiler::Node* limit_address); | 606 compiler::Node* limit_address); |
| 599 | 607 |
| 600 compiler::Node* SmiShiftBitsConstant(); | 608 compiler::Node* SmiShiftBitsConstant(); |
| 601 | 609 |
| 602 static const int kElementLoopUnrollThreshold = 8; | 610 static const int kElementLoopUnrollThreshold = 8; |
| 603 }; | 611 }; |
| 604 | 612 |
| 605 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 613 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
| 606 | 614 |
| 607 } // namespace internal | 615 } // namespace internal |
| 608 } // namespace v8 | 616 } // namespace v8 |
| 609 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 617 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
| OLD | NEW |