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

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

Issue 196443009: - First step in refactoring ports with the goal of moving (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_entry.h ('k') | runtime/vm/symbols.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/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"
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 String::Handle(isolate_lib.PrivateName( 486 String::Handle(isolate_lib.PrivateName(
487 String::Handle(Field::GetterName(Symbols::_id())))); 487 String::Handle(Field::GetterName(Symbols::_id()))));
488 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name)); 488 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name));
489 ASSERT(!func.IsNull()); 489 ASSERT(!func.IsNull());
490 const Array& args = Array::Handle(Array::New(1)); 490 const Array& args = Array::Handle(Array::New(1));
491 args.SetAt(0, port); 491 args.SetAt(0, port);
492 return DartEntry::InvokeFunction(func, args); 492 return DartEntry::InvokeFunction(func, args);
493 } 493 }
494 494
495 495
496 bool DartLibraryCalls::IsSendPort(const Instance& send_port) { 496 bool DartLibraryCalls::IsSendPort(const Instance& obj) {
497 // Get instance class. 497 // Get instance class.
498 const Class& cls = Class::Handle(send_port.clazz()); 498 const Class& cls = Class::Handle(obj.clazz());
499 // Get send port class from isolate library. 499 // Get send port class from isolate library.
500 const Library& isolate_lib = Library::Handle(Library::IsolateLibrary()); 500 const Library& isolate_lib = Library::Handle(Library::IsolateLibrary());
501 const Class& send_port_cls = Class::Handle( 501 const Class& send_port_cls = Class::Handle(
502 isolate_lib.LookupClassAllowPrivate(Symbols::_SendPortImpl())); 502 isolate_lib.LookupClassAllowPrivate(Symbols::_SendPortImpl()));
503 // Check for the same class id. 503 // Check for the same class id.
504 ASSERT(!send_port_cls.IsNull()); 504 ASSERT(!send_port_cls.IsNull());
505 return cls.id() == send_port_cls.id(); 505 return cls.id() == send_port_cls.id();
506 } 506 }
507 507
508
509 bool DartLibraryCalls::IsReceivePort(const Instance& obj) {
510 // Get instance class.
511 const Class& cls = Class::Handle(obj.clazz());
512 // Get send port class from isolate library.
513 const Library& isolate_lib = Library::Handle(Library::IsolateLibrary());
514 const Class& recv_port_cls = Class::Handle(
515 isolate_lib.LookupClassAllowPrivate(Symbols::_RawReceivePortImpl()));
516 // Check for the same class id.
517 ASSERT(!recv_port_cls.IsNull());
518 return cls.id() == recv_port_cls.id();
519 }
520
508 } // namespace dart 521 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_entry.h ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698