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

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

Issue 1476763002: Make whether or not a Code object should be created by masm explicit (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years 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
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 #define BUF_SIZE 8192 111 #define BUF_SIZE 8192
112 #define SETUP() SETUP_SIZE(BUF_SIZE) 112 #define SETUP() SETUP_SIZE(BUF_SIZE)
113 113
114 #define INIT_V8() \ 114 #define INIT_V8() \
115 CcTest::InitializeVM(); \ 115 CcTest::InitializeVM(); \
116 116
117 #ifdef USE_SIMULATOR 117 #ifdef USE_SIMULATOR
118 118
119 // Run tests with the simulator. 119 // Run tests with the simulator.
120 #define SETUP_SIZE(buf_size) \ 120 #define SETUP_SIZE(buf_size) \
121 Isolate* isolate = CcTest::i_isolate(); \ 121 Isolate* isolate = CcTest::i_isolate(); \
122 HandleScope scope(isolate); \ 122 HandleScope scope(isolate); \
123 DCHECK(isolate != NULL); \ 123 DCHECK(isolate != NULL); \
124 byte* buf = new byte[buf_size]; \ 124 byte* buf = new byte[buf_size]; \
125 MacroAssembler masm(isolate, buf, buf_size); \ 125 MacroAssembler masm(isolate, buf, buf_size, true); \
126 Decoder<DispatchingDecoderVisitor>* decoder = \ 126 Decoder<DispatchingDecoderVisitor>* decoder = \
127 new Decoder<DispatchingDecoderVisitor>(); \ 127 new Decoder<DispatchingDecoderVisitor>(); \
128 Simulator simulator(decoder); \ 128 Simulator simulator(decoder); \
129 PrintDisassembler* pdis = NULL; \ 129 PrintDisassembler* pdis = NULL; \
130 RegisterDump core; 130 RegisterDump core;
131 131
132 /* if (Cctest::trace_sim()) { \ 132 /* if (Cctest::trace_sim()) { \
133 pdis = new PrintDisassembler(stdout); \ 133 pdis = new PrintDisassembler(stdout); \
134 decoder.PrependVisitor(pdis); \ 134 decoder.PrependVisitor(pdis); \
135 } \ 135 } \
136 */ 136 */
137 137
138 // Reset the assembler and simulator, so that instructions can be generated, 138 // Reset the assembler and simulator, so that instructions can be generated,
139 // but don't actually emit any code. This can be used by tests that need to 139 // but don't actually emit any code. This can be used by tests that need to
(...skipping 24 matching lines...) Expand all
164 __ PopCalleeSavedRegisters(); \ 164 __ PopCalleeSavedRegisters(); \
165 __ Ret(); \ 165 __ Ret(); \
166 __ GetCode(NULL); 166 __ GetCode(NULL);
167 167
168 #define TEARDOWN() \ 168 #define TEARDOWN() \
169 delete pdis; \ 169 delete pdis; \
170 delete[] buf; 170 delete[] buf;
171 171
172 #else // ifdef USE_SIMULATOR. 172 #else // ifdef USE_SIMULATOR.
173 // Run the test on real hardware or models. 173 // Run the test on real hardware or models.
174 #define SETUP_SIZE(buf_size) \ 174 #define SETUP_SIZE(buf_size) \
175 Isolate* isolate = CcTest::i_isolate(); \ 175 Isolate* isolate = CcTest::i_isolate(); \
176 HandleScope scope(isolate); \ 176 HandleScope scope(isolate); \
177 DCHECK(isolate != NULL); \ 177 DCHECK(isolate != NULL); \
178 byte* buf = new byte[buf_size]; \ 178 byte* buf = new byte[buf_size]; \
179 MacroAssembler masm(isolate, buf, buf_size); \ 179 MacroAssembler masm(isolate, buf, buf_size, true); \
180 RegisterDump core; 180 RegisterDump core;
181 181
182 #define RESET() \ 182 #define RESET() \
183 __ Reset(); \ 183 __ Reset(); \
184 /* Reset the machine state (like simulator.ResetState()). */ \ 184 /* Reset the machine state (like simulator.ResetState()). */ \
185 __ Msr(NZCV, xzr); \ 185 __ Msr(NZCV, xzr); \
186 __ Msr(FPCR, xzr); 186 __ Msr(FPCR, xzr);
187 187
188 188
189 #define START_AFTER_RESET() \ 189 #define START_AFTER_RESET() \
(...skipping 11145 matching lines...) Expand 10 before | Expand all | Expand 10 after
11335 __ Mov(x0, 1); 11335 __ Mov(x0, 1);
11336 11336
11337 END(); 11337 END();
11338 11338
11339 RUN(); 11339 RUN();
11340 11340
11341 CHECK_EQUAL_64(0x1, x0); 11341 CHECK_EQUAL_64(0x1, x0);
11342 11342
11343 TEARDOWN(); 11343 TEARDOWN();
11344 } 11344 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698