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

Unified Diff: runtime/vm/stack_frame_test.cc

Issue 1947393003: - Use a map to lookup libraries by URL. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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/snapshot_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stack_frame_test.cc
diff --git a/runtime/vm/stack_frame_test.cc b/runtime/vm/stack_frame_test.cc
index 0a7644b65024b0805b7d3a63f4e491672dd6c7cf..a2198aa68d5ecdac1cbff69872e1650593467cf1 100644
--- a/runtime/vm/stack_frame_test.cc
+++ b/runtime/vm/stack_frame_test.cc
@@ -75,6 +75,9 @@ void FUNCTION_NAME(StackFrame_dartFrameCount)(Dart_NativeArguments args) {
void FUNCTION_NAME(StackFrame_validateFrame)(Dart_NativeArguments args) {
+ Thread* thread = Thread::Current();
+ Zone* zone = thread->zone();
+
Dart_Handle index = Dart_GetNativeArgument(args, 0);
Dart_Handle name = Dart_GetNativeArgument(args, 1);
const Smi& frame_index_smi = Smi::CheckedHandle(Api::UnwrapHandle(index));
@@ -89,18 +92,18 @@ void FUNCTION_NAME(StackFrame_validateFrame)(Dart_NativeArguments args) {
// Find the function corresponding to this frame and check if it
// matches the function name passed in.
const Function& function =
- Function::Handle(frame->LookupDartFunction());
+ Function::Handle(zone, frame->LookupDartFunction());
if (function.IsNull()) {
FATAL("StackFrame_validateFrame fails, invalid dart frame.\n");
}
const char* name = function.ToFullyQualifiedCString();
// Currently all unit tests are loaded as being part of dart:core-lib.
- String& url = String::Handle(String::New(TestCase::url()));
- const Library& lib = Library::Handle(Library::LookupLibrary(url));
+ String& url = String::Handle(zone, String::New(TestCase::url()));
+ const Library& lib = Library::Handle(zone,
+ Library::LookupLibrary(thread, url));
ASSERT(!lib.IsNull());
- const char* lib_name = String::Handle(lib.url()).ToCString();
- char* full_name = OS::SCreate(Thread::Current()->zone(),
- "%s_%s", lib_name, expected_name);
+ const char* lib_name = String::Handle(zone, lib.url()).ToCString();
+ char* full_name = OS::SCreate(zone, "%s_%s", lib_name, expected_name);
if (strcmp(full_name, name) != 0) {
FATAL("StackFrame_validateFrame fails, incorrect frame.\n");
}
« no previous file with comments | « runtime/vm/snapshot_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698