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

Side by Side Diff: vm/dart_entry.cc

Issue 11087070: - Get rid of RawClosure class and use RawInstance for closures. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 2 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 | « vm/dart_entry.h ('k') | vm/object.h » ('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/code_generator.h" 7 #include "vm/code_generator.h"
8 #include "vm/compiler.h" 8 #include "vm/compiler.h"
9 #include "vm/object_store.h" 9 #include "vm/object_store.h"
10 #include "vm/resolver.h" 10 #include "vm/resolver.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 ASSERT(!code.IsNull()); 76 ASSERT(!code.IsNull());
77 return entrypoint( 77 return entrypoint(
78 code.EntryPoint(), 78 code.EntryPoint(),
79 ArgumentsDescriptor(arguments.length(), optional_arguments_names), 79 ArgumentsDescriptor(arguments.length(), optional_arguments_names),
80 arguments.data(), 80 arguments.data(),
81 context); 81 context);
82 } 82 }
83 83
84 84
85 RawObject* DartEntry::InvokeClosure( 85 RawObject* DartEntry::InvokeClosure(
86 const Closure& closure, 86 const Instance& closure,
87 const GrowableArray<const Object*>& arguments, 87 const GrowableArray<const Object*>& arguments,
88 const Array& optional_arguments_names) { 88 const Array& optional_arguments_names) {
89 // Get the entrypoint corresponding to the closure specified, this 89 // Get the entrypoint corresponding to the closure specified, this
90 // will result in a compilation of the closure if it is not already 90 // will result in a compilation of the closure if it is not already
91 // compiled. 91 // compiled.
92 ASSERT(Class::Handle(closure.clazz()).signature_function() != Object::null()); 92 ASSERT(Class::Handle(closure.clazz()).signature_function() != Object::null());
93 const Function& function = Function::Handle(closure.function()); 93 const Function& function = Function::Handle(Closure::function(closure));
94 const Context& context = Context::Handle(closure.context()); 94 const Context& context = Context::Handle(Closure::context(closure));
95 ASSERT(!function.IsNull()); 95 ASSERT(!function.IsNull());
96 if (!function.HasCode()) { 96 if (!function.HasCode()) {
97 const Error& error = Error::Handle(Compiler::CompileFunction(function)); 97 const Error& error = Error::Handle(Compiler::CompileFunction(function));
98 if (!error.IsNull()) { 98 if (!error.IsNull()) {
99 return error.raw(); 99 return error.raw();
100 } 100 }
101 } 101 }
102 // Now Call the invoke stub which will invoke the closure. 102 // Now Call the invoke stub which will invoke the closure.
103 invokestub entrypoint = reinterpret_cast<invokestub>( 103 invokestub entrypoint = reinterpret_cast<invokestub>(
104 StubCode::InvokeDartCodeEntryPoint()); 104 StubCode::InvokeDartCodeEntryPoint());
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 const String& func_name = String::Handle(Field::GetterName(field_name)); 315 const String& func_name = String::Handle(Field::GetterName(field_name));
316 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name)); 316 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name));
317 ASSERT(!func.IsNull()); 317 ASSERT(!func.IsNull());
318 GrowableArray<const Object*> arguments; 318 GrowableArray<const Object*> arguments;
319 const Array& kNoArgumentNames = Array::Handle(); 319 const Array& kNoArgumentNames = Array::Handle();
320 return DartEntry::InvokeDynamic(port, func, arguments, kNoArgumentNames); 320 return DartEntry::InvokeDynamic(port, func, arguments, kNoArgumentNames);
321 } 321 }
322 322
323 323
324 } // namespace dart 324 } // namespace dart
OLDNEW
« no previous file with comments | « vm/dart_entry.h ('k') | vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698