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

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

Issue 10389023: Fixed compilation time measurement, restructure some code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/timer.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 <stdio.h> 5 #include <stdio.h>
6 6
7 #include "vm/unit_test.h" 7 #include "vm/unit_test.h"
8 8
9 #include "bin/builtin.h" 9 #include "bin/builtin.h"
10 #include "bin/dartutils.h" 10 #include "bin/dartutils.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 Dart_Handle url, 127 Dart_Handle url,
128 Dart_Handle import_map) { 128 Dart_Handle import_map) {
129 if (tag == kCanonicalizeUrl) { 129 if (tag == kCanonicalizeUrl) {
130 return url; 130 return url;
131 } 131 }
132 return Api::Success(Isolate::Current()); 132 return Api::Success(Isolate::Current());
133 } 133 }
134 134
135 135
136 uword AssemblerTest::Assemble() { 136 uword AssemblerTest::Assemble() {
137 const Code& code = Code::Handle(Code::FinalizeCode(name_, assembler_)); 137 const String& function_name = String::ZoneHandle(String::NewSymbol(name_));
138 Function& function = Function::ZoneHandle(
139 Function::New(function_name, RawFunction::kFunction, true, false, 0));
140 const Code& code = Code::Handle(Code::FinalizeCode(function, assembler_));
138 if (FLAG_disassemble) { 141 if (FLAG_disassemble) {
139 OS::Print("Code for test '%s' {\n", name_); 142 OS::Print("Code for test '%s' {\n", name_);
140 const Instructions& instructions = 143 const Instructions& instructions =
141 Instructions::Handle(code.instructions()); 144 Instructions::Handle(code.instructions());
142 uword start = instructions.EntryPoint(); 145 uword start = instructions.EntryPoint();
143 Disassembler::Disassemble(start, start + assembler_->CodeSize()); 146 Disassembler::Disassemble(start, start + assembler_->CodeSize());
144 OS::Print("}\n"); 147 OS::Print("}\n");
145 } 148 }
146 const Instructions& instructions = Instructions::Handle(code.instructions()); 149 const Instructions& instructions = Instructions::Handle(code.instructions());
147 return instructions.EntryPoint(); 150 return instructions.EntryPoint();
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 197
195 bool CompilerTest::TestCompileFunction(const Function& function) { 198 bool CompilerTest::TestCompileFunction(const Function& function) {
196 Isolate* isolate = Isolate::Current(); 199 Isolate* isolate = Isolate::Current();
197 ASSERT(isolate != NULL); 200 ASSERT(isolate != NULL);
198 ASSERT(ClassFinalizer::AllClassesFinalized()); 201 ASSERT(ClassFinalizer::AllClassesFinalized());
199 const Error& error = Error::Handle(Compiler::CompileFunction(function)); 202 const Error& error = Error::Handle(Compiler::CompileFunction(function));
200 return error.IsNull(); 203 return error.IsNull();
201 } 204 }
202 205
203 } // namespace dart 206 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/timer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698