OLD | NEW |
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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 Resolver::kIsQualified)); | 295 Resolver::kIsQualified)); |
296 GrowableArray<const Object*> arguments(kNumArguments); | 296 GrowableArray<const Object*> arguments(kNumArguments); |
297 arguments.Add(&Integer::Handle(Integer::New(port_id))); | 297 arguments.Add(&Integer::Handle(Integer::New(port_id))); |
298 return DartEntry::InvokeStatic(function, arguments, kNoArgumentNames); | 298 return DartEntry::InvokeStatic(function, arguments, kNoArgumentNames); |
299 } | 299 } |
300 | 300 |
301 | 301 |
302 RawObject* DartLibraryCalls::MapSetAt(const Instance& map, | 302 RawObject* DartLibraryCalls::MapSetAt(const Instance& map, |
303 const Instance& key, | 303 const Instance& key, |
304 const Instance& value) { | 304 const Instance& value) { |
305 String& name = String::Handle(String::New("[]=")); | 305 String& name = String::Handle(Symbols::AssignIndexToken()); |
306 const Function& function = Function::Handle( | 306 const Function& function = Function::Handle( |
307 Resolver::ResolveDynamic(map, name, 3, 0)); | 307 Resolver::ResolveDynamic(map, name, 3, 0)); |
308 ASSERT(!function.IsNull()); | 308 ASSERT(!function.IsNull()); |
309 GrowableArray<const Object*> args(2); | 309 GrowableArray<const Object*> args(2); |
310 args.Add(&key); | 310 args.Add(&key); |
311 args.Add(&value); | 311 args.Add(&value); |
312 const Array& kNoArgumentNames = Array::Handle(); | 312 const Array& kNoArgumentNames = Array::Handle(); |
313 const Object& result = Object::Handle( | 313 const Object& result = Object::Handle( |
314 DartEntry::InvokeDynamic(map, function, args, kNoArgumentNames)); | 314 DartEntry::InvokeDynamic(map, function, args, kNoArgumentNames)); |
315 return result.raw(); | 315 return result.raw(); |
316 } | 316 } |
317 | 317 |
318 | 318 |
319 RawObject* DartLibraryCalls::PortGetId(const Instance& port) { | 319 RawObject* DartLibraryCalls::PortGetId(const Instance& port) { |
320 const String& field_name = String::Handle(Symbols::New("_id")); | 320 const String& field_name = String::Handle(Symbols::New("_id")); |
321 const Class& cls = Class::Handle(port.clazz()); | 321 const Class& cls = Class::Handle(port.clazz()); |
322 const String& func_name = String::Handle(Field::GetterName(field_name)); | 322 const String& func_name = String::Handle(Field::GetterName(field_name)); |
323 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name)); | 323 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name)); |
324 ASSERT(!func.IsNull()); | 324 ASSERT(!func.IsNull()); |
325 GrowableArray<const Object*> arguments; | 325 GrowableArray<const Object*> arguments; |
326 const Array& kNoArgumentNames = Array::Handle(); | 326 const Array& kNoArgumentNames = Array::Handle(); |
327 return DartEntry::InvokeDynamic(port, func, arguments, kNoArgumentNames); | 327 return DartEntry::InvokeDynamic(port, func, arguments, kNoArgumentNames); |
328 } | 328 } |
329 | 329 |
330 | 330 |
331 } // namespace dart | 331 } // namespace dart |
OLD | NEW |