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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // but won't touch other registers except in special cases. | 46 // but won't touch other registers except in special cases. |
47 // | 47 // |
48 // Per the MIPS ABI, register t9 must be used for indirect function call | 48 // Per the MIPS ABI, register t9 must be used for indirect function call |
49 // via 'jalr t9' or 'jr t9' instructions. This is relied upon by gcc when | 49 // via 'jalr t9' or 'jr t9' instructions. This is relied upon by gcc when |
50 // trying to update gp register for position-independent-code. Whenever | 50 // trying to update gp register for position-independent-code. Whenever |
51 // MIPS generated code calls C code, it must be via t9 register. | 51 // MIPS generated code calls C code, it must be via t9 register. |
52 | 52 |
53 | 53 |
54 // Register aliases. | 54 // Register aliases. |
55 // cp is assumed to be a callee saved register. | 55 // cp is assumed to be a callee saved register. |
56 const Register lithiumScratchReg = s3; // Scratch register. | 56 const Register kLithiumScratchReg = s3; // Scratch register. |
57 const Register lithiumScratchReg2 = s4; // Scratch register. | 57 const Register kLithiumScratchReg2 = s4; // Scratch register. |
58 const Register condReg = s5; // Simulated (partial) condition code for mips. | 58 const Register kCondReg = s5; // Simulated (partial) condition code for mips. |
59 const Register roots = s6; // Roots array pointer. | 59 const Register kRootRegister = s6; // Roots array pointer. |
60 const Register cp = s7; // JavaScript context pointer. | 60 const Register cp = s7; // JavaScript context pointer. |
61 const Register fp = s8_fp; // Alias for fp. | 61 const Register fp = s8_fp; // Alias for fp. |
62 const DoubleRegister lithiumScratchDouble = f30; // Double scratch register. | 62 const DoubleRegister kLithiumScratchDouble = f30; // Double scratch register. |
63 | 63 |
64 // Flags used for the AllocateInNewSpace functions. | 64 // Flags used for the AllocateInNewSpace functions. |
65 enum AllocationFlags { | 65 enum AllocationFlags { |
66 // No special flags. | 66 // No special flags. |
67 NO_ALLOCATION_FLAGS = 0, | 67 NO_ALLOCATION_FLAGS = 0, |
68 // Return the pointer to the allocated already tagged as a heap object. | 68 // Return the pointer to the allocated already tagged as a heap object. |
69 TAG_OBJECT = 1 << 0, | 69 TAG_OBJECT = 1 << 0, |
70 // The content of the result register already contains the allocation top in | 70 // The content of the result register already contains the allocation top in |
71 // new space. | 71 // new space. |
72 RESULT_CONTAINS_TOP = 1 << 1, | 72 RESULT_CONTAINS_TOP = 1 << 1, |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 void LoadContext(Register dst, int context_chain_length); | 782 void LoadContext(Register dst, int context_chain_length); |
783 | 783 |
784 void LoadGlobalFunction(int index, Register function); | 784 void LoadGlobalFunction(int index, Register function); |
785 | 785 |
786 // Load the initial map from the global function. The registers | 786 // Load the initial map from the global function. The registers |
787 // function and map can be the same, function is then overwritten. | 787 // function and map can be the same, function is then overwritten. |
788 void LoadGlobalFunctionInitialMap(Register function, | 788 void LoadGlobalFunctionInitialMap(Register function, |
789 Register map, | 789 Register map, |
790 Register scratch); | 790 Register scratch); |
791 | 791 |
| 792 void InitializeRootRegister() { |
| 793 ExternalReference roots_array_start = |
| 794 ExternalReference::roots_array_start(isolate()); |
| 795 li(kRootRegister, Operand(roots_array_start)); |
| 796 } |
792 | 797 |
793 // ------------------------------------------------------------------------- | 798 // ------------------------------------------------------------------------- |
794 // JavaScript invokes. | 799 // JavaScript invokes. |
795 | 800 |
796 // Setup call kind marking in t1. The method takes t1 as an | 801 // Setup call kind marking in t1. The method takes t1 as an |
797 // explicit first parameter to make the code more readable at the | 802 // explicit first parameter to make the code more readable at the |
798 // call sites. | 803 // call sites. |
799 void SetCallKind(Register dst, CallKind kind); | 804 void SetCallKind(Register dst, CallKind kind); |
800 | 805 |
801 // Invoke the JavaScript function code by either calling or jumping. | 806 // Invoke the JavaScript function code by either calling or jumping. |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 1453 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
1449 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1454 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1450 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1455 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1451 #else | 1456 #else |
1452 #define ACCESS_MASM(masm) masm-> | 1457 #define ACCESS_MASM(masm) masm-> |
1453 #endif | 1458 #endif |
1454 | 1459 |
1455 } } // namespace v8::internal | 1460 } } // namespace v8::internal |
1456 | 1461 |
1457 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 1462 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
OLD | NEW |