v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
test-disasm-arm64.cc File Reference
#include <stdio.h>
#include <cstring>
#include "cctest.h"
#include "v8.h"
#include "macro-assembler.h"
#include "arm64/assembler-arm64.h"
#include "arm64/macro-assembler-arm64.h"
#include "arm64/decoder-arm64-inl.h"
#include "arm64/disasm-arm64.h"
#include "arm64/utils-arm64.h"
Include dependency graph for test-disasm-arm64.cc:

Go to the source code of this file.

Macros

#define TEST_(name)   TEST(DISASM_##name)
 
#define EXP_SIZE   (256)
 
#define INSTR_SIZE   (1024)
 
#define SET_UP_CLASS(ASMCLASS)
 
#define SET_UP()   SET_UP_CLASS(Assembler)
 
#define COMPARE(ASM, EXP)
 
#define COMPARE_PREFIX(ASM, EXP)
 
#define CLEANUP()
 
#define RESULT_SIZE   (256)
 
#define INST_OFF(x)   ((x) >> kInstructionSizeLog2)
 

Functions

 TEST_ (bootstrap)
 
 TEST_ (mov_mvn)
 
 TEST_ (move_immediate)
 
 TEST (move_immediate_2)
 
 TEST_ (add_immediate)
 
 TEST_ (sub_immediate)
 
 TEST_ (add_shifted)
 
 TEST_ (sub_shifted)
 
 TEST_ (add_extended)
 
 TEST_ (sub_extended)
 
 TEST_ (adc_subc_ngc)
 
 TEST_ (mul_and_div)
 
 TEST (maddl_msubl)
 
 TEST_ (dp_1_source)
 
 TEST_ (bitfield)
 
 TEST_ (extract)
 
 TEST_ (logical_immediate)
 
 TEST_ (logical_shifted)
 
 TEST_ (dp_2_source)
 
 TEST_ (adr)
 
 TEST_ (branch)
 
 TEST_ (load_store)
 
 TEST_ (load_store_regoffset)
 
 TEST_ (load_store_byte)
 
 TEST_ (load_store_half)
 
 TEST_ (load_store_fp)
 
 TEST_ (load_store_unscaled)
 
 TEST_ (load_store_pair)
 
 TEST_ (load_store_pair_nontemp)
 
 TEST_ (cond_select)
 
 TEST (cond_select_macro)
 
 TEST_ (cond_cmp)
 
 TEST_ (cond_cmp_macro)
 
 TEST_ (fmov_imm)
 
 TEST_ (fmov_reg)
 
 TEST_ (fp_dp1)
 
 TEST_ (fp_dp2)
 
 TEST (fp_dp3)
 
 TEST_ (fp_compare)
 
 TEST_ (fp_cond_compare)
 
 TEST_ (fp_select)
 
 TEST_ (fcvt_scvtf_ucvtf)
 
 TEST_ (system_mrs)
 
 TEST_ (system_msr)
 
 TEST_ (system_nop)
 
 TEST_ (debug)
 
 TEST_ (hlt)
 
 TEST_ (brk)
 
 TEST_ (add_sub_negative)
 
 TEST_ (logical_immediate_move)
 
 TEST_ (barriers)
 

Macro Definition Documentation

#define CLEANUP ( )
Value:
delete disasm; \
delete decoder; \
delete assm

Definition at line 85 of file test-disasm-arm64.cc.

Referenced by TEST(), and TEST_().

#define COMPARE (   ASM,
  EXP 
)
Value:
assm->Reset(); \
assm->ASM; \
assm->GetCode(NULL); \
decoder->Decode(reinterpret_cast<Instruction*>(buf)); \
encoding = *reinterpret_cast<uint32_t*>(buf); \
if (strcmp(disasm->GetOutput(), EXP) != 0) { \
printf("%u : Encoding: %08" PRIx32 "\nExpected: %s\nFound: %s\n", \
__LINE__, encoding, EXP, disasm->GetOutput()); \
abort(); \
}
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL

Definition at line 61 of file test-disasm-arm64.cc.

Referenced by TEST(), and TEST_().

#define COMPARE_PREFIX (   ASM,
  EXP 
)
Value:
assm->Reset(); \
assm->ASM; \
assm->GetCode(NULL); \
decoder->Decode(reinterpret_cast<Instruction*>(buf)); \
encoding = *reinterpret_cast<uint32_t*>(buf); \
if (strncmp(disasm->GetOutput(), EXP, strlen(EXP)) != 0) { \
printf("%u : Encoding: %08" PRIx32 "\nExpected: %s\nFound: %s\n", \
__LINE__, encoding, EXP, disasm->GetOutput()); \
abort(); \
}
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL

