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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_
6 #define VM_INTERMEDIATE_LANGUAGE_H_ 6 #define VM_INTERMEDIATE_LANGUAGE_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/ast.h" 9 #include "vm/ast.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 25 matching lines...) Expand all
36 // TODO(srdjan): Unify with INTRINSIC_LIST. 36 // TODO(srdjan): Unify with INTRINSIC_LIST.
37 // (class-name, function-name, recognized enum, fingerprint). 37 // (class-name, function-name, recognized enum, fingerprint).
38 // See intrinsifier for fingerprint computation. 38 // See intrinsifier for fingerprint computation.
39 #define RECOGNIZED_LIST(V) \ 39 #define RECOGNIZED_LIST(V) \
40 V(::, identical, ObjectIdentical, 496869842) \ 40 V(::, identical, ObjectIdentical, 496869842) \
41 V(Object, ==, ObjectEquals, 1068471689) \ 41 V(Object, ==, ObjectEquals, 1068471689) \
42 V(Object, Object., ObjectConstructor, 1058615085) \ 42 V(Object, Object., ObjectConstructor, 1058615085) \
43 V(Object, get:_cid, ObjectCid, 1498751301) \ 43 V(Object, get:_cid, ObjectCid, 1498751301) \
44 V(_TypedListBase, get:_cid, TypedListBaseCid, 1938244762) \ 44 V(_TypedListBase, get:_cid, TypedListBaseCid, 1938244762) \
45 V(_List, get:length, ObjectArrayLength, 215183186) \ 45 V(_List, get:length, ObjectArrayLength, 215183186) \
46 V(_List, _List., ObjectArrayConstructor, 176587978) \
46 V(_ImmutableList, get:length, ImmutableArrayLength, 578762861) \ 47 V(_ImmutableList, get:length, ImmutableArrayLength, 578762861) \
47 V(_TypedList, get:length, TypedDataLength, 26646119) \ 48 V(_TypedList, get:length, TypedDataLength, 26646119) \
48 V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 272598802) \ 49 V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 272598802) \
49 V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 831354841) \ 50 V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 831354841) \
50 V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 1832126257) \ 51 V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 1832126257) \
51 V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 1762714698) \ 52 V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 1762714698) \
52 V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 48785449) \ 53 V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 48785449) \
53 V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 1392579206) \ 54 V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 1392579206) \
54 V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 185163470) \ 55 V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 185163470) \
55 V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 1356392173) \ 56 V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 1356392173) \
(...skipping 4306 matching lines...) Expand 10 before | Expand all | Expand 10 after
4362 } 4363 }
4363 4364
4364 enum { 4365 enum {
4365 kElementTypePos = 0, 4366 kElementTypePos = 0,
4366 kLengthPos = 1 4367 kLengthPos = 1
4367 }; 4368 };
4368 4369
4369 DECLARE_INSTRUCTION(CreateArray) 4370 DECLARE_INSTRUCTION(CreateArray)
4370 virtual CompileType ComputeType() const; 4371 virtual CompileType ComputeType() const;
4371 4372
4372
4373 virtual intptr_t token_pos() const { return token_pos_; } 4373 virtual intptr_t token_pos() const { return token_pos_; }
4374 Value* element_type() const { return inputs_[kElementTypePos]; } 4374 Value* element_type() const { return inputs_[kElementTypePos]; }
4375 Value* num_elements() const { return inputs_[kLengthPos]; } 4375 Value* num_elements() const { return inputs_[kLengthPos]; }
4376 4376
4377 virtual void PrintOperandsTo(BufferFormatter* f) const; 4377 virtual void PrintOperandsTo(BufferFormatter* f) const;
4378 4378
4379 virtual bool CanDeoptimize() const { return false; } 4379 // Throw needs environment, which is created only if instruction can
4380 // deoptimize.
4381 virtual bool CanDeoptimize() const { return MayThrow(); }
4380 4382
4381 virtual EffectSet Effects() const { return EffectSet::None(); } 4383 virtual EffectSet Effects() const { return EffectSet::None(); }
4382 4384
4383 virtual bool MayThrow() const { return false; } 4385 // TODO(srdjan): return false if length is a positive Smi.
4386 virtual bool MayThrow() const { return true; }
4384 4387
4385 virtual AliasIdentity Identity() const { return identity_; } 4388 virtual AliasIdentity Identity() const { return identity_; }
4386 virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; } 4389 virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; }
4387 4390
4388 private: 4391 private:
4389 const intptr_t token_pos_; 4392 const intptr_t token_pos_;
4390 AliasIdentity identity_; 4393 AliasIdentity identity_;
4391 4394
4392 DISALLOW_COPY_AND_ASSIGN(CreateArrayInstr); 4395 DISALLOW_COPY_AND_ASSIGN(CreateArrayInstr);
4393 }; 4396 };
(...skipping 3567 matching lines...) Expand 10 before | Expand all | Expand 10 after
7961 ForwardInstructionIterator* current_iterator_; 7964 ForwardInstructionIterator* current_iterator_;
7962 7965
7963 private: 7966 private:
7964 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 7967 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
7965 }; 7968 };
7966 7969
7967 7970
7968 } // namespace dart 7971 } // namespace dart
7969 7972
7970 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 7973 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« 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