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

Side by Side Diff: vm/dart_entry.cc

Issue 11469036: - Create frame work for adding read only handles for symbols in the VM isolate (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years 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_api_impl.cc ('k') | vm/flow_graph_builder.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/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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 const GrowableArray<const Object*>& arguments) { 216 const GrowableArray<const Object*>& arguments) {
217 const Class& cls = Class::Handle(lib.LookupClassAllowPrivate(class_name)); 217 const Class& cls = Class::Handle(lib.LookupClassAllowPrivate(class_name));
218 ASSERT(!cls.IsNull()); 218 ASSERT(!cls.IsNull());
219 // For now, we only support a non-parameterized or raw type. 219 // For now, we only support a non-parameterized or raw type.
220 const Instance& exception_object = Instance::Handle(Instance::New(cls)); 220 const Instance& exception_object = Instance::Handle(Instance::New(cls));
221 GrowableArray<const Object*> constructor_arguments(arguments.length() + 2); 221 GrowableArray<const Object*> constructor_arguments(arguments.length() + 2);
222 constructor_arguments.Add(&exception_object); 222 constructor_arguments.Add(&exception_object);
223 constructor_arguments.Add(&Smi::Handle(Smi::New(Function::kCtorPhaseAll))); 223 constructor_arguments.Add(&Smi::Handle(Smi::New(Function::kCtorPhaseAll)));
224 constructor_arguments.AddArray(arguments); 224 constructor_arguments.AddArray(arguments);
225 225
226 const String& period = String::Handle(Symbols::Dot()); 226 String& constructor_name = String::Handle(
227 String& constructor_name = String::Handle(String::Concat(class_name, period)); 227 String::Concat(class_name, Symbols::DotHandle()));
228 Function& constructor = 228 Function& constructor =
229 Function::Handle(cls.LookupConstructor(constructor_name)); 229 Function::Handle(cls.LookupConstructor(constructor_name));
230 ASSERT(!constructor.IsNull()); 230 ASSERT(!constructor.IsNull());
231 const Array& kNoArgumentNames = Array::Handle(); 231 const Array& kNoArgumentNames = Array::Handle();
232 const Object& retval = Object::Handle( 232 const Object& retval = Object::Handle(
233 DartEntry::InvokeStatic(constructor, constructor_arguments, 233 DartEntry::InvokeStatic(constructor, constructor_arguments,
234 kNoArgumentNames)); 234 kNoArgumentNames));
235 ASSERT(retval.IsNull() || retval.IsError()); 235 ASSERT(retval.IsNull() || retval.IsError());
236 if (retval.IsError()) { 236 if (retval.IsError()) {
237 return retval.raw(); 237 return retval.raw();
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 const String& func_name = String::Handle(Field::GetterName(field_name)); 361 const String& func_name = String::Handle(Field::GetterName(field_name));
362 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name)); 362 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name));
363 ASSERT(!func.IsNull()); 363 ASSERT(!func.IsNull());
364 GrowableArray<const Object*> arguments; 364 GrowableArray<const Object*> arguments;
365 const Array& kNoArgumentNames = Array::Handle(); 365 const Array& kNoArgumentNames = Array::Handle();
366 return DartEntry::InvokeDynamic(port, func, arguments, kNoArgumentNames); 366 return DartEntry::InvokeDynamic(port, func, arguments, kNoArgumentNames);
367 } 367 }
368 368
369 369
370 } // namespace dart 370 } // namespace dart
OLDNEW
« no previous file with comments | « vm/dart_api_impl.cc ('k') | vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698