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