| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 27 matching lines...) Expand all Loading... |
| 38 #include "src/arm64/disasm-arm64.h" | 38 #include "src/arm64/disasm-arm64.h" |
| 39 #include "src/arm64/macro-assembler-arm64.h" | 39 #include "src/arm64/macro-assembler-arm64.h" |
| 40 #include "src/arm64/utils-arm64.h" | 40 #include "src/arm64/utils-arm64.h" |
| 41 | 41 |
| 42 using namespace v8::internal; | 42 using namespace v8::internal; |
| 43 | 43 |
| 44 #define TEST_(name) TEST(DISASM_##name) | 44 #define TEST_(name) TEST(DISASM_##name) |
| 45 | 45 |
| 46 #define EXP_SIZE (256) | 46 #define EXP_SIZE (256) |
| 47 #define INSTR_SIZE (1024) | 47 #define INSTR_SIZE (1024) |
| 48 #define SET_UP_CLASS(ASMCLASS) \ | 48 #define SET_UP_CLASS(ASMCLASS) \ |
| 49 InitializeVM(); \ | 49 InitializeVM(); \ |
| 50 Isolate* isolate = Isolate::Current(); \ | 50 Isolate* isolate = Isolate::Current(); \ |
| 51 HandleScope scope(isolate); \ | 51 HandleScope scope(isolate); \ |
| 52 byte* buf = static_cast<byte*>(malloc(INSTR_SIZE)); \ | 52 byte* buf = static_cast<byte*>(malloc(INSTR_SIZE)); \ |
| 53 uint32_t encoding = 0; \ | 53 uint32_t encoding = 0; \ |
| 54 ASMCLASS* assm = new ASMCLASS(isolate, buf, INSTR_SIZE); \ | 54 ASMCLASS* assm = new ASMCLASS(isolate, buf, INSTR_SIZE); \ |
| 55 Decoder<DispatchingDecoderVisitor>* decoder = \ | 55 Decoder<DispatchingDecoderVisitor>* decoder = \ |
| 56 new Decoder<DispatchingDecoderVisitor>(); \ | 56 new Decoder<DispatchingDecoderVisitor>(); \ |
| 57 Disassembler* disasm = new Disassembler(); \ | 57 DisassemblingDecoder* disasm = new DisassemblingDecoder(); \ |
| 58 decoder->AppendVisitor(disasm) | 58 decoder->AppendVisitor(disasm) |
| 59 | 59 |
| 60 #define SET_UP() SET_UP_CLASS(Assembler) | 60 #define SET_UP() SET_UP_CLASS(Assembler) |
| 61 | 61 |
| 62 #define COMPARE(ASM, EXP) \ | 62 #define COMPARE(ASM, EXP) \ |
| 63 assm->Reset(); \ | 63 assm->Reset(); \ |
| 64 assm->ASM; \ | 64 assm->ASM; \ |
| 65 assm->GetCode(NULL); \ | 65 assm->GetCode(NULL); \ |
| 66 decoder->Decode(reinterpret_cast<Instruction*>(buf)); \ | 66 decoder->Decode(reinterpret_cast<Instruction*>(buf)); \ |
| 67 encoding = *reinterpret_cast<uint32_t*>(buf); \ | 67 encoding = *reinterpret_cast<uint32_t*>(buf); \ |
| (...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1741 COMPARE(Dsb(FullSystem, BarrierOther), "dsb sy (0b1100)"); | 1741 COMPARE(Dsb(FullSystem, BarrierOther), "dsb sy (0b1100)"); |
| 1742 COMPARE(Dsb(InnerShareable, BarrierOther), "dsb sy (0b1000)"); | 1742 COMPARE(Dsb(InnerShareable, BarrierOther), "dsb sy (0b1000)"); |
| 1743 COMPARE(Dsb(NonShareable, BarrierOther), "dsb sy (0b0100)"); | 1743 COMPARE(Dsb(NonShareable, BarrierOther), "dsb sy (0b0100)"); |
| 1744 COMPARE(Dsb(OuterShareable, BarrierOther), "dsb sy (0b0000)"); | 1744 COMPARE(Dsb(OuterShareable, BarrierOther), "dsb sy (0b0000)"); |
| 1745 | 1745 |
| 1746 // ISB | 1746 // ISB |
| 1747 COMPARE(Isb(), "isb"); | 1747 COMPARE(Isb(), "isb"); |
| 1748 | 1748 |
| 1749 CLEANUP(); | 1749 CLEANUP(); |
| 1750 } | 1750 } |
| OLD | NEW |