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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 | 435 |
436 __ psrlq(xmm0, xmm1); | 436 __ psrlq(xmm0, xmm1); |
437 __ psrlq(xmm1, xmm2); | 437 __ psrlq(xmm1, xmm2); |
438 | 438 |
439 __ por(xmm0, xmm1); | 439 __ por(xmm0, xmm1); |
440 __ por(xmm1, xmm2); | 440 __ por(xmm1, xmm2); |
441 } | 441 } |
442 } | 442 } |
443 | 443 |
444 { | 444 { |
445 if (CpuFeatures::IsSupported(SSE4_1)) { | 445 if (CpuFeatures::IsSupported(SSE2) && |
| 446 CpuFeatures::IsSupported(SSE4_1)) { |
446 CpuFeatures::Scope scope(SSE4_1); | 447 CpuFeatures::Scope scope(SSE4_1); |
447 __ pextrd(eax, xmm0, 1); | 448 __ pextrd(eax, xmm0, 1); |
448 __ pinsrd(xmm1, eax, 0); | 449 __ pinsrd(xmm1, eax, 0); |
449 } | 450 } |
450 } | 451 } |
451 | 452 |
452 // Nop instructions | 453 // Nop instructions |
453 for (int i = 0; i < 16; i++) { | 454 for (int i = 0; i < 16; i++) { |
454 __ Nop(i); | 455 __ Nop(i); |
455 } | 456 } |
456 | 457 |
457 __ ret(0); | 458 __ ret(0); |
458 | 459 |
459 CodeDesc desc; | 460 CodeDesc desc; |
460 assm.GetCode(&desc); | 461 assm.GetCode(&desc); |
461 Object* code = HEAP->CreateCode( | 462 Object* code = HEAP->CreateCode( |
462 desc, | 463 desc, |
463 Code::ComputeFlags(Code::STUB), | 464 Code::ComputeFlags(Code::STUB), |
464 Handle<Object>(HEAP->undefined_value()))->ToObjectChecked(); | 465 Handle<Object>(HEAP->undefined_value()))->ToObjectChecked(); |
465 CHECK(code->IsCode()); | 466 CHECK(code->IsCode()); |
466 #ifdef OBJECT_PRINT | 467 #ifdef OBJECT_PRINT |
467 Code::cast(code)->Print(); | 468 Code::cast(code)->Print(); |
468 byte* begin = Code::cast(code)->instruction_start(); | 469 byte* begin = Code::cast(code)->instruction_start(); |
469 byte* end = begin + Code::cast(code)->instruction_size(); | 470 byte* end = begin + Code::cast(code)->instruction_size(); |
470 disasm::Disassembler::Disassemble(stdout, begin, end); | 471 disasm::Disassembler::Disassemble(stdout, begin, end); |
471 #endif | 472 #endif |
472 } | 473 } |
473 | 474 |
474 #undef __ | 475 #undef __ |
OLD | NEW |