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

Side by Side Diff: runtime/vm/intermediate_language.h

Issue 11416129: Inline [] operator on one-byte strings. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 22 matching lines...) Expand all
33 // (class-name, function-name, recognized enum, fingerprint). 33 // (class-name, function-name, recognized enum, fingerprint).
34 // See intrinsifier for fingerprint computation. 34 // See intrinsifier for fingerprint computation.
35 #define RECOGNIZED_LIST(V) \ 35 #define RECOGNIZED_LIST(V) \
36 V(_ObjectArray, get:length, ObjectArrayLength, 405297088) \ 36 V(_ObjectArray, get:length, ObjectArrayLength, 405297088) \
37 V(_ImmutableArray, get:length, ImmutableArrayLength, 433698233) \ 37 V(_ImmutableArray, get:length, ImmutableArrayLength, 433698233) \
38 V(_GrowableObjectArray, get:length, GrowableArrayLength, 725548050) \ 38 V(_GrowableObjectArray, get:length, GrowableArrayLength, 725548050) \
39 V(_GrowableObjectArray, get:capacity, GrowableArrayCapacity, 725548050) \ 39 V(_GrowableObjectArray, get:capacity, GrowableArrayCapacity, 725548050) \
40 V(_StringBase, get:length, StringBaseLength, 320803993) \ 40 V(_StringBase, get:length, StringBaseLength, 320803993) \
41 V(_StringBase, get:isEmpty, StringBaseIsEmpty, 1065961093) \ 41 V(_StringBase, get:isEmpty, StringBaseIsEmpty, 1065961093) \
42 V(_StringBase, charCodeAt, StringBaseCharCodeAt, 984449525) \ 42 V(_StringBase, charCodeAt, StringBaseCharCodeAt, 984449525) \
43 V(_StringBase, [], StringBaseCharAt, 1062366987) \
43 V(_IntegerImplementation, toDouble, IntegerToDouble, 1396338041) \ 44 V(_IntegerImplementation, toDouble, IntegerToDouble, 1396338041) \
44 V(_Double, toInt, DoubleToInteger, 362666636) \ 45 V(_Double, toInt, DoubleToInteger, 362666636) \
45 V(::, sqrt, MathSqrt, 2232519) \ 46 V(::, sqrt, MathSqrt, 2232519) \
46 47
47 // Class that recognizes the name and owner of a function and returns the 48 // Class that recognizes the name and owner of a function and returns the
48 // corresponding enum. See RECOGNIZED_LIST above for list of recognizable 49 // corresponding enum. See RECOGNIZED_LIST above for list of recognizable
49 // functions. 50 // functions.
50 class MethodRecognizer : public AllStatic { 51 class MethodRecognizer : public AllStatic {
51 public: 52 public:
52 enum Kind { 53 enum Kind {
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 M(MathSqrt) \ 260 M(MathSqrt) \
260 M(UnboxDouble) \ 261 M(UnboxDouble) \
261 M(BoxDouble) \ 262 M(BoxDouble) \
262 M(UnboxInteger) \ 263 M(UnboxInteger) \
263 M(BoxInteger) \ 264 M(BoxInteger) \
264 M(BinaryMintOp) \ 265 M(BinaryMintOp) \
265 M(ShiftMintOp) \ 266 M(ShiftMintOp) \
266 M(UnaryMintOp) \ 267 M(UnaryMintOp) \
267 M(CheckArrayBound) \ 268 M(CheckArrayBound) \
268 M(Constraint) \ 269 M(Constraint) \
269 M(StringCharCodeAt) 270 M(StringCharCodeAt) \
271 M(StringFromCharCode)
270 272
271 273
272 #define FORWARD_DECLARATION(type) class type##Instr; 274 #define FORWARD_DECLARATION(type) class type##Instr;
273 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION) 275 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION)
274 #undef FORWARD_DECLARATION 276 #undef FORWARD_DECLARATION
275 277
276 278
277 // Functions required in all concrete instruction classes. 279 // Functions required in all concrete instruction classes.
278 #define DECLARE_INSTRUCTION(type) \ 280 #define DECLARE_INSTRUCTION(type) \
279 virtual Tag tag() const { return k##type; } \ 281 virtual Tag tag() const { return k##type; } \
(...skipping 2397 matching lines...) Expand 10 before | Expand all | Expand 10 after
2677 2679
2678 virtual bool AffectedBySideEffect() const { return true; } 2680 virtual bool AffectedBySideEffect() const { return true; }
2679 2681
2680 private: 2682 private:
2681 const intptr_t class_id_; 2683 const intptr_t class_id_;
2682 2684
2683 DISALLOW_COPY_AND_ASSIGN(StringCharCodeAtInstr); 2685 DISALLOW_COPY_AND_ASSIGN(StringCharCodeAtInstr);
2684 }; 2686 };
2685 2687
2686 2688
2689 class StringFromCharCodeInstr : public TemplateDefinition<1> {
2690 public:
2691 explicit StringFromCharCodeInstr(Value* char_code) {
2692 ASSERT(char_code != NULL);
2693 ASSERT(char_code->definition()->IsStringCharCodeAt() &&
2694 (char_code->definition()->AsStringCharCodeAt()->class_id() ==
2695 kOneByteStringCid));
2696 inputs_[0] = char_code;
2697 }
2698
2699 DECLARE_INSTRUCTION(StringFromCharCode)
2700 virtual RawAbstractType* CompileType() const;
2701
2702 Value* char_code() const { return inputs_[0]; }
2703
2704 virtual bool CanDeoptimize() const { return false; }
2705
2706 virtual bool HasSideEffect() const { return false; }
2707
2708 virtual intptr_t ResultCid() const;
2709
2710 virtual bool AttributesEqual(Instruction* other) const { return true; }
2711
2712 virtual bool AffectedBySideEffect() const { return false; }
2713
2714 private:
2715 DISALLOW_COPY_AND_ASSIGN(StringFromCharCodeInstr);
2716 };
2717
2718
2687 class LoadIndexedInstr : public TemplateDefinition<2> { 2719 class LoadIndexedInstr : public TemplateDefinition<2> {
2688 public: 2720 public:
2689 LoadIndexedInstr(Value* array, Value* index, intptr_t class_id) 2721 LoadIndexedInstr(Value* array, Value* index, intptr_t class_id)
2690 : class_id_(class_id) { 2722 : class_id_(class_id) {
2691 ASSERT(array != NULL); 2723 ASSERT(array != NULL);
2692 ASSERT(index != NULL); 2724 ASSERT(index != NULL);
2693 inputs_[0] = array; 2725 inputs_[0] = array;
2694 inputs_[1] = index; 2726 inputs_[1] = index;
2695 } 2727 }
2696 2728
(...skipping 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after
4243 ForwardInstructionIterator* current_iterator_; 4275 ForwardInstructionIterator* current_iterator_;
4244 4276
4245 private: 4277 private:
4246 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 4278 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
4247 }; 4279 };
4248 4280
4249 4281
4250 } // namespace dart 4282 } // namespace dart
4251 4283
4252 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 4284 #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