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

Side by Side Diff: vm/dart_entry.cc

Issue 9616044: Adds new apis Dart_GetField/Dart_SetField. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 | « vm/dart_api_impl_test.cc ('k') | vm/object.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/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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 ASSERT(result.IsInstance() || result.IsError()); 188 ASSERT(result.IsInstance() || result.IsError());
189 return result.raw(); 189 return result.raw();
190 } 190 }
191 191
192 192
193 RawObject* DartLibraryCalls::HandleMessage(Dart_Port dest_port_id, 193 RawObject* DartLibraryCalls::HandleMessage(Dart_Port dest_port_id,
194 Dart_Port reply_port_id, 194 Dart_Port reply_port_id,
195 const Instance& message) { 195 const Instance& message) {
196 Library& isolate_lib = Library::Handle(Library::IsolateLibrary()); 196 Library& isolate_lib = Library::Handle(Library::IsolateLibrary());
197 ASSERT(!isolate_lib.IsNull()); 197 ASSERT(!isolate_lib.IsNull());
198 const String& public_class_name =
199 String::Handle(String::NewSymbol("_ReceivePortImpl"));
198 const String& class_name = 200 const String& class_name =
199 String::Handle(isolate_lib.PrivateName("_ReceivePortImpl")); 201 String::Handle(isolate_lib.PrivateName(public_class_name));
200 const String& function_name = 202 const String& function_name =
201 String::Handle(String::NewSymbol("_handleMessage")); 203 String::Handle(String::NewSymbol("_handleMessage"));
202 const int kNumArguments = 3; 204 const int kNumArguments = 3;
203 const Array& kNoArgumentNames = Array::Handle(); 205 const Array& kNoArgumentNames = Array::Handle();
204 const Function& function = Function::Handle( 206 const Function& function = Function::Handle(
205 Resolver::ResolveStatic(isolate_lib, 207 Resolver::ResolveStatic(isolate_lib,
206 class_name, 208 class_name,
207 function_name, 209 function_name,
208 kNumArguments, 210 kNumArguments,
209 kNoArgumentNames, 211 kNoArgumentNames,
210 Resolver::kIsQualified)); 212 Resolver::kIsQualified));
211 GrowableArray<const Object*> arguments(kNumArguments); 213 GrowableArray<const Object*> arguments(kNumArguments);
212 arguments.Add(&Integer::Handle(Integer::New(dest_port_id))); 214 arguments.Add(&Integer::Handle(Integer::New(dest_port_id)));
213 arguments.Add(&Integer::Handle(Integer::New(reply_port_id))); 215 arguments.Add(&Integer::Handle(Integer::New(reply_port_id)));
214 arguments.Add(&message); 216 arguments.Add(&message);
215 const Object& result = Object::Handle( 217 const Object& result = Object::Handle(
216 DartEntry::InvokeStatic(function, arguments, kNoArgumentNames)); 218 DartEntry::InvokeStatic(function, arguments, kNoArgumentNames));
217 ASSERT(result.IsNull() || result.IsError()); 219 ASSERT(result.IsNull() || result.IsError());
218 return result.raw(); 220 return result.raw();
219 } 221 }
220 222
221 } // namespace dart 223 } // namespace dart
OLDNEW
« no previous file with comments | « vm/dart_api_impl_test.cc ('k') | vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698