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

Side by Side Diff: runtime/vm/unit_test.cc

Issue 1283733003: VM: Refactor assembler test that rely on the constant pool. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Added comments, fixed that pass in Thread Created 5 years, 4 months 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 | « runtime/vm/unit_test.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/unit_test.h" 5 #include "vm/unit_test.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include "bin/builtin.h" 9 #include "bin/builtin.h"
10 #include "bin/dartutils.h" 10 #include "bin/dartutils.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 true, false, false, false, false, cls, 0)); 208 true, false, false, false, false, cls, 0));
209 code_ = Code::FinalizeCode(function, assembler_); 209 code_ = Code::FinalizeCode(function, assembler_);
210 if (FLAG_disassemble) { 210 if (FLAG_disassemble) {
211 OS::Print("Code for test '%s' {\n", name_); 211 OS::Print("Code for test '%s' {\n", name_);
212 const Instructions& instructions = 212 const Instructions& instructions =
213 Instructions::Handle(code_.instructions()); 213 Instructions::Handle(code_.instructions());
214 uword start = instructions.EntryPoint(); 214 uword start = instructions.EntryPoint();
215 Disassembler::Disassemble(start, start + assembler_->CodeSize()); 215 Disassembler::Disassemble(start, start + assembler_->CodeSize());
216 OS::Print("}\n"); 216 OS::Print("}\n");
217 } 217 }
218 const Instructions& instructions = Instructions::Handle(code_.instructions());
219 entry_ = instructions.EntryPoint();
220 } 218 }
221 219
222 220
223 CodeGenTest::CodeGenTest(const char* name) 221 CodeGenTest::CodeGenTest(const char* name)
224 : function_(Function::ZoneHandle()), 222 : function_(Function::ZoneHandle()),
225 node_sequence_(new SequenceNode(Scanner::kNoSourcePos, 223 node_sequence_(new SequenceNode(Scanner::kNoSourcePos,
226 new LocalScope(NULL, 0, 0))), 224 new LocalScope(NULL, 0, 0))),
227 default_parameter_values_(Array::ZoneHandle()) { 225 default_parameter_values_(Array::ZoneHandle()) {
228 ASSERT(name != NULL); 226 ASSERT(name != NULL);
229 const String& function_name = String::ZoneHandle(Symbols::New(name)); 227 const String& function_name = String::ZoneHandle(Symbols::New(name));
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 Thread* thread = Thread::Current(); 276 Thread* thread = Thread::Current();
279 ASSERT(thread != NULL); 277 ASSERT(thread != NULL);
280 ASSERT(ClassFinalizer::AllClassesFinalized()); 278 ASSERT(ClassFinalizer::AllClassesFinalized());
281 const Error& error = Error::Handle(Compiler::CompileFunction(thread, 279 const Error& error = Error::Handle(Compiler::CompileFunction(thread,
282 function)); 280 function));
283 return error.IsNull(); 281 return error.IsNull();
284 } 282 }
285 283
286 284
287 } // namespace dart 285 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/unit_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698