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

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
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 10522)
+++ 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,24 @@
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): 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()));
regis 2012/08/10 23:18:49 Add a TODO to add SmiType, MintType, and DoubleTyp
srdjan 2012/08/10 23:30:05 Done.
+ } 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()));
+ }
}

Powered by Google App Engine
This is Rietveld 408576698