| 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/class_finalizer.h" | 7 #include "vm/class_finalizer.h" | 
| 8 #include "vm/compiler.h" | 8 #include "vm/compiler.h" | 
| 9 #include "vm/debugger.h" | 9 #include "vm/debugger.h" | 
| 10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" | 
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 502 | 502 | 
| 503   const Array& args = Array::Handle(Array::New(kNumArguments)); | 503   const Array& args = Array::Handle(Array::New(kNumArguments)); | 
| 504   args.SetAt(0, left); | 504   args.SetAt(0, left); | 
| 505   args.SetAt(1, right); | 505   args.SetAt(1, right); | 
| 506   const Object& result = | 506   const Object& result = | 
| 507       Object::Handle(DartEntry::InvokeFunction(function, args)); | 507       Object::Handle(DartEntry::InvokeFunction(function, args)); | 
| 508   ASSERT(result.IsInstance() || result.IsError()); | 508   ASSERT(result.IsInstance() || result.IsError()); | 
| 509   return result.raw(); | 509   return result.raw(); | 
| 510 } | 510 } | 
| 511 | 511 | 
|  | 512 // On success, returns a RawInstance.  On failure, a RawError. | 
|  | 513 RawObject* DartLibraryCalls::IdentityHashCode(const Instance& object) { | 
|  | 514   const int kNumArguments = 1; | 
|  | 515   Thread* thread = Thread::Current(); | 
|  | 516   Zone* zone = thread->zone(); | 
|  | 517   const Library& libcore = Library::Handle(zone, Library::CoreLibrary()); | 
|  | 518   ASSERT(!libcore.IsNull()); | 
|  | 519   const Function& function = Function::Handle( | 
|  | 520       zone, libcore.LookupFunctionAllowPrivate(Symbols::identityHashCode())); | 
|  | 521   ASSERT(!function.IsNull()); | 
|  | 522   const Array& args = Array::Handle(zone, Array::New(kNumArguments)); | 
|  | 523   args.SetAt(0, object); | 
|  | 524   const Object& result = | 
|  | 525       Object::Handle(zone, DartEntry::InvokeFunction(function, args)); | 
|  | 526   ASSERT(result.IsInstance() || result.IsError()); | 
|  | 527   return result.raw(); | 
|  | 528 } | 
|  | 529 | 
| 512 RawObject* DartLibraryCalls::LookupHandler(Dart_Port port_id) { | 530 RawObject* DartLibraryCalls::LookupHandler(Dart_Port port_id) { | 
| 513   Thread* thread = Thread::Current(); | 531   Thread* thread = Thread::Current(); | 
| 514   Zone* zone = thread->zone(); | 532   Zone* zone = thread->zone(); | 
| 515   Function& function = Function::Handle( | 533   Function& function = Function::Handle( | 
| 516       zone, thread->isolate()->object_store()->lookup_port_handler()); | 534       zone, thread->isolate()->object_store()->lookup_port_handler()); | 
| 517   const int kTypeArgsLen = 0; | 535   const int kTypeArgsLen = 0; | 
| 518   const int kNumArguments = 1; | 536   const int kNumArguments = 1; | 
| 519   if (function.IsNull()) { | 537   if (function.IsNull()) { | 
| 520     Library& isolate_lib = Library::Handle(zone, Library::IsolateLibrary()); | 538     Library& isolate_lib = Library::Handle(zone, Library::IsolateLibrary()); | 
| 521     ASSERT(!isolate_lib.IsNull()); | 539     ASSERT(!isolate_lib.IsNull()); | 
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 601   const Array& args = Array::Handle(Array::New(kNumArguments)); | 619   const Array& args = Array::Handle(Array::New(kNumArguments)); | 
| 602   args.SetAt(0, map); | 620   args.SetAt(0, map); | 
| 603   args.SetAt(1, key); | 621   args.SetAt(1, key); | 
| 604   args.SetAt(2, value); | 622   args.SetAt(2, value); | 
| 605   const Object& result = | 623   const Object& result = | 
| 606       Object::Handle(DartEntry::InvokeFunction(function, args)); | 624       Object::Handle(DartEntry::InvokeFunction(function, args)); | 
| 607   return result.raw(); | 625   return result.raw(); | 
| 608 } | 626 } | 
| 609 | 627 | 
| 610 }  // namespace dart | 628 }  // namespace dart | 
| OLD | NEW | 
|---|