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

Unified Diff: runtime/vm/intermediate_language.h

Issue 285543002: Recognize List constructor and turn it into CreateArray ... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
===================================================================
--- runtime/vm/intermediate_language.h (revision 36136)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -43,6 +43,7 @@
V(Object, get:_cid, ObjectCid, 1498751301) \
V(_TypedListBase, get:_cid, TypedListBaseCid, 1938244762) \
V(_List, get:length, ObjectArrayLength, 215183186) \
+ V(_List, _List., ObjectArrayConstructor, 176587978) \
V(_ImmutableList, get:length, ImmutableArrayLength, 578762861) \
V(_TypedList, get:length, TypedDataLength, 26646119) \
V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 272598802) \
@@ -4369,18 +4370,20 @@
DECLARE_INSTRUCTION(CreateArray)
virtual CompileType ComputeType() const;
-
virtual intptr_t token_pos() const { return token_pos_; }
Value* element_type() const { return inputs_[kElementTypePos]; }
Value* num_elements() const { return inputs_[kLengthPos]; }
virtual void PrintOperandsTo(BufferFormatter* f) const;
- virtual bool CanDeoptimize() const { return false; }
+ // Throw needs environment, which is created only if instruction can
+ // deoptimize.
+ virtual bool CanDeoptimize() const { return MayThrow(); }
virtual EffectSet Effects() const { return EffectSet::None(); }
- virtual bool MayThrow() const { return false; }
+ // TODO(srdjan): return false if length is a positive Smi.
+ virtual bool MayThrow() const { return true; }
virtual AliasIdentity Identity() const { return identity_; }
virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; }
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698