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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 TAG_OBJECT = 1 << 0, | 43 TAG_OBJECT = 1 << 0, |
44 // The content of the result register already contains the allocation top in | 44 // The content of the result register already contains the allocation top in |
45 // new space. | 45 // new space. |
46 RESULT_CONTAINS_TOP = 1 << 1 | 46 RESULT_CONTAINS_TOP = 1 << 1 |
47 }; | 47 }; |
48 | 48 |
49 | 49 |
50 // Default scratch register used by MacroAssembler (and other code that needs | 50 // Default scratch register used by MacroAssembler (and other code that needs |
51 // a spare register). The register isn't callee save, and not used by the | 51 // a spare register). The register isn't callee save, and not used by the |
52 // function calling convention. | 52 // function calling convention. |
53 static const Register kScratchRegister = { 10 }; // r10. | 53 const Register kScratchRegister = { 10 }; // r10. |
54 static const Register kSmiConstantRegister = { 12 }; // r12 (callee save). | 54 const Register kSmiConstantRegister = { 12 }; // r12 (callee save). |
55 static const Register kRootRegister = { 13 }; // r13 (callee save). | 55 const Register kRootRegister = { 13 }; // r13 (callee save). |
56 // Value of smi in kSmiConstantRegister. | 56 // Value of smi in kSmiConstantRegister. |
57 static const int kSmiConstantRegisterValue = 1; | 57 const int kSmiConstantRegisterValue = 1; |
58 // Actual value of root register is offset from the root array's start | 58 // Actual value of root register is offset from the root array's start |
59 // to take advantage of negitive 8-bit displacement values. | 59 // to take advantage of negitive 8-bit displacement values. |
60 static const int kRootRegisterBias = 128; | 60 const int kRootRegisterBias = 128; |
61 | 61 |
62 // Convenience for platform-independent signatures. | 62 // Convenience for platform-independent signatures. |
63 typedef Operand MemOperand; | 63 typedef Operand MemOperand; |
64 | 64 |
65 enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET }; | 65 enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET }; |
66 enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK }; | 66 enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK }; |
67 | 67 |
68 bool AreAliased(Register r1, Register r2, Register r3, Register r4); | 68 bool AreAliased(Register r1, Register r2, Register r3, Register r4); |
69 | 69 |
70 // Forward declaration. | 70 // Forward declaration. |
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1360 byte* address_; // The address of the code being patched. | 1360 byte* address_; // The address of the code being patched. |
1361 int size_; // Number of bytes of the expected patch size. | 1361 int size_; // Number of bytes of the expected patch size. |
1362 MacroAssembler masm_; // Macro assembler used to generate the code. | 1362 MacroAssembler masm_; // Macro assembler used to generate the code. |
1363 }; | 1363 }; |
1364 | 1364 |
1365 | 1365 |
1366 // ----------------------------------------------------------------------------- | 1366 // ----------------------------------------------------------------------------- |
1367 // Static helper functions. | 1367 // Static helper functions. |
1368 | 1368 |
1369 // Generate an Operand for loading a field from an object. | 1369 // Generate an Operand for loading a field from an object. |
1370 static inline Operand FieldOperand(Register object, int offset) { | 1370 inline Operand FieldOperand(Register object, int offset) { |
1371 return Operand(object, offset - kHeapObjectTag); | 1371 return Operand(object, offset - kHeapObjectTag); |
1372 } | 1372 } |
1373 | 1373 |
1374 | 1374 |
1375 // Generate an Operand for loading an indexed field from an object. | 1375 // Generate an Operand for loading an indexed field from an object. |
1376 static inline Operand FieldOperand(Register object, | 1376 inline Operand FieldOperand(Register object, |
1377 Register index, | 1377 Register index, |
1378 ScaleFactor scale, | 1378 ScaleFactor scale, |
1379 int offset) { | 1379 int offset) { |
1380 return Operand(object, index, scale, offset - kHeapObjectTag); | 1380 return Operand(object, index, scale, offset - kHeapObjectTag); |
1381 } | 1381 } |
1382 | 1382 |
1383 | 1383 |
1384 static inline Operand ContextOperand(Register context, int index) { | 1384 inline Operand ContextOperand(Register context, int index) { |
1385 return Operand(context, Context::SlotOffset(index)); | 1385 return Operand(context, Context::SlotOffset(index)); |
1386 } | 1386 } |
1387 | 1387 |
1388 | 1388 |
1389 static inline Operand GlobalObjectOperand() { | 1389 inline Operand GlobalObjectOperand() { |
1390 return ContextOperand(rsi, Context::GLOBAL_INDEX); | 1390 return ContextOperand(rsi, Context::GLOBAL_INDEX); |
1391 } | 1391 } |
1392 | 1392 |
1393 | 1393 |
1394 // Provides access to exit frame stack space (not GCed). | 1394 // Provides access to exit frame stack space (not GCed). |
1395 static inline Operand StackSpaceOperand(int index) { | 1395 inline Operand StackSpaceOperand(int index) { |
1396 #ifdef _WIN64 | 1396 #ifdef _WIN64 |
1397 const int kShaddowSpace = 4; | 1397 const int kShaddowSpace = 4; |
1398 return Operand(rsp, (index + kShaddowSpace) * kPointerSize); | 1398 return Operand(rsp, (index + kShaddowSpace) * kPointerSize); |
1399 #else | 1399 #else |
1400 return Operand(rsp, index * kPointerSize); | 1400 return Operand(rsp, index * kPointerSize); |
1401 #endif | 1401 #endif |
1402 } | 1402 } |
1403 | 1403 |
1404 | 1404 |
1405 | 1405 |
(...skipping 14 matching lines...) Expand all Loading... |
1420 masm->popfd(); \ | 1420 masm->popfd(); \ |
1421 } \ | 1421 } \ |
1422 masm-> | 1422 masm-> |
1423 #else | 1423 #else |
1424 #define ACCESS_MASM(masm) masm-> | 1424 #define ACCESS_MASM(masm) masm-> |
1425 #endif | 1425 #endif |
1426 | 1426 |
1427 } } // namespace v8::internal | 1427 } } // namespace v8::internal |
1428 | 1428 |
1429 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1429 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |