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

Unified Diff: runtime/vm/native_entry.cc

Issue 268853003: Fix library snapshotting breakage with native entry symbol resolver (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/native_entry.cc
diff --git a/runtime/vm/native_entry.cc b/runtime/vm/native_entry.cc
index 7fce0e912bd6438170d27a135e7717b1bda242dc..ce565cf5073e80e475fc7c9a66aa6af921e0ccea 100644
--- a/runtime/vm/native_entry.cc
+++ b/runtime/vm/native_entry.cc
@@ -9,6 +9,7 @@
#include "vm/dart_api_impl.h"
#include "vm/dart_api_state.h"
#include "vm/object_store.h"
+#include "vm/reusable_handles.h"
#include "vm/tags.h"
@@ -45,24 +46,26 @@ NativeFunction NativeEntry::ResolveNative(const Library& library,
const uint8_t* NativeEntry::ResolveSymbolInLibrary(const Library& library,
uword pc) {
- if (library.native_entry_symbol_resolver() == 0) {
+ Dart_NativeEntrySymbol symbol_resolver =
+ library.native_entry_symbol_resolver();
+ if (symbol_resolver == 0) {
// Cannot reverse lookup native entries.
return NULL;
}
- Dart_NativeEntrySymbol symbol_resolver =
- library.native_entry_symbol_resolver();
return symbol_resolver(reinterpret_cast<Dart_NativeFunction>(pc));
}
const uint8_t* NativeEntry::ResolveSymbol(uword pc) {
Isolate* isolate = Isolate::Current();
- const GrowableObjectArray& libs =
- GrowableObjectArray::Handle(isolate->object_store()->libraries());
+ REUSABLE_GROWABLE_OBJECT_ARRAY_HANDLESCOPE(isolate);
+ GrowableObjectArray& libs = reused_growable_object_array_handle.Handle();
+ libs ^= isolate->object_store()->libraries();
ASSERT(!libs.IsNull());
intptr_t num_libs = libs.Length();
- Library& lib = Library::Handle();
for (intptr_t i = 0; i < num_libs; i++) {
+ REUSABLE_LIBRARY_HANDLESCOPE(isolate);
+ Library& lib = reused_library_handle.Handle();
lib ^= libs.At(i);
ASSERT(!lib.IsNull());
const uint8_t* r = ResolveSymbolInLibrary(lib, pc);
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698