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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 __ nop(); | 388 __ nop(); |
389 | 389 |
390 __ fldcw(Operand(ebx, ecx, times_4, 10000)); | 390 __ fldcw(Operand(ebx, ecx, times_4, 10000)); |
391 __ fnstcw(Operand(ebx, ecx, times_4, 10000)); | 391 __ fnstcw(Operand(ebx, ecx, times_4, 10000)); |
392 __ fadd_d(Operand(ebx, ecx, times_4, 10000)); | 392 __ fadd_d(Operand(ebx, ecx, times_4, 10000)); |
393 __ fnsave(Operand(ebx, ecx, times_4, 10000)); | 393 __ fnsave(Operand(ebx, ecx, times_4, 10000)); |
394 __ frstor(Operand(ebx, ecx, times_4, 10000)); | 394 __ frstor(Operand(ebx, ecx, times_4, 10000)); |
395 | 395 |
396 // xchg. | 396 // xchg. |
397 { | 397 { |
| 398 __ xchg_b(eax, Operand(eax, 8)); |
| 399 __ xchg_w(eax, Operand(ebx, 8)); |
398 __ xchg(eax, eax); | 400 __ xchg(eax, eax); |
399 __ xchg(eax, ebx); | 401 __ xchg(eax, ebx); |
400 __ xchg(ebx, ebx); | 402 __ xchg(ebx, ebx); |
401 __ xchg(ebx, Operand(esp, 12)); | 403 __ xchg(ebx, Operand(esp, 12)); |
402 } | 404 } |
403 | 405 |
| 406 // cmpxchg. |
| 407 { |
| 408 __ cmpxchg_b(Operand(esp, 12), eax); |
| 409 __ cmpxchg_w(Operand(ebx, ecx, times_4, 10000), eax); |
| 410 __ cmpxchg(Operand(ebx, ecx, times_4, 10000), eax); |
| 411 } |
| 412 |
| 413 // lock prefix. |
| 414 { |
| 415 __ lock(); |
| 416 __ cmpxchg(Operand(esp, 12), ebx); |
| 417 |
| 418 __ lock(); |
| 419 __ xchg_w(eax, Operand(ecx, 8)); |
| 420 } |
| 421 |
404 // Nop instructions | 422 // Nop instructions |
405 for (int i = 0; i < 16; i++) { | 423 for (int i = 0; i < 16; i++) { |
406 __ Nop(i); | 424 __ Nop(i); |
407 } | 425 } |
408 | 426 |
409 __ ret(0); | 427 __ ret(0); |
410 | 428 |
411 CodeDesc desc; | 429 CodeDesc desc; |
412 assm.GetCode(&desc); | 430 assm.GetCode(&desc); |
413 Handle<Code> code = isolate->factory()->NewCode( | 431 Handle<Code> code = isolate->factory()->NewCode( |
414 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 432 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
415 USE(code); | 433 USE(code); |
416 #ifdef OBJECT_PRINT | 434 #ifdef OBJECT_PRINT |
417 OFStream os(stdout); | 435 OFStream os(stdout); |
418 code->Print(os); | 436 code->Print(os); |
419 byte* begin = code->instruction_start(); | 437 byte* begin = code->instruction_start(); |
420 byte* end = begin + code->instruction_size(); | 438 byte* end = begin + code->instruction_size(); |
421 disasm::Disassembler::Disassemble(stdout, begin, end); | 439 disasm::Disassembler::Disassemble(stdout, begin, end); |
422 #endif | 440 #endif |
423 } | 441 } |
424 | 442 |
425 #undef __ | 443 #undef __ |
OLD | NEW |