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

Side by Side Diff: test/cctest/test-disasm-arm64.cc

Issue 1431933003: [assembler] Introduce proper AssemblerBase::Print() for improved debuggability. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | « src/x64/assembler-x64.h ('k') | test/cctest/test-fuzz-arm64.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 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
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
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 }
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.h ('k') | test/cctest/test-fuzz-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698