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

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

Issue 177733002: Revert r32930 (Add more timing information in the VM to track time...) (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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/dart_api_impl_test.cc ('k') | runtime/vm/debugger_api_impl.cc » ('j') | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/dart_entry.h" 5 #include "vm/dart_entry.h"
6 6
7 #include "vm/class_finalizer.h" 7 #include "vm/class_finalizer.h"
8 #include "vm/code_generator.h" 8 #include "vm/code_generator.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/debugger.h" 10 #include "vm/debugger.h"
11 #include "vm/object_store.h" 11 #include "vm/object_store.h"
12 #include "vm/resolver.h" 12 #include "vm/resolver.h"
13 #include "vm/simulator.h" 13 #include "vm/simulator.h"
14 #include "vm/stub_code.h" 14 #include "vm/stub_code.h"
15 #include "vm/symbols.h" 15 #include "vm/symbols.h"
16 #include "vm/timer_scope.h"
17 16
18 namespace dart { 17 namespace dart {
19 18
20 // A cache of VM heap allocated arguments descriptors. 19 // A cache of VM heap allocated arguments descriptors.
21 RawArray* ArgumentsDescriptor::cached_args_descriptors_[kCachedDescriptorCount]; 20 RawArray* ArgumentsDescriptor::cached_args_descriptors_[kCachedDescriptorCount];
22 21
23 22
24 RawObject* DartEntry::InvokeFunction(const Function& function, 23 RawObject* DartEntry::InvokeFunction(const Function& function,
25 const Array& arguments) { 24 const Array& arguments) {
26 const Array& arguments_descriptor = 25 const Array& arguments_descriptor =
(...skipping 19 matching lines...) Expand all
46 // Get the entrypoint corresponding to the function specified, this 45 // Get the entrypoint corresponding to the function specified, this
47 // will result in a compilation of the function if it is not already 46 // will result in a compilation of the function if it is not already
48 // compiled. 47 // compiled.
49 if (!function.HasCode()) { 48 if (!function.HasCode()) {
50 const Error& error = Error::Handle(Compiler::CompileFunction(function)); 49 const Error& error = Error::Handle(Compiler::CompileFunction(function));
51 if (!error.IsNull()) { 50 if (!error.IsNull()) {
52 return error.raw(); 51 return error.raw();
53 } 52 }
54 } 53 }
55 // Now Call the invoke stub which will invoke the dart function. 54 // Now Call the invoke stub which will invoke the dart function.
56 Isolate* isolate = Isolate::Current();
57 TIMERSCOPE(isolate, time_dart_execution);
58 invokestub entrypoint = reinterpret_cast<invokestub>( 55 invokestub entrypoint = reinterpret_cast<invokestub>(
59 StubCode::InvokeDartCodeEntryPoint()); 56 StubCode::InvokeDartCodeEntryPoint());
60 const Code& code = Code::Handle(isolate, function.CurrentCode()); 57 const Code& code = Code::Handle(function.CurrentCode());
61 ASSERT(!code.IsNull()); 58 ASSERT(!code.IsNull());
62 ASSERT(isolate->no_callback_scope_depth() == 0); 59 ASSERT(Isolate::Current()->no_callback_scope_depth() == 0);
63 #if defined(USING_SIMULATOR) 60 #if defined(USING_SIMULATOR)
64 return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call( 61 return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call(
65 reinterpret_cast<int32_t>(entrypoint), 62 reinterpret_cast<int32_t>(entrypoint),
66 static_cast<int32_t>(code.EntryPoint()), 63 static_cast<int32_t>(code.EntryPoint()),
67 reinterpret_cast<int32_t>(&arguments_descriptor), 64 reinterpret_cast<int32_t>(&arguments_descriptor),
68 reinterpret_cast<int32_t>(&arguments), 65 reinterpret_cast<int32_t>(&arguments),
69 reinterpret_cast<int32_t>(&context))); 66 reinterpret_cast<int32_t>(&context)));
70 #else 67 #else
71 return entrypoint(code.EntryPoint(), 68 return entrypoint(code.EntryPoint(),
72 arguments_descriptor, 69 arguments_descriptor,
73 arguments, 70 arguments,
74 context); 71 context);
75 #endif 72 #endif
76 } 73 }
77 74
78 75
79 RawObject* DartEntry::InvokeClosure(const Array& arguments) { 76 RawObject* DartEntry::InvokeClosure(const Array& arguments) {
80 const Array& arguments_descriptor = 77 const Array& arguments_descriptor =
81 Array::Handle(ArgumentsDescriptor::New(arguments.Length())); 78 Array::Handle(ArgumentsDescriptor::New(arguments.Length()));
82 return InvokeClosure(arguments, arguments_descriptor); 79 return InvokeClosure(arguments, arguments_descriptor);
83 } 80 }
84 81
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 // Get send port class from isolate library. 499 // Get send port class from isolate library.
503 const Library& isolate_lib = Library::Handle(Library::IsolateLibrary()); 500 const Library& isolate_lib = Library::Handle(Library::IsolateLibrary());
504 const Class& send_port_cls = Class::Handle( 501 const Class& send_port_cls = Class::Handle(
505 isolate_lib.LookupClassAllowPrivate(Symbols::_SendPortImpl())); 502 isolate_lib.LookupClassAllowPrivate(Symbols::_SendPortImpl()));
506 // Check for the same class id. 503 // Check for the same class id.
507 ASSERT(!send_port_cls.IsNull()); 504 ASSERT(!send_port_cls.IsNull());
508 return cls.id() == send_port_cls.id(); 505 return cls.id() == send_port_cls.id();
509 } 506 }
510 507
511 } // namespace dart 508 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/debugger_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698