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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 compare_string, disasm_buffer.start()); | 65 compare_string, disasm_buffer.start()); |
66 return false; | 66 return false; |
67 } | 67 } |
68 return true; | 68 return true; |
69 } | 69 } |
70 | 70 |
71 | 71 |
72 // Set up V8 to a state where we can at least run the assembler and | 72 // Set up V8 to a state where we can at least run the assembler and |
73 // disassembler. Declare the variables and allocate the data structures used | 73 // disassembler. Declare the variables and allocate the data structures used |
74 // in the rest of the macros. | 74 // in the rest of the macros. |
75 #define SET_UP() \ | 75 #define SET_UP() \ |
76 InitializeVM(); \ | 76 InitializeVM(); \ |
77 v8::HandleScope scope; \ | 77 Isolate* isolate = Isolate::Current(); \ |
| 78 HandleScope scope(isolate); \ |
78 byte *buffer = reinterpret_cast<byte*>(malloc(4*1024)); \ | 79 byte *buffer = reinterpret_cast<byte*>(malloc(4*1024)); \ |
79 Assembler assm(Isolate::Current(), buffer, 4*1024); \ | 80 Assembler assm(isolate, buffer, 4*1024); \ |
80 bool failure = false; | 81 bool failure = false; |
81 | 82 |
82 | 83 |
83 // This macro assembles one instruction using the preallocated assembler and | 84 // This macro assembles one instruction using the preallocated assembler and |
84 // disassembles the generated instruction, comparing the output to the expected | 85 // disassembles the generated instruction, comparing the output to the expected |
85 // value. If the comparison fails an error message is printed, but the test | 86 // value. If the comparison fails an error message is printed, but the test |
86 // continues to run until the end. | 87 // continues to run until the end. |
87 #define COMPARE(asm_, compare_string) \ | 88 #define COMPARE(asm_, compare_string) \ |
88 { \ | 89 { \ |
89 int pc_offset = assm.pc_offset(); \ | 90 int pc_offset = assm.pc_offset(); \ |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 COMPARE(strd(r8, r9, MemOperand(r9, -127, PostIndex)), | 862 COMPARE(strd(r8, r9, MemOperand(r9, -127, PostIndex)), |
862 "e04987ff strd r8, [r9], #-127"); | 863 "e04987ff strd r8, [r9], #-127"); |
863 COMPARE(strd(r10, fp, MemOperand(fp, 127, PreIndex)), | 864 COMPARE(strd(r10, fp, MemOperand(fp, 127, PreIndex)), |
864 "e1eba7ff strd r10, [fp, #+127]!"); | 865 "e1eba7ff strd r10, [fp, #+127]!"); |
865 COMPARE(strd(ip, sp, MemOperand(sp, -127, PreIndex)), | 866 COMPARE(strd(ip, sp, MemOperand(sp, -127, PreIndex)), |
866 "e16dc7ff strd ip, [sp, #-127]!"); | 867 "e16dc7ff strd ip, [sp, #-127]!"); |
867 } | 868 } |
868 | 869 |
869 VERIFY_RUN(); | 870 VERIFY_RUN(); |
870 } | 871 } |
OLD | NEW |