OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 void Jump(Address destination, RelocInfo::Mode rmode); | 169 void Jump(Address destination, RelocInfo::Mode rmode); |
170 void Jump(ExternalReference ext); | 170 void Jump(ExternalReference ext); |
171 void Jump(Handle<Code> code_object, RelocInfo::Mode rmode); | 171 void Jump(Handle<Code> code_object, RelocInfo::Mode rmode); |
172 | 172 |
173 void Call(Address destination, RelocInfo::Mode rmode); | 173 void Call(Address destination, RelocInfo::Mode rmode); |
174 void Call(ExternalReference ext); | 174 void Call(ExternalReference ext); |
175 void Call(Handle<Code> code_object, RelocInfo::Mode rmode); | 175 void Call(Handle<Code> code_object, RelocInfo::Mode rmode); |
176 | 176 |
177 // Compare object type for heap object. | 177 // Compare object type for heap object. |
178 // Incoming register is heap_object and outgoing register is map. | 178 // Incoming register is heap_object and outgoing register is map. |
| 179 // They may be the same register, and may be kScratchRegister. |
179 void CmpObjectType(Register heap_object, InstanceType type, Register map); | 180 void CmpObjectType(Register heap_object, InstanceType type, Register map); |
180 | 181 |
181 // Compare instance type for map. | 182 // Compare instance type for map. |
182 void CmpInstanceType(Register map, InstanceType type); | 183 void CmpInstanceType(Register map, InstanceType type); |
183 | 184 |
184 // FCmp is similar to integer cmp, but requires unsigned | 185 // FCmp is similar to integer cmp, but requires unsigned |
185 // jcc instructions (je, ja, jae, jb, jbe, je, and jz). | 186 // jcc instructions (je, ja, jae, jb, jbe, je, and jz). |
186 void FCmp(); | 187 void FCmp(); |
187 | 188 |
188 // --------------------------------------------------------------------------- | 189 // --------------------------------------------------------------------------- |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 JumpTarget* then_target); | 231 JumpTarget* then_target); |
231 | 232 |
232 // Check if result is zero and any of op1 and op2 are negative. | 233 // Check if result is zero and any of op1 and op2 are negative. |
233 // Register scratch is destroyed, and it must be different from op2. | 234 // Register scratch is destroyed, and it must be different from op2. |
234 void NegativeZeroTest(Register result, Register op1, Register op2, | 235 void NegativeZeroTest(Register result, Register op1, Register op2, |
235 Register scratch, Label* then_label); | 236 Register scratch, Label* then_label); |
236 | 237 |
237 // Try to get function prototype of a function and puts the value in | 238 // Try to get function prototype of a function and puts the value in |
238 // the result register. Checks that the function really is a | 239 // the result register. Checks that the function really is a |
239 // function and jumps to the miss label if the fast checks fail. The | 240 // function and jumps to the miss label if the fast checks fail. The |
240 // function register will be untouched; the other registers may be | 241 // function register will be untouched; the other register may be |
241 // clobbered. | 242 // clobbered. |
242 void TryGetFunctionPrototype(Register function, | 243 void TryGetFunctionPrototype(Register function, |
243 Register result, | 244 Register result, |
244 Register scratch, | |
245 Label* miss); | 245 Label* miss); |
246 | 246 |
247 // Generates code for reporting that an illegal operation has | 247 // Generates code for reporting that an illegal operation has |
248 // occurred. | 248 // occurred. |
249 void IllegalOperation(int num_arguments); | 249 void IllegalOperation(int num_arguments); |
250 | 250 |
251 // --------------------------------------------------------------------------- | 251 // --------------------------------------------------------------------------- |
252 // Runtime calls | 252 // Runtime calls |
253 | 253 |
254 // Call a code stub. | 254 // Call a code stub. |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 return Operand(object, index, scale, offset - kHeapObjectTag); | 377 return Operand(object, index, scale, offset - kHeapObjectTag); |
378 } | 378 } |
379 | 379 |
380 | 380 |
381 #ifdef GENERATED_CODE_COVERAGE | 381 #ifdef GENERATED_CODE_COVERAGE |
382 extern void LogGeneratedCodeCoverage(const char* file_line); | 382 extern void LogGeneratedCodeCoverage(const char* file_line); |
383 #define CODE_COVERAGE_STRINGIFY(x) #x | 383 #define CODE_COVERAGE_STRINGIFY(x) #x |
384 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 384 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
385 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 385 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
386 #define ACCESS_MASM(masm) { \ | 386 #define ACCESS_MASM(masm) { \ |
387 byte* x64_coverage_function = \ | 387 byte* x64_coverage_function = \ |
388 reinterpret_cast<byte*>(FUNCTION_ADDR(LogGeneratedCodeCoverage)); \ | 388 reinterpret_cast<byte*>(FUNCTION_ADDR(LogGeneratedCodeCoverage)); \ |
389 masm->pushfd(); \ | 389 masm->pushfd(); \ |
390 masm->pushad(); \ | 390 masm->pushad(); \ |
391 masm->push(Immediate(reinterpret_cast<int>(&__FILE_LINE__))); \ | 391 masm->push(Immediate(reinterpret_cast<int>(&__FILE_LINE__))); \ |
392 masm->call(x64_coverage_function, RelocInfo::RUNTIME_ENTRY); \ | 392 masm->call(x64_coverage_function, RelocInfo::RUNTIME_ENTRY); \ |
393 masm->pop(rax); \ | 393 masm->pop(rax); \ |
394 masm->popad(); \ | 394 masm->popad(); \ |
395 masm->popfd(); \ | 395 masm->popfd(); \ |
396 } \ | 396 } \ |
397 masm-> | 397 masm-> |
398 #else | 398 #else |
399 #define ACCESS_MASM(masm) masm-> | 399 #define ACCESS_MASM(masm) masm-> |
400 #endif | 400 #endif |
401 | 401 |
402 | 402 |
403 } } // namespace v8::internal | 403 } } // namespace v8::internal |
404 | 404 |
405 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 405 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |