Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(481)

Side by Side Diff: src/x87/assembler-x87.cc

Issue 978183002: X87: Refactor BreakLocationIterator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/x87/debug-x87.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // code object moves. 95 // code object moves.
96 return (1 << rmode_) & kApplyMask; 96 return (1 << rmode_) & kApplyMask;
97 } 97 }
98 98
99 99
100 bool RelocInfo::IsInConstantPool() { 100 bool RelocInfo::IsInConstantPool() {
101 return false; 101 return false;
102 } 102 }
103 103
104 104
105 // Patch the code at the current PC with a call to the target address.
106 // Additional guard int3 instructions can be added if required.
107 void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) {
108 // Call instruction takes up 5 bytes and int3 takes up one byte.
109 static const int kCallCodeSize = 5;
110 int code_size = kCallCodeSize + guard_bytes;
111
112 // Create a code patcher.
113 CodePatcher patcher(pc_, code_size);
114
115 // Add a label for checking the size of the code used for returning.
116 #ifdef DEBUG
117 Label check_codesize;
118 patcher.masm()->bind(&check_codesize);
119 #endif
120
121 // Patch the code.
122 patcher.masm()->call(target, RelocInfo::NONE32);
123
124 // Check that the size of the code generated is as expected.
125 DCHECK_EQ(kCallCodeSize,
126 patcher.masm()->SizeOfCodeGeneratedSince(&check_codesize));
127
128 // Add the requested number of int3 instructions after the call.
129 DCHECK_GE(guard_bytes, 0);
130 for (int i = 0; i < guard_bytes; i++) {
131 patcher.masm()->int3();
132 }
133 }
134
135
105 // ----------------------------------------------------------------------------- 136 // -----------------------------------------------------------------------------
106 // Implementation of Operand 137 // Implementation of Operand
107 138
108 Operand::Operand(Register base, int32_t disp, RelocInfo::Mode rmode) { 139 Operand::Operand(Register base, int32_t disp, RelocInfo::Mode rmode) {
109 // [base + disp/r] 140 // [base + disp/r]
110 if (disp == 0 && RelocInfo::IsNone(rmode) && !base.is(ebp)) { 141 if (disp == 0 && RelocInfo::IsNone(rmode) && !base.is(ebp)) {
111 // [base] 142 // [base]
112 set_modrm(0, base); 143 set_modrm(0, base);
113 if (base.is(esp)) set_sib(times_1, esp, base); 144 if (base.is(esp)) set_sib(times_1, esp, base);
114 } else if (is_int8(disp) && RelocInfo::IsNone(rmode)) { 145 } else if (is_int8(disp) && RelocInfo::IsNone(rmode)) {
(...skipping 1937 matching lines...) Expand 10 before | Expand all | Expand 10 after
2052 fprintf(coverage_log, "%s\n", file_line); 2083 fprintf(coverage_log, "%s\n", file_line);
2053 fflush(coverage_log); 2084 fflush(coverage_log);
2054 } 2085 }
2055 } 2086 }
2056 2087
2057 #endif 2088 #endif
2058 2089
2059 } } // namespace v8::internal 2090 } } // namespace v8::internal
2060 2091
2061 #endif // V8_TARGET_ARCH_X87 2092 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « no previous file | src/x87/debug-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698