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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 10823278: Use type propagation for removing Smi checks in binary operations and comparisons. Regis will adapt… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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/il_printer.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 10541)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -11,6 +11,7 @@
#include "vm/flow_graph_compiler.h"
#include "vm/locations.h"
#include "vm/object.h"
+#include "vm/object_store.h"
#include "vm/os.h"
#include "vm/scopes.h"
#include "vm/stub_code.h"
@@ -767,13 +768,25 @@
RawAbstractType* CheckStackOverflowComp::CompileType() const {
- return Type::VoidType();
+ return AbstractType::null();
}
RawAbstractType* BinaryOpComp::CompileType() const {
- // TODO(srdjan): Compute based on input types (ICData).
- return Type::DynamicType();
+ // TODO(srdjan): Add mint, smi and double type to object store.
+ // TODO(srdjan): Convert to use with class-ids instead of types.
+ if (operands_type() == kMintOperands) {
+ ObjectStore* object_store = Isolate::Current()->object_store();
+ return Type::NewNonParameterizedType(
+ Class::Handle(object_store->mint_class()));
+ } else if (op_kind() == Token::kSHL) {
+ return Type::IntInterface();
+ } else {
+ ASSERT(operands_type() == kSmiOperands);
+ ObjectStore* object_store = Isolate::Current()->object_store();
+ return Type::NewNonParameterizedType(
+ Class::Handle(object_store->smi_class()));
+ }
}
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698