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 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1511 inline Operand StackSpaceOperand(int index) { | 1511 inline Operand StackSpaceOperand(int index) { |
1512 #ifdef _WIN64 | 1512 #ifdef _WIN64 |
1513 const int kShaddowSpace = 4; | 1513 const int kShaddowSpace = 4; |
1514 return Operand(rsp, (index + kShaddowSpace) * kPointerSize); | 1514 return Operand(rsp, (index + kShaddowSpace) * kPointerSize); |
1515 #else | 1515 #else |
1516 return Operand(rsp, index * kPointerSize); | 1516 return Operand(rsp, index * kPointerSize); |
1517 #endif | 1517 #endif |
1518 } | 1518 } |
1519 | 1519 |
1520 | 1520 |
1521 // Assumes the return address size equals an argument size. | |
1522 // Considers receiver as argument 0. | |
1523 inline Operand StackOperandForArgument(int32_t disp) { | |
1524 // Adjusts the disp with kPCOnStackSize - kPointerSize. | |
1525 return Operand(rsp, disp + kPCOnStackSize - kPointerSize); | |
danno
2013/07/31 07:48:37
Does it make sense to use an index rather than dis
haitao.feng
2013/07/31 09:25:20
I have thought about this. I did not use it as ind
| |
1526 } | |
1527 | |
1528 | |
1529 // Assumes the return address size equals an argument size. | |
1530 // Considers receiver as argument 0. | |
1531 inline Operand StackOperandForArgument(Register index, | |
1532 ScaleFactor scale, | |
1533 int32_t disp) { | |
danno
2013/07/31 07:48:37
Same here (index rather than displacement)?
| |
1534 // Adjusts the disp with kPCOnStackSize - kPointerSize. | |
1535 return Operand(rsp, index, scale, disp + kPCOnStackSize - kPointerSize); | |
1536 } | |
1537 | |
1521 | 1538 |
1522 #ifdef GENERATED_CODE_COVERAGE | 1539 #ifdef GENERATED_CODE_COVERAGE |
1523 extern void LogGeneratedCodeCoverage(const char* file_line); | 1540 extern void LogGeneratedCodeCoverage(const char* file_line); |
1524 #define CODE_COVERAGE_STRINGIFY(x) #x | 1541 #define CODE_COVERAGE_STRINGIFY(x) #x |
1525 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 1542 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
1526 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1543 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1527 #define ACCESS_MASM(masm) { \ | 1544 #define ACCESS_MASM(masm) { \ |
1528 Address x64_coverage_function = FUNCTION_ADDR(LogGeneratedCodeCoverage); \ | 1545 Address x64_coverage_function = FUNCTION_ADDR(LogGeneratedCodeCoverage); \ |
1529 masm->pushfq(); \ | 1546 masm->pushfq(); \ |
1530 masm->Pushad(); \ | 1547 masm->Pushad(); \ |
1531 masm->push(Immediate(reinterpret_cast<int>(&__FILE_LINE__))); \ | 1548 masm->push(Immediate(reinterpret_cast<int>(&__FILE_LINE__))); \ |
1532 masm->Call(x64_coverage_function, RelocInfo::EXTERNAL_REFERENCE); \ | 1549 masm->Call(x64_coverage_function, RelocInfo::EXTERNAL_REFERENCE); \ |
1533 masm->pop(rax); \ | 1550 masm->pop(rax); \ |
1534 masm->Popad(); \ | 1551 masm->Popad(); \ |
1535 masm->popfq(); \ | 1552 masm->popfq(); \ |
1536 } \ | 1553 } \ |
1537 masm-> | 1554 masm-> |
1538 #else | 1555 #else |
1539 #define ACCESS_MASM(masm) masm-> | 1556 #define ACCESS_MASM(masm) masm-> |
1540 #endif | 1557 #endif |
1541 | 1558 |
1542 } } // namespace v8::internal | 1559 } } // namespace v8::internal |
1543 | 1560 |
1544 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1561 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |