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

Unified Diff: runtime/vm/object.cc

Issue 11826024: Clean up uses of X::CheckedHandle where X::Cast or X::Handle is sufficient. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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.h ('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.cc
===================================================================
--- runtime/vm/object.cc (revision 16802)
+++ runtime/vm/object.cc (working copy)
@@ -5785,7 +5785,7 @@
RawClass* Library::LookupClass(const String& name) const {
Object& obj = Object::Handle(LookupObject(name));
if (!obj.IsNull() && obj.IsClass()) {
- return Class::CheckedHandle(obj.raw()).raw();
+ return Class::Cast(obj).raw();
}
return Class::null();
}
@@ -5794,7 +5794,7 @@
RawClass* Library::LookupLocalClass(const String& name) const {
Object& obj = Object::Handle(LookupLocalObject(name));
if (!obj.IsNull() && obj.IsClass()) {
- return Class::CheckedHandle(obj.raw()).raw();
+ return Class::Cast(obj).raw();
}
return Class::null();
}
@@ -6246,7 +6246,8 @@
RawLibrary* LibraryPrefix::GetLibrary(int index) const {
if ((index >= 0) || (index < num_imports())) {
const Array& imports = Array::Handle(this->imports());
- const Namespace& import = Namespace::CheckedHandle(imports.At(index));
+ Namespace& import = Namespace::Handle();
+ import ^= imports.At(index);
return import.library();
}
return Library::null();
@@ -6778,7 +6779,8 @@
ASSERT(var_index < Length());
const Array& names = Array::Handle(raw_ptr()->names_);
ASSERT(Length() == names.Length());
- const String& name = String::CheckedHandle(names.At(var_index));
+ String& name = String::Handle();
+ name ^= names.At(var_index);
return name.raw();
}
@@ -7055,8 +7057,9 @@
intptr_t Code::Comments::PCOffsetAt(intptr_t idx) const {
- return Smi::CheckedHandle(
- comments_.At(idx * kNumberOfEntries + kPCOffsetEntry)).Value();
+ Smi& result = Smi::Handle();
+ result ^= comments_.At(idx * kNumberOfEntries + kPCOffsetEntry);
+ return result.Value();
}
@@ -7066,9 +7069,10 @@
}
-const String& Code::Comments::CommentAt(intptr_t idx) const {
- return String::CheckedHandle(
- comments_.At(idx * kNumberOfEntries + kCommentEntry));
+RawString* Code::Comments::CommentAt(intptr_t idx) const {
+ String& result = String::Handle();
+ result ^= comments_.At(idx * kNumberOfEntries + kCommentEntry);
+ return result.raw();
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698