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

Side by Side Diff: runtime/lib/isolate.cc

Issue 11968022: Lookup functions by name that contains the private key, except for dart_api which allows ignoring t… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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 | « no previous file | runtime/vm/dart_api_impl.cc » ('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) 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 "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/bootstrap_natives.h" 6 #include "vm/bootstrap_natives.h"
7 #include "vm/class_finalizer.h" 7 #include "vm/class_finalizer.h"
8 #include "vm/dart.h" 8 #include "vm/dart.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 Isolate* isolate = Isolate::Current(); 55 Isolate* isolate = Isolate::Current();
56 Function& func = 56 Function& func =
57 Function::Handle(isolate, 57 Function::Handle(isolate,
58 isolate->object_store()->receive_port_create_function()); 58 isolate->object_store()->receive_port_create_function());
59 const int kNumArguments = 1; 59 const int kNumArguments = 1;
60 if (func.IsNull()) { 60 if (func.IsNull()) {
61 Library& isolate_lib = Library::Handle(Library::IsolateLibrary()); 61 Library& isolate_lib = Library::Handle(Library::IsolateLibrary());
62 ASSERT(!isolate_lib.IsNull()); 62 ASSERT(!isolate_lib.IsNull());
63 const String& class_name = 63 const String& class_name =
64 String::Handle(isolate_lib.PrivateName(Symbols::_ReceivePortImpl())); 64 String::Handle(isolate_lib.PrivateName(Symbols::_ReceivePortImpl()));
65 const String& function_name =
66 String::Handle(isolate_lib.PrivateName(Symbols::_get_or_create()));
65 func = Resolver::ResolveStatic(isolate_lib, 67 func = Resolver::ResolveStatic(isolate_lib,
66 class_name, 68 class_name,
67 Symbols::_get_or_create(), 69 function_name,
68 kNumArguments, 70 kNumArguments,
69 Object::empty_array(), 71 Object::empty_array(),
70 Resolver::kIsQualified); 72 Resolver::kIsQualified);
73 ASSERT(!func.IsNull());
71 isolate->object_store()->set_receive_port_create_function(func); 74 isolate->object_store()->set_receive_port_create_function(func);
72 } 75 }
73 const Array& args = Array::Handle(isolate, Array::New(kNumArguments)); 76 const Array& args = Array::Handle(isolate, Array::New(kNumArguments));
74 args.SetAt(0, Integer::Handle(isolate, Integer::New(port_id))); 77 args.SetAt(0, Integer::Handle(isolate, Integer::New(port_id)));
75 const Object& result = 78 const Object& result =
76 Object::Handle(isolate, DartEntry::InvokeStatic(func, args)); 79 Object::Handle(isolate, DartEntry::InvokeStatic(func, args));
77 if (!result.IsError()) { 80 if (!result.IsError()) {
78 PortMap::SetLive(port_id); 81 PortMap::SetLive(port_id);
79 } 82 }
80 return result.raw(); 83 return result.raw();
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 491
489 DEFINE_NATIVE_ENTRY(isolate_getPortInternal, 0) { 492 DEFINE_NATIVE_ENTRY(isolate_getPortInternal, 0) {
490 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port())); 493 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port()));
491 if (port.IsError()) { 494 if (port.IsError()) {
492 Exceptions::PropagateError(Error::Cast(port)); 495 Exceptions::PropagateError(Error::Cast(port));
493 } 496 }
494 return port.raw(); 497 return port.raw();
495 } 498 }
496 499
497 } // namespace dart 500 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698