Definition at line 73 of file test-disasm-arm64.cc.

Referenced by TEST_().

#define EXP_SIZE   (256)

Definition at line 45 of file test-disasm-arm64.cc.

#define INST_OFF (   x)    ((x) >> kInstructionSizeLog2)

Referenced by TEST_().

#define INSTR_SIZE   (1024)

Definition at line 46 of file test-disasm-arm64.cc.

#define RESULT_SIZE   (256)

Referenced by TEST_().

#define SET_UP ( )    SET_UP_CLASS(Assembler)

Definition at line 59 of file test-disasm-arm64.cc.

Referenced by TEST(), and TEST_().

#define SET_UP_CLASS (   ASMCLASS)
Value:
InitializeVM(); \
Isolate* isolate = Isolate::Current(); \
HandleScope scope(isolate); \
byte* buf = static_cast<byte*>(malloc(INSTR_SIZE)); \
uint32_t encoding = 0; \
ASMCLASS* assm = new ASMCLASS(isolate, buf, INSTR_SIZE); \
Decoder<DispatchingDecoderVisitor>* decoder = \
Disassembler* disasm = new Disassembler(); \
decoder->AppendVisitor(disasm)
unsigned char byte
Definition: disasm.h:33
#define INSTR_SIZE
uint8_t byte
Definition: globals.h:185

Definition at line 47 of file test-disasm-arm64.cc.

Referenced by TEST(), and TEST_().

#define TEST_ (   name)    TEST(DISASM_##name)

Definition at line 43 of file test-disasm-arm64.cc.

Function Documentation

TEST ( move_immediate_2  )

Definition at line 203 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE, and SET_UP_CLASS.

TEST ( maddl_msubl  )

Definition at line 478 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE, and SET_UP.

TEST_ ( bootstrap  )

Definition at line 102 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE, and SET_UP.

TEST_ ( move_immediate  )

Definition at line 166 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE, and SET_UP.

TEST_ ( add_immediate  )

Definition at line 259 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE, and SET_UP.

TEST_ ( sub_immediate  )

Definition at line 289 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE, and SET_UP.

TEST_ ( add_shifted  )
TEST_ ( sub_shifted  )
TEST_ ( adc_subc_ngc  )

Definition at line 425 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE, v8::internal::cp, v8::internal::lr, and SET_UP.

TEST_ ( mul_and_div  )

Definition at line 445 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE, v8::internal::lr, and SET_UP.

TEST_ ( dp_1_source  )

Definition at line 495 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE, and SET_UP.

TEST_ ( bitfield  )

Definition at line 514 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE, v8::internal::cp, v8::internal::lr, and SET_UP.

TEST_ ( extract  )

Definition at line 556 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE, and SET_UP.

TEST_ ( logical_immediate  )

Definition at line 570 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE, v8::internal::fp, v8::internal::L, RESULT_SIZE, and SET_UP.

TEST_ ( logical_shifted  )
TEST_ ( dp_2_source  )

Definition at line 766 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE, and SET_UP.

TEST_ ( adr  )

Definition at line 782 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE_PREFIX, and SET_UP.

TEST_ ( branch  )
TEST_ ( load_store  )
TEST_ ( load_store_regoffset  )
TEST_ ( load_store_byte  )
TEST_ ( load_store_half  )
TEST_ ( load_store_unscaled  )
TEST_ ( fmov_imm  )
TEST_ ( system_mrs  )
TEST_ ( system_msr  )

Definition at line 1581 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE, v8::internal::FPCR, v8::internal::NZCV, and SET_UP.

TEST_ ( system_nop  )

Definition at line 1592 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE, and SET_UP.

TEST_ ( debug  )
TEST_ ( hlt  )

Definition at line 1620 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE, and SET_UP.

TEST_ ( brk  )

Definition at line 1631 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE, and SET_UP.

TEST_ ( add_sub_negative  )

Definition at line 1642 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE, and SET_UP_CLASS.

TEST_ ( logical_immediate_move  )

Definition at line 1673 of file test-disasm-arm64.cc.

References CLEANUP, COMPARE, and SET_UP_CLASS.