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

Unified Diff: runtime/vm/object.cc

Issue 1956453002: Change Type::signature to not allocate a handle and instead use the cid value. (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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 6ec65ee6f014e2aa268816f2b1c90f605e21b7d9..0ba720942857cf500630f1d7661fbd2c2181436d 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -16390,14 +16390,14 @@ void Type::set_error(const LanguageError& value) const {
RawFunction* Type::signature() const {
- if (raw_ptr()->sig_or_err_.signature_ == Function::null()) {
+ intptr_t cid = raw_ptr()->sig_or_err_.signature_->GetClassId();
+ if (cid == kNullCid) {
return Function::null();
}
- const Object& obj = Object::Handle(raw_ptr()->sig_or_err_.signature_);
- if (obj.IsFunction()) {
- return Function::RawCast(obj.raw());
+ if (cid == kFunctionCid) {
+ return Function::RawCast(raw_ptr()->sig_or_err_.signature_);
}
- ASSERT(obj.IsLanguageError()); // Type is malformed or malbounded.
+ ASSERT(cid == kLanguageErrorCid); // Type is malformed or malbounded.
return Function::null();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698