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

Unified Diff: runtime/vm/object_test.cc

Issue 1584223006: Remove signature classes from the VM. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 4 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 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 5484a7b5d19896244d0522698f25c7d5c4fde419..9f31fee56315150765c47762b3945e9b32dca518 100644
--- a/runtime/vm/object_test.cc
+++ b/runtime/vm/object_test.cc
@@ -2630,18 +2630,13 @@ TEST_CASE(Closure) {
Function& function = Function::Handle();
const String& function_name = String::Handle(Symbols::New("foo"));
function = Function::NewClosureFunction(function_name, parent, 0);
- const Class& signature_class = Class::Handle(
- Class::NewSignatureClass(function_name, function, script, 0));
- const Instance& closure = Instance::Handle(Closure::New(function, context));
+ const Closure& closure = Closure::Handle(Closure::New(function, context));
const Class& closure_class = Class::Handle(closure.clazz());
- EXPECT(closure_class.IsSignatureClass());
- EXPECT(closure_class.IsCanonicalSignatureClass());
- EXPECT_EQ(closure_class.raw(), signature_class.raw());
- const Function& signature_function =
- Function::Handle(signature_class.signature_function());
- EXPECT_EQ(signature_function.raw(), function.raw());
- const Context& closure_context = Context::Handle(Closure::context(closure));
- EXPECT_EQ(closure_context.raw(), closure_context.raw());
+ EXPECT_EQ(closure_class.id(), kClosureCid);
+ const Function& closure_function = Function::Handle(closure.function());
+ EXPECT_EQ(closure_function.raw(), function.raw());
+ const Context& closure_context = Context::Handle(closure.context());
+ EXPECT_EQ(closure_context.raw(), context.raw());
}
@@ -3092,16 +3087,18 @@ TEST_CASE(SubtypeTestCache) {
SubtypeTestCache& cache = SubtypeTestCache::Handle(SubtypeTestCache::New());
EXPECT(!cache.IsNull());
EXPECT_EQ(0, cache.NumberOfChecks());
+ const Object& class_id_or_fun = Object::Handle(Smi::New(empty_class.id()));
const TypeArguments& targ_0 = TypeArguments::Handle(TypeArguments::New(2));
const TypeArguments& targ_1 = TypeArguments::Handle(TypeArguments::New(3));
- cache.AddCheck(empty_class.id(), targ_0, targ_1, Bool::True());
+ cache.AddCheck(class_id_or_fun, targ_0, targ_1, Bool::True());
EXPECT_EQ(1, cache.NumberOfChecks());
- intptr_t test_class_id = -1;
+ Object& test_class_id_or_fun = Object::Handle();
TypeArguments& test_targ_0 = TypeArguments::Handle();
TypeArguments& test_targ_1 = TypeArguments::Handle();
Bool& test_result = Bool::Handle();
- cache.GetCheck(0, &test_class_id, &test_targ_0, &test_targ_1, &test_result);
- EXPECT_EQ(empty_class.id(), test_class_id);
+ cache.GetCheck(
+ 0, &test_class_id_or_fun, &test_targ_0, &test_targ_1, &test_result);
+ EXPECT_EQ(class_id_or_fun.raw(), test_class_id_or_fun.raw());
EXPECT_EQ(targ_0.raw(), test_targ_0.raw());
EXPECT_EQ(targ_1.raw(), test_targ_1.raw());
EXPECT_EQ(Bool::True().raw(), test_result.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