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/parser.cc

Issue 16336021: Create specific null read only handles for the frequently used types (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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/object.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 23557)
+++ runtime/vm/parser.cc (working copy)
@@ -4455,7 +4455,7 @@
Library& core_lib = Library::Handle(Library::CoreLibrary());
ASSERT(!core_lib.IsNull());
const Namespace& core_ns = Namespace::Handle(
- Namespace::New(core_lib, Array::null_object(), Array::null_object()));
+ Namespace::New(core_lib, Object::null_array(), Object::null_array()));
library_.AddImport(core_ns);
}
while (CurrentToken() == Token::kPART) {
@@ -4510,8 +4510,9 @@
ParsePartHeader();
}
+ const Class& cls = Class::Handle(isolate);
while (true) {
- set_current_class(Class::null_object()); // No current class.
+ set_current_class(cls); // No current class.
SkipMetadata();
if (CurrentToken() == Token::kCLASS) {
ParseClassDeclaration(pending_classes);
@@ -8100,7 +8101,7 @@
// generated AST is not deterministic. Therefore mark the function as
// not optimizable.
current_function().set_is_optimizable(false);
- field.set_value(Instance::null_object());
+ field.set_value(Object::null_instance());
// It is a compile-time error if evaluation of a compile-time constant
// would raise an exception.
AppendErrorMsg(error, TokenPos(),
@@ -8684,8 +8685,7 @@
Type& parameterized_type = Type::Handle();
parameterized_type ^= type.raw();
parameterized_type.set_type_class(Class::Handle(Object::dynamic_class()));
- parameterized_type.set_arguments(
- AbstractTypeArguments::null_object());
+ parameterized_type.set_arguments(Object::null_abstract_type_arguments());
parameterized_type.set_malformed_error(malformed_error);
}
if (finalization >= ClassFinalizer::kTryResolve) {
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698