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

Side by Side Diff: lib/mirrors.cc

Issue 10874072: Use the return value of vm native methods to set the return value, (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 3 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/bootstrap_natives.h" 5 #include "vm/bootstrap_natives.h"
6 6
7 #include "platform/json.h" 7 #include "platform/json.h"
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "include/dart_debugger_api.h" 9 #include "include/dart_debugger_api.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 10 matching lines...) Expand all
21 // Get the port id from the SendPort instance. 21 // Get the port id from the SendPort instance.
22 const Object& id_obj = Object::Handle(DartLibraryCalls::PortGetId(port)); 22 const Object& id_obj = Object::Handle(DartLibraryCalls::PortGetId(port));
23 if (id_obj.IsError()) { 23 if (id_obj.IsError()) {
24 Exceptions::PropagateError(Error::Cast(id_obj)); 24 Exceptions::PropagateError(Error::Cast(id_obj));
25 UNREACHABLE(); 25 UNREACHABLE();
26 } 26 }
27 ASSERT(id_obj.IsSmi() || id_obj.IsMint()); 27 ASSERT(id_obj.IsSmi() || id_obj.IsMint());
28 Integer& id = Integer::Handle(); 28 Integer& id = Integer::Handle();
29 id ^= id_obj.raw(); 29 id ^= id_obj.raw();
30 Dart_Port port_id = static_cast<Dart_Port>(id.AsInt64Value()); 30 Dart_Port port_id = static_cast<Dart_Port>(id.AsInt64Value());
31 const Bool& is_local = Bool::Handle(Bool::Get(PortMap::IsLocalPort(port_id))); 31 return Bool::Get(PortMap::IsLocalPort(port_id));
32 arguments->SetReturn(is_local);
33 } 32 }
34 33
35 34
36 // TODO(turnidge): Add Map support to the dart embedding api instead 35 // TODO(turnidge): Add Map support to the dart embedding api instead
37 // of implementing it here. 36 // of implementing it here.
38 static Dart_Handle CoreLib() { 37 static Dart_Handle CoreLib() {
39 Dart_Handle core_lib_name = Dart_NewString("dart:core"); 38 Dart_Handle core_lib_name = Dart_NewString("dart:core");
40 return Dart_LookupLibrary(core_lib_name); 39 return Dart_LookupLibrary(core_lib_name);
41 } 40 }
42 41
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 } 924 }
926 925
927 926
928 void HandleMirrorsMessage(Isolate* isolate, 927 void HandleMirrorsMessage(Isolate* isolate,
929 Dart_Port reply_port, 928 Dart_Port reply_port,
930 const Instance& message) { 929 const Instance& message) {
931 UNIMPLEMENTED(); 930 UNIMPLEMENTED();
932 } 931 }
933 932
934 } // namespace dart 933 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698