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

Unified Diff: runtime/vm/object_test.cc

Issue 1436243005: Collect closure functions in isolate (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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/object_store.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_test.cc
diff --git a/runtime/vm/object_test.cc b/runtime/vm/object_test.cc
index 997ca9686b4a097f3298d51e905d7200c1c80cfd..a4b221586b1ce9bdac3471e774dcd842e1dcde6f 100644
--- a/runtime/vm/object_test.cc
+++ b/runtime/vm/object_test.cc
@@ -3883,6 +3883,7 @@ TEST_CASE(FindClosureIndex) {
const Script& script = Script::Handle();
const Class& cls = Class::Handle(CreateDummyClass(class_name, script));
const Array& functions = Array::Handle(Array::New(1));
+ const Isolate* iso = Isolate::Current();
Function& parent = Function::Handle();
const String& parent_name = String::Handle(Symbols::New("foo_papa"));
@@ -3895,18 +3896,18 @@ TEST_CASE(FindClosureIndex) {
const String& function_name = String::Handle(Symbols::New("foo"));
function = Function::NewClosureFunction(function_name, parent, 0);
// Add closure function to class.
- cls.AddClosureFunction(function);
+ iso->AddClosureFunction(function);
// The closure should return a valid index.
- intptr_t good_closure_index = cls.FindClosureIndex(function);
+ intptr_t good_closure_index = iso->FindClosureIndex(function);
EXPECT_GE(good_closure_index, 0);
// The parent function should return an invalid index.
- intptr_t bad_closure_index = cls.FindClosureIndex(parent);
+ intptr_t bad_closure_index = iso->FindClosureIndex(parent);
EXPECT_EQ(bad_closure_index, -1);
// Retrieve closure function via index.
Function& func_from_index = Function::Handle();
- func_from_index ^= cls.ClosureFunctionFromIndex(good_closure_index);
+ func_from_index ^= iso->ClosureFunctionFromIndex(good_closure_index);
// Same closure function.
EXPECT_EQ(func_from_index.raw(), function.raw());
}
« no previous file with comments | « runtime/vm/object_store.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698