| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 27 matching lines...) Expand all Loading... |
| 38 // ---------------------------------------------------------------------------- | 38 // ---------------------------------------------------------------------------- |
| 39 // Static helper functions | 39 // Static helper functions |
| 40 | 40 |
| 41 // Generate a MemOperand for loading a field from an object. | 41 // Generate a MemOperand for loading a field from an object. |
| 42 inline MemOperand FieldMemOperand(Register object, int offset) { | 42 inline MemOperand FieldMemOperand(Register object, int offset) { |
| 43 return MemOperand(object, offset - kHeapObjectTag); | 43 return MemOperand(object, offset - kHeapObjectTag); |
| 44 } | 44 } |
| 45 | 45 |
| 46 | 46 |
| 47 // Give alias names to registers | 47 // Give alias names to registers |
| 48 const Register pp = { kRegister_r7_Code }; // Constant pool pointer. | 48 const Register cp = { kRegister_r7_Code }; // JavaScript context pointer. |
| 49 const Register cp = { kRegister_r8_Code }; // JavaScript context pointer. | 49 const Register pp = { kRegister_r8_Code }; // Constant pool pointer. |
| 50 const Register kRootRegister = { kRegister_r10_Code }; // Roots array pointer. | 50 const Register kRootRegister = { kRegister_r10_Code }; // Roots array pointer. |
| 51 | 51 |
| 52 // Flags used for AllocateHeapNumber | 52 // Flags used for AllocateHeapNumber |
| 53 enum TaggingMode { | 53 enum TaggingMode { |
| 54 // Tag the result. | 54 // Tag the result. |
| 55 TAG_RESULT, | 55 TAG_RESULT, |
| 56 // Don't tag | 56 // Don't tag |
| 57 DONT_TAG_RESULT | 57 DONT_TAG_RESULT |
| 58 }; | 58 }; |
| 59 | 59 |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 CallKind call_kind); | 606 CallKind call_kind); |
| 607 | 607 |
| 608 // Invoke the JavaScript function in the given register. Changes the | 608 // Invoke the JavaScript function in the given register. Changes the |
| 609 // current context to the context in the function before invoking. | 609 // current context to the context in the function before invoking. |
| 610 void InvokeFunction(Register function, | 610 void InvokeFunction(Register function, |
| 611 const ParameterCount& actual, | 611 const ParameterCount& actual, |
| 612 InvokeFlag flag, | 612 InvokeFlag flag, |
| 613 const CallWrapper& call_wrapper, | 613 const CallWrapper& call_wrapper, |
| 614 CallKind call_kind); | 614 CallKind call_kind); |
| 615 | 615 |
| 616 void InvokeFunction(Register function, |
| 617 const ParameterCount& expected, |
| 618 const ParameterCount& actual, |
| 619 InvokeFlag flag, |
| 620 const CallWrapper& call_wrapper, |
| 621 CallKind call_kind); |
| 622 |
| 616 void InvokeFunction(Handle<JSFunction> function, | 623 void InvokeFunction(Handle<JSFunction> function, |
| 617 const ParameterCount& expected, | 624 const ParameterCount& expected, |
| 618 const ParameterCount& actual, | 625 const ParameterCount& actual, |
| 619 InvokeFlag flag, | 626 InvokeFlag flag, |
| 620 const CallWrapper& call_wrapper, | 627 const CallWrapper& call_wrapper, |
| 621 CallKind call_kind); | 628 CallKind call_kind); |
| 622 | 629 |
| 623 void IsObjectJSObjectType(Register heap_object, | 630 void IsObjectJSObjectType(Register heap_object, |
| 624 Register map, | 631 Register map, |
| 625 Register scratch, | 632 Register scratch, |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 Label* miss, | 845 Label* miss, |
| 839 bool miss_on_bound_function = false); | 846 bool miss_on_bound_function = false); |
| 840 | 847 |
| 841 // Compare object type for heap object. heap_object contains a non-Smi | 848 // Compare object type for heap object. heap_object contains a non-Smi |
| 842 // whose object type should be compared with the given type. This both | 849 // whose object type should be compared with the given type. This both |
| 843 // sets the flags and leaves the object type in the type_reg register. | 850 // sets the flags and leaves the object type in the type_reg register. |
| 844 // It leaves the map in the map register (unless the type_reg and map register | 851 // It leaves the map in the map register (unless the type_reg and map register |
| 845 // are the same register). It leaves the heap object in the heap_object | 852 // are the same register). It leaves the heap object in the heap_object |
| 846 // register unless the heap_object register is the same register as one of the | 853 // register unless the heap_object register is the same register as one of the |
| 847 // other registers. | 854 // other registers. |
| 855 // Type_reg can be no_reg. In that case ip is used. |
| 848 void CompareObjectType(Register heap_object, | 856 void CompareObjectType(Register heap_object, |
| 849 Register map, | 857 Register map, |
| 850 Register type_reg, | 858 Register type_reg, |
| 851 InstanceType type); | 859 InstanceType type); |
| 852 | 860 |
| 861 // Compare object type for heap object. Branch to false_label if type |
| 862 // is lower than min_type or greater than max_type. |
| 863 // Load map into the register map. |
| 864 void CheckObjectTypeRange(Register heap_object, |
| 865 Register map, |
| 866 InstanceType min_type, |
| 867 InstanceType max_type, |
| 868 Label* false_label); |
| 869 |
| 853 // Compare instance type in a map. map contains a valid map object whose | 870 // Compare instance type in a map. map contains a valid map object whose |
| 854 // object type should be compared with the given type. This both | 871 // object type should be compared with the given type. This both |
| 855 // sets the flags and leaves the object type in the type_reg register. | 872 // sets the flags and leaves the object type in the type_reg register. |
| 856 void CompareInstanceType(Register map, | 873 void CompareInstanceType(Register map, |
| 857 Register type_reg, | 874 Register type_reg, |
| 858 InstanceType type); | 875 InstanceType type); |
| 859 | 876 |
| 860 | 877 |
| 861 // Check if a map for a JSObject indicates that the object has fast elements. | 878 // Check if a map for a JSObject indicates that the object has fast elements. |
| 862 // Jump to the specified label if it does not. | 879 // Jump to the specified label if it does not. |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1174 | 1191 |
| 1175 // Like Assert(), but always enabled. | 1192 // Like Assert(), but always enabled. |
| 1176 void Check(Condition cond, BailoutReason reason); | 1193 void Check(Condition cond, BailoutReason reason); |
| 1177 | 1194 |
| 1178 // Print a message to stdout and abort execution. | 1195 // Print a message to stdout and abort execution. |
| 1179 void Abort(BailoutReason msg); | 1196 void Abort(BailoutReason msg); |
| 1180 | 1197 |
| 1181 // Verify restrictions about code generated in stubs. | 1198 // Verify restrictions about code generated in stubs. |
| 1182 void set_generating_stub(bool value) { generating_stub_ = value; } | 1199 void set_generating_stub(bool value) { generating_stub_ = value; } |
| 1183 bool generating_stub() { return generating_stub_; } | 1200 bool generating_stub() { return generating_stub_; } |
| 1184 void set_allow_stub_calls(bool value) { allow_stub_calls_ = value; } | |
| 1185 bool allow_stub_calls() { return allow_stub_calls_; } | |
| 1186 void set_has_frame(bool value) { has_frame_ = value; } | 1201 void set_has_frame(bool value) { has_frame_ = value; } |
| 1187 bool has_frame() { return has_frame_; } | 1202 bool has_frame() { return has_frame_; } |
| 1188 inline bool AllowThisStubCall(CodeStub* stub); | 1203 inline bool AllowThisStubCall(CodeStub* stub); |
| 1189 | 1204 |
| 1190 // EABI variant for double arguments in use. | 1205 // EABI variant for double arguments in use. |
| 1191 bool use_eabi_hardfloat() { | 1206 bool use_eabi_hardfloat() { |
| 1192 #ifdef __arm__ | 1207 #ifdef __arm__ |
| 1193 return OS::ArmUsingHardFloat(); | 1208 return OS::ArmUsingHardFloat(); |
| 1194 #elif USE_EABI_HARDFLOAT | 1209 #elif USE_EABI_HARDFLOAT |
| 1195 return true; | 1210 return true; |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1454 // Helper for throwing exceptions. Compute a handler address and jump to | 1469 // Helper for throwing exceptions. Compute a handler address and jump to |
| 1455 // it. See the implementation for register usage. | 1470 // it. See the implementation for register usage. |
| 1456 void JumpToHandlerEntry(); | 1471 void JumpToHandlerEntry(); |
| 1457 | 1472 |
| 1458 // Compute memory operands for safepoint stack slots. | 1473 // Compute memory operands for safepoint stack slots. |
| 1459 static int SafepointRegisterStackIndex(int reg_code); | 1474 static int SafepointRegisterStackIndex(int reg_code); |
| 1460 MemOperand SafepointRegisterSlot(Register reg); | 1475 MemOperand SafepointRegisterSlot(Register reg); |
| 1461 MemOperand SafepointRegistersAndDoublesSlot(Register reg); | 1476 MemOperand SafepointRegistersAndDoublesSlot(Register reg); |
| 1462 | 1477 |
| 1463 bool generating_stub_; | 1478 bool generating_stub_; |
| 1464 bool allow_stub_calls_; | |
| 1465 bool has_frame_; | 1479 bool has_frame_; |
| 1466 // This handle will be patched with the code object on installation. | 1480 // This handle will be patched with the code object on installation. |
| 1467 Handle<Object> code_object_; | 1481 Handle<Object> code_object_; |
| 1468 | 1482 |
| 1469 // Needs access to SafepointRegisterStackIndex for compiled frame | 1483 // Needs access to SafepointRegisterStackIndex for compiled frame |
| 1470 // traversal. | 1484 // traversal. |
| 1471 friend class StandardFrame; | 1485 friend class StandardFrame; |
| 1472 }; | 1486 }; |
| 1473 | 1487 |
| 1474 | 1488 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1529 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1543 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
| 1530 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1544 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
| 1531 #else | 1545 #else |
| 1532 #define ACCESS_MASM(masm) masm-> | 1546 #define ACCESS_MASM(masm) masm-> |
| 1533 #endif | 1547 #endif |
| 1534 | 1548 |
| 1535 | 1549 |
| 1536 } } // namespace v8::internal | 1550 } } // namespace v8::internal |
| 1537 | 1551 |
| 1538 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 1552 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
| OLD | NEW |