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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 __ PushCalleeSavedRegisters(); \ | 153 __ PushCalleeSavedRegisters(); \ |
154 __ Debug("Start test.", __LINE__, TRACE_ENABLE | LOG_ALL); | 154 __ Debug("Start test.", __LINE__, TRACE_ENABLE | LOG_ALL); |
155 | 155 |
156 #define START() \ | 156 #define START() \ |
157 RESET(); \ | 157 RESET(); \ |
158 START_AFTER_RESET(); | 158 START_AFTER_RESET(); |
159 | 159 |
160 #define RUN() \ | 160 #define RUN() \ |
161 simulator.RunFrom(reinterpret_cast<Instruction*>(buf)) | 161 simulator.RunFrom(reinterpret_cast<Instruction*>(buf)) |
162 | 162 |
163 #define END() \ | 163 #define END() \ |
164 __ Debug("End test.", __LINE__, TRACE_DISABLE | LOG_ALL); \ | 164 __ Debug("End test.", __LINE__, TRACE_DISABLE | LOG_ALL); \ |
165 core.Dump(&masm); \ | 165 core.Dump(&masm); \ |
166 __ PopCalleeSavedRegisters(); \ | 166 __ PopCalleeSavedRegisters(); \ |
167 __ Ret(); \ | 167 __ Ret(); \ |
168 __ GetCode(NULL); | 168 __ GetCode(masm.isolate(), NULL); |
169 | 169 |
170 #define TEARDOWN() \ | 170 #define TEARDOWN() \ |
171 delete pdis; \ | 171 delete pdis; \ |
172 delete[] buf; | 172 delete[] buf; |
173 | 173 |
174 #else // ifdef USE_SIMULATOR. | 174 #else // ifdef USE_SIMULATOR. |
175 // Run the test on real hardware or models. | 175 // Run the test on real hardware or models. |
176 #define SETUP_SIZE(buf_size) \ | 176 #define SETUP_SIZE(buf_size) \ |
177 Isolate* isolate = CcTest::i_isolate(); \ | 177 Isolate* isolate = CcTest::i_isolate(); \ |
178 HandleScope scope(isolate); \ | 178 HandleScope scope(isolate); \ |
(...skipping 21 matching lines...) Expand all Loading... |
200 START_AFTER_RESET(); | 200 START_AFTER_RESET(); |
201 | 201 |
202 #define RUN() \ | 202 #define RUN() \ |
203 Assembler::FlushICache(isolate, buf, masm.SizeOfGeneratedCode()); \ | 203 Assembler::FlushICache(isolate, buf, masm.SizeOfGeneratedCode()); \ |
204 { \ | 204 { \ |
205 void (*test_function)(void); \ | 205 void (*test_function)(void); \ |
206 memcpy(&test_function, &buf, sizeof(buf)); \ | 206 memcpy(&test_function, &buf, sizeof(buf)); \ |
207 test_function(); \ | 207 test_function(); \ |
208 } | 208 } |
209 | 209 |
210 #define END() \ | 210 #define END() \ |
211 core.Dump(&masm); \ | 211 core.Dump(&masm); \ |
212 __ PopCalleeSavedRegisters(); \ | 212 __ PopCalleeSavedRegisters(); \ |
213 __ Ret(); \ | 213 __ Ret(); \ |
214 __ GetCode(NULL); | 214 __ GetCode(masm.isolate(), NULL); |
215 | 215 |
216 #define TEARDOWN() \ | 216 #define TEARDOWN() \ |
217 v8::base::OS::Free(buf, actual_size); | 217 v8::base::OS::Free(buf, actual_size); |
218 | 218 |
219 #endif // ifdef USE_SIMULATOR. | 219 #endif // ifdef USE_SIMULATOR. |
220 | 220 |
221 #define CHECK_EQUAL_NZCV(expected) \ | 221 #define CHECK_EQUAL_NZCV(expected) \ |
222 CHECK(EqualNzcv(expected, core.flags_nzcv())) | 222 CHECK(EqualNzcv(expected, core.flags_nzcv())) |
223 | 223 |
224 #define CHECK_EQUAL_REGISTERS(expected) \ | 224 #define CHECK_EQUAL_REGISTERS(expected) \ |
(...skipping 11104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11329 | 11329 |
11330 __ RecordVeneerPool(masm.pc_offset(), veneer_pool_size); | 11330 __ RecordVeneerPool(masm.pc_offset(), veneer_pool_size); |
11331 for (unsigned i = 0; i < veneer_pool_size / kInstructionSize; ++i) { | 11331 for (unsigned i = 0; i < veneer_pool_size / kInstructionSize; ++i) { |
11332 __ nop(); | 11332 __ nop(); |
11333 } | 11333 } |
11334 | 11334 |
11335 __ bind(&exit); | 11335 __ bind(&exit); |
11336 | 11336 |
11337 HandleScope handle_scope(isolate); | 11337 HandleScope handle_scope(isolate); |
11338 CodeDesc desc; | 11338 CodeDesc desc; |
11339 masm.GetCode(&desc); | 11339 masm.GetCode(isolate, &desc); |
11340 Handle<Code> code = isolate->factory()->NewCode(desc, 0, masm.CodeObject()); | 11340 Handle<Code> code = isolate->factory()->NewCode(desc, 0, masm.CodeObject()); |
11341 | 11341 |
11342 unsigned pool_count = 0; | 11342 unsigned pool_count = 0; |
11343 int pool_mask = RelocInfo::ModeMask(RelocInfo::CONST_POOL) | | 11343 int pool_mask = RelocInfo::ModeMask(RelocInfo::CONST_POOL) | |
11344 RelocInfo::ModeMask(RelocInfo::VENEER_POOL); | 11344 RelocInfo::ModeMask(RelocInfo::VENEER_POOL); |
11345 for (RelocIterator it(*code, pool_mask); !it.done(); it.next()) { | 11345 for (RelocIterator it(*code, pool_mask); !it.done(); it.next()) { |
11346 RelocInfo* info = it.rinfo(); | 11346 RelocInfo* info = it.rinfo(); |
11347 if (RelocInfo::IsConstPool(info->rmode())) { | 11347 if (RelocInfo::IsConstPool(info->rmode())) { |
11348 CHECK(info->data() == constant_pool_size); | 11348 CHECK(info->data() == constant_pool_size); |
11349 ++pool_count; | 11349 ++pool_count; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11521 __ Mov(x0, 1); | 11521 __ Mov(x0, 1); |
11522 | 11522 |
11523 END(); | 11523 END(); |
11524 | 11524 |
11525 RUN(); | 11525 RUN(); |
11526 | 11526 |
11527 CHECK_EQUAL_64(0x1, x0); | 11527 CHECK_EQUAL_64(0x1, x0); |
11528 | 11528 |
11529 TEARDOWN(); | 11529 TEARDOWN(); |
11530 } | 11530 } |
OLD | NEW |