| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 #ifndef V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 28 #ifndef V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
| 29 #define V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 29 #define V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
| 30 | 30 |
| 31 #include "assembler.h" | 31 #include "assembler.h" |
| 32 #include "v8globals.h" |
| 32 | 33 |
| 33 namespace v8 { | 34 namespace v8 { |
| 34 namespace internal { | 35 namespace internal { |
| 35 | 36 |
| 36 // ---------------------------------------------------------------------------- | 37 // ---------------------------------------------------------------------------- |
| 37 // Static helper functions | 38 // Static helper functions |
| 38 | 39 |
| 39 // Generate a MemOperand for loading a field from an object. | 40 // Generate a MemOperand for loading a field from an object. |
| 40 static inline MemOperand FieldMemOperand(Register object, int offset) { | 41 static inline MemOperand FieldMemOperand(Register object, int offset) { |
| 41 return MemOperand(object, offset - kHeapObjectTag); | 42 return MemOperand(object, offset - kHeapObjectTag); |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 | 570 |
| 570 | 571 |
| 571 // Check if the map of an object is equal to a specified map (either | 572 // Check if the map of an object is equal to a specified map (either |
| 572 // given directly or as an index into the root list) and branch to | 573 // given directly or as an index into the root list) and branch to |
| 573 // label if not. Skip the smi check if not required (object is known | 574 // label if not. Skip the smi check if not required (object is known |
| 574 // to be a heap object) | 575 // to be a heap object) |
| 575 void CheckMap(Register obj, | 576 void CheckMap(Register obj, |
| 576 Register scratch, | 577 Register scratch, |
| 577 Handle<Map> map, | 578 Handle<Map> map, |
| 578 Label* fail, | 579 Label* fail, |
| 579 bool is_heap_object); | 580 SmiCheckType smi_check_type); |
| 581 |
| 580 | 582 |
| 581 void CheckMap(Register obj, | 583 void CheckMap(Register obj, |
| 582 Register scratch, | 584 Register scratch, |
| 583 Heap::RootListIndex index, | 585 Heap::RootListIndex index, |
| 584 Label* fail, | 586 Label* fail, |
| 585 bool is_heap_object); | 587 SmiCheckType smi_check_type); |
| 588 |
| 589 |
| 590 // Check if the map of an object is equal to a specified map and branch to a |
| 591 // specified target if equal. Skip the smi check if not required (object is |
| 592 // known to be a heap object) |
| 593 void DispatchMap(Register obj, |
| 594 Register scratch, |
| 595 Handle<Map> map, |
| 596 Handle<Code> success, |
| 597 SmiCheckType smi_check_type); |
| 586 | 598 |
| 587 | 599 |
| 588 // Compare the object in a register to a value from the root list. | 600 // Compare the object in a register to a value from the root list. |
| 589 // Uses the ip register as scratch. | 601 // Uses the ip register as scratch. |
| 590 void CompareRoot(Register obj, Heap::RootListIndex index); | 602 void CompareRoot(Register obj, Heap::RootListIndex index); |
| 591 | 603 |
| 592 | 604 |
| 593 // Load and check the instance type of an object for being a string. | 605 // Load and check the instance type of an object for being a string. |
| 594 // Loads the type into the second argument register. | 606 // Loads the type into the second argument register. |
| 595 // Returns a condition that will be enabled if the object was a string. | 607 // Returns a condition that will be enabled if the object was a string. |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 void CountLeadingZeros(Register zeros, | 708 void CountLeadingZeros(Register zeros, |
| 697 Register source, | 709 Register source, |
| 698 Register scratch); | 710 Register scratch); |
| 699 | 711 |
| 700 // --------------------------------------------------------------------------- | 712 // --------------------------------------------------------------------------- |
| 701 // Runtime calls | 713 // Runtime calls |
| 702 | 714 |
| 703 // Call a code stub. | 715 // Call a code stub. |
| 704 void CallStub(CodeStub* stub, Condition cond = al); | 716 void CallStub(CodeStub* stub, Condition cond = al); |
| 705 | 717 |
| 718 // Call a code stub and return the code object called. Try to generate |
| 719 // the code if necessary. Do not perform a GC but instead return a retry |
| 720 // after GC failure. |
| 721 MUST_USE_RESULT MaybeObject* TryCallStub(CodeStub* stub, Condition cond = al); |
| 722 |
| 706 // Call a code stub. | 723 // Call a code stub. |
| 707 void TailCallStub(CodeStub* stub, Condition cond = al); | 724 void TailCallStub(CodeStub* stub, Condition cond = al); |
| 708 | 725 |
| 709 // Tail call a code stub (jump) and return the code object called. Try to | 726 // Tail call a code stub (jump) and return the code object called. Try to |
| 710 // generate the code if necessary. Do not perform a GC but instead return | 727 // generate the code if necessary. Do not perform a GC but instead return |
| 711 // a retry after GC failure. | 728 // a retry after GC failure. |
| 712 MUST_USE_RESULT MaybeObject* TryTailCallStub(CodeStub* stub, | 729 MUST_USE_RESULT MaybeObject* TryTailCallStub(CodeStub* stub, |
| 713 Condition cond = al); | 730 Condition cond = al); |
| 714 | 731 |
| 715 // Call a runtime routine. | 732 // Call a runtime routine. |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 | 993 |
| 977 // --------------------------------------------------------------------------- | 994 // --------------------------------------------------------------------------- |
| 978 // Patching helpers. | 995 // Patching helpers. |
| 979 | 996 |
| 980 // Get the location of a relocated constant (its address in the constant pool) | 997 // Get the location of a relocated constant (its address in the constant pool) |
| 981 // from its load site. | 998 // from its load site. |
| 982 void GetRelocatedValueLocation(Register ldr_location, | 999 void GetRelocatedValueLocation(Register ldr_location, |
| 983 Register result); | 1000 Register result); |
| 984 | 1001 |
| 985 | 1002 |
| 1003 void ClampUint8(Register output_reg, Register input_reg); |
| 1004 |
| 1005 void ClampDoubleToUint8(Register result_reg, |
| 1006 DoubleRegister input_reg, |
| 1007 DoubleRegister temp_double_reg); |
| 1008 |
| 1009 |
| 986 private: | 1010 private: |
| 987 void CallCFunctionHelper(Register function, | 1011 void CallCFunctionHelper(Register function, |
| 988 ExternalReference function_reference, | 1012 ExternalReference function_reference, |
| 989 Register scratch, | 1013 Register scratch, |
| 990 int num_reg_arguments, | 1014 int num_reg_arguments, |
| 991 int num_double_arguments); | 1015 int num_double_arguments); |
| 992 | 1016 |
| 993 void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al); | 1017 void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al); |
| 994 int CallSize(intptr_t target, RelocInfo::Mode rmode, Condition cond = al); | 1018 int CallSize(intptr_t target, RelocInfo::Mode rmode, Condition cond = al); |
| 995 void Call(intptr_t target, | 1019 void Call(intptr_t target, |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1083 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1107 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
| 1084 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1108 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
| 1085 #else | 1109 #else |
| 1086 #define ACCESS_MASM(masm) masm-> | 1110 #define ACCESS_MASM(masm) masm-> |
| 1087 #endif | 1111 #endif |
| 1088 | 1112 |
| 1089 | 1113 |
| 1090 } } // namespace v8::internal | 1114 } } // namespace v8::internal |
| 1091 | 1115 |
| 1092 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 1116 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
| OLD | NEW |