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

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

Issue 1394673002: Move reusable handles from isolate to thread. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix release build Created 5 years, 2 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
« no previous file with comments | « runtime/vm/longjump.cc ('k') | runtime/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/native_entry.h" 5 #include "vm/native_entry.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "vm/bootstrap.h" 9 #include "vm/bootstrap.h"
10 #include "vm/code_patcher.h" 10 #include "vm/code_patcher.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 library.native_entry_symbol_resolver(); 49 library.native_entry_symbol_resolver();
50 if (symbol_resolver == 0) { 50 if (symbol_resolver == 0) {
51 // Cannot reverse lookup native entries. 51 // Cannot reverse lookup native entries.
52 return NULL; 52 return NULL;
53 } 53 }
54 return symbol_resolver(reinterpret_cast<Dart_NativeFunction>(pc)); 54 return symbol_resolver(reinterpret_cast<Dart_NativeFunction>(pc));
55 } 55 }
56 56
57 57
58 const uint8_t* NativeEntry::ResolveSymbol(uword pc) { 58 const uint8_t* NativeEntry::ResolveSymbol(uword pc) {
59 Isolate* isolate = Isolate::Current(); 59 Thread* thread = Thread::Current();
60 REUSABLE_GROWABLE_OBJECT_ARRAY_HANDLESCOPE(isolate); 60 REUSABLE_GROWABLE_OBJECT_ARRAY_HANDLESCOPE(thread);
61 GrowableObjectArray& libs = reused_growable_object_array_handle.Handle(); 61 GrowableObjectArray& libs = reused_growable_object_array_handle.Handle();
62 libs ^= isolate->object_store()->libraries(); 62 libs ^= thread->isolate()->object_store()->libraries();
63 ASSERT(!libs.IsNull()); 63 ASSERT(!libs.IsNull());
64 intptr_t num_libs = libs.Length(); 64 intptr_t num_libs = libs.Length();
65 for (intptr_t i = 0; i < num_libs; i++) { 65 for (intptr_t i = 0; i < num_libs; i++) {
66 REUSABLE_LIBRARY_HANDLESCOPE(isolate); 66 REUSABLE_LIBRARY_HANDLESCOPE(thread);
67 Library& lib = reused_library_handle.Handle(); 67 Library& lib = reused_library_handle.Handle();
68 lib ^= libs.At(i); 68 lib ^= libs.At(i);
69 ASSERT(!lib.IsNull()); 69 ASSERT(!lib.IsNull());
70 const uint8_t* r = ResolveSymbolInLibrary(lib, pc); 70 const uint8_t* r = ResolveSymbolInLibrary(lib, pc);
71 if (r != NULL) { 71 if (r != NULL) {
72 return r; 72 return r;
73 } 73 }
74 } 74 }
75 return NULL; 75 return NULL;
76 } 76 }
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 if (call_through_wrapper) { 268 if (call_through_wrapper) {
269 NativeEntry::NativeCallWrapper( 269 NativeEntry::NativeCallWrapper(
270 args, reinterpret_cast<Dart_NativeFunction>(target_function)); 270 args, reinterpret_cast<Dart_NativeFunction>(target_function));
271 } else { 271 } else {
272 target_function(arguments); 272 target_function(arguments);
273 } 273 }
274 } 274 }
275 275
276 276
277 } // namespace dart 277 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/longjump.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698