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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 } | 816 } |
817 | 817 |
818 // Load a global cell into a register. | 818 // Load a global cell into a register. |
819 void LoadGlobalCell(Register dst, Handle<Cell> cell); | 819 void LoadGlobalCell(Register dst, Handle<Cell> cell); |
820 | 820 |
821 // Emit code to discard a non-negative number of pointer-sized elements | 821 // Emit code to discard a non-negative number of pointer-sized elements |
822 // from the stack, clobbering only the rsp register. | 822 // from the stack, clobbering only the rsp register. |
823 void Drop(int stack_elements); | 823 void Drop(int stack_elements); |
824 | 824 |
825 void Call(Label* target) { call(target); } | 825 void Call(Label* target) { call(target); } |
826 void Push(Register src) { push(src); } | |
827 void Pop(Register dst) { pop(dst); } | |
828 void PushReturnAddressFrom(Register src) { push(src); } | |
829 void PopReturnAddressTo(Register dst) { pop(dst); } | |
830 | 826 |
831 // Control Flow | 827 // Control Flow |
832 void Jump(Address destination, RelocInfo::Mode rmode); | 828 void Jump(Address destination, RelocInfo::Mode rmode); |
833 void Jump(ExternalReference ext); | 829 void Jump(ExternalReference ext); |
834 void Jump(Handle<Code> code_object, RelocInfo::Mode rmode); | 830 void Jump(Handle<Code> code_object, RelocInfo::Mode rmode); |
835 | 831 |
836 void Call(Address destination, RelocInfo::Mode rmode); | 832 void Call(Address destination, RelocInfo::Mode rmode); |
837 void Call(ExternalReference ext); | 833 void Call(ExternalReference ext); |
838 void Call(Handle<Code> code_object, | 834 void Call(Handle<Code> code_object, |
839 RelocInfo::Mode rmode, | 835 RelocInfo::Mode rmode, |
840 TypeFeedbackId ast_id = TypeFeedbackId::None()); | 836 TypeFeedbackId ast_id = TypeFeedbackId::None()); |
841 | 837 |
842 // The size of the code generated for different call instructions. | 838 // The size of the code generated for different call instructions. |
843 int CallSize(Address destination, RelocInfo::Mode rmode) { | 839 int CallSize(Address destination, RelocInfo::Mode rmode) { |
844 return kCallSequenceLength; | 840 return kCallInstructionLength; |
845 } | 841 } |
846 int CallSize(ExternalReference ext); | 842 int CallSize(ExternalReference ext); |
847 int CallSize(Handle<Code> code_object) { | 843 int CallSize(Handle<Code> code_object) { |
848 // Code calls use 32-bit relative addressing. | 844 // Code calls use 32-bit relative addressing. |
849 return kShortCallInstructionLength; | 845 return kShortCallInstructionLength; |
850 } | 846 } |
851 int CallSize(Register target) { | 847 int CallSize(Register target) { |
852 // Opcode: REX_opt FF /2 m64 | 848 // Opcode: REX_opt FF /2 m64 |
853 return (target.high_bit() != 0) ? 3 : 2; | 849 return (target.high_bit() != 0) ? 3 : 2; |
854 } | 850 } |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 // Abort execution if argument is not a string, enabled via --debug-code. | 995 // Abort execution if argument is not a string, enabled via --debug-code. |
1000 void AssertString(Register object); | 996 void AssertString(Register object); |
1001 | 997 |
1002 // Abort execution if argument is not a name, enabled via --debug-code. | 998 // Abort execution if argument is not a name, enabled via --debug-code. |
1003 void AssertName(Register object); | 999 void AssertName(Register object); |
1004 | 1000 |
1005 // Abort execution if argument is not the root value with the given index, | 1001 // Abort execution if argument is not the root value with the given index, |
1006 // enabled via --debug-code. | 1002 // enabled via --debug-code. |
1007 void AssertRootValue(Register src, | 1003 void AssertRootValue(Register src, |
1008 Heap::RootListIndex root_value_index, | 1004 Heap::RootListIndex root_value_index, |
1009 BailoutReason reason); | 1005 const char* message); |
1010 | 1006 |
1011 // --------------------------------------------------------------------------- | 1007 // --------------------------------------------------------------------------- |
1012 // Exception handling | 1008 // Exception handling |
1013 | 1009 |
1014 // Push a new try handler and link it into try handler chain. | 1010 // Push a new try handler and link it into try handler chain. |
1015 void PushTryHandler(StackHandler::Kind kind, int handler_index); | 1011 void PushTryHandler(StackHandler::Kind kind, int handler_index); |
1016 | 1012 |
1017 // Unlink the stack handler on top of the stack from the try handler chain. | 1013 // Unlink the stack handler on top of the stack from the try handler chain. |
1018 void PopTryHandler(); | 1014 void PopTryHandler(); |
1019 | 1015 |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 void SetCounter(StatsCounter* counter, int value); | 1312 void SetCounter(StatsCounter* counter, int value); |
1317 void IncrementCounter(StatsCounter* counter, int value); | 1313 void IncrementCounter(StatsCounter* counter, int value); |
1318 void DecrementCounter(StatsCounter* counter, int value); | 1314 void DecrementCounter(StatsCounter* counter, int value); |
1319 | 1315 |
1320 | 1316 |
1321 // --------------------------------------------------------------------------- | 1317 // --------------------------------------------------------------------------- |
1322 // Debugging | 1318 // Debugging |
1323 | 1319 |
1324 // Calls Abort(msg) if the condition cc is not satisfied. | 1320 // Calls Abort(msg) if the condition cc is not satisfied. |
1325 // Use --debug_code to enable. | 1321 // Use --debug_code to enable. |
1326 void Assert(Condition cc, BailoutReason reason); | 1322 void Assert(Condition cc, const char* msg); |
1327 | 1323 |
1328 void AssertFastElements(Register elements); | 1324 void AssertFastElements(Register elements); |
1329 | 1325 |
1330 // Like Assert(), but always enabled. | 1326 // Like Assert(), but always enabled. |
1331 void Check(Condition cc, BailoutReason reason); | 1327 void Check(Condition cc, const char* msg); |
1332 | 1328 |
1333 // Print a message to stdout and abort execution. | 1329 // Print a message to stdout and abort execution. |
1334 void Abort(BailoutReason msg); | 1330 void Abort(const char* msg); |
1335 | 1331 |
1336 // Check that the stack is aligned. | 1332 // Check that the stack is aligned. |
1337 void CheckStackAlignment(); | 1333 void CheckStackAlignment(); |
1338 | 1334 |
1339 // Verify restrictions about code generated in stubs. | 1335 // Verify restrictions about code generated in stubs. |
1340 void set_generating_stub(bool value) { generating_stub_ = value; } | 1336 void set_generating_stub(bool value) { generating_stub_ = value; } |
1341 bool generating_stub() { return generating_stub_; } | 1337 bool generating_stub() { return generating_stub_; } |
1342 void set_allow_stub_calls(bool value) { allow_stub_calls_ = value; } | 1338 void set_allow_stub_calls(bool value) { allow_stub_calls_ = value; } |
1343 bool allow_stub_calls() { return allow_stub_calls_; } | 1339 bool allow_stub_calls() { return allow_stub_calls_; } |
1344 void set_has_frame(bool value) { has_frame_ = value; } | 1340 void set_has_frame(bool value) { has_frame_ = value; } |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1543 masm->popfq(); \ | 1539 masm->popfq(); \ |
1544 } \ | 1540 } \ |
1545 masm-> | 1541 masm-> |
1546 #else | 1542 #else |
1547 #define ACCESS_MASM(masm) masm-> | 1543 #define ACCESS_MASM(masm) masm-> |
1548 #endif | 1544 #endif |
1549 | 1545 |
1550 } } // namespace v8::internal | 1546 } } // namespace v8::internal |
1551 | 1547 |
1552 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1548 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |