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

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

Issue 137483010: Add more timing information in the VM to track time spent is dart code Vs native code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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
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 "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/globals.h" 6 #include "vm/globals.h"
7 7
8 #include "vm/ast.h" 8 #include "vm/ast.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/code_descriptors.h" 10 #include "vm/code_descriptors.h"
11 #include "vm/compiler.h" 11 #include "vm/compiler.h"
12 #include "vm/dart_api_impl.h"
12 #include "vm/dart_entry.h" 13 #include "vm/dart_entry.h"
13 #include "vm/native_entry.h" 14 #include "vm/native_entry.h"
14 #include "vm/parser.h" 15 #include "vm/parser.h"
15 #include "vm/symbols.h" 16 #include "vm/symbols.h"
16 #include "vm/unit_test.h" 17 #include "vm/unit_test.h"
17 18
18 namespace dart { 19 namespace dart {
19 20
20 static const intptr_t kPos = Scanner::kNoSourcePos; 21 static const intptr_t kPos = Scanner::kNoSourcePos;
21 22
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 " i = 10; s1 = 'abcd'; k = 20; s2 = 'B'; s3 = 'C';" 213 " i = 10; s1 = 'abcd'; k = 20; s2 = 'B'; s3 = 'C';"
213 " func(i, k);" 214 " func(i, k);"
214 " return i + k; }" 215 " return i + k; }"
215 " static int moo() {" 216 " static int moo() {"
216 " var i = A.foo();" 217 " var i = A.foo();"
217 " Expect.equals(30, i);" 218 " Expect.equals(30, i);"
218 " }\n" 219 " }\n"
219 "}\n"; 220 "}\n";
220 // First setup the script and compile the script. 221 // First setup the script and compile the script.
221 TestCase::LoadTestScript(kScriptChars, native_resolver); 222 TestCase::LoadTestScript(kScriptChars, native_resolver);
223 NativeToVmTimerScope timer(Isolate::Current());
222 EXPECT(ClassFinalizer::ProcessPendingClasses()); 224 EXPECT(ClassFinalizer::ProcessPendingClasses());
223 const String& name = String::Handle(String::New(TestCase::url())); 225 const String& name = String::Handle(String::New(TestCase::url()));
224 const Library& lib = Library::Handle(Library::LookupLibrary(name)); 226 const Library& lib = Library::Handle(Library::LookupLibrary(name));
225 EXPECT(!lib.IsNull()); 227 EXPECT(!lib.IsNull());
226 Class& cls = Class::Handle( 228 Class& cls = Class::Handle(
227 lib.LookupClass(String::Handle(Symbols::New("A")))); 229 lib.LookupClass(String::Handle(Symbols::New("A"))));
228 EXPECT(!cls.IsNull()); 230 EXPECT(!cls.IsNull());
229 231
230 // Now compile the two functions 'A.foo' and 'A.moo' 232 // Now compile the two functions 'A.foo' and 'A.moo'
231 String& function_moo_name = String::Handle(String::New("moo")); 233 String& function_moo_name = String::Handle(String::New("moo"));
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 275
274 // Now invoke 'A.moo' and it will trigger a GC when the native function 276 // Now invoke 'A.moo' and it will trigger a GC when the native function
275 // is called, this should then cause the stack map of function 'A.foo' 277 // is called, this should then cause the stack map of function 'A.foo'
276 // to be traversed and the appropriate objects visited. 278 // to be traversed and the appropriate objects visited.
277 const Object& result = Object::Handle( 279 const Object& result = Object::Handle(
278 DartEntry::InvokeFunction(function_foo, Object::empty_array())); 280 DartEntry::InvokeFunction(function_foo, Object::empty_array()));
279 EXPECT(!result.IsError()); 281 EXPECT(!result.IsError());
280 } 282 }
281 283
282 } // namespace dart 284 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/string.cc ('k') | runtime/vm/compiler.cc » ('j') | runtime/vm/dart_api_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698