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

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

Issue 11412284: Add result cid to StringFromCharCode. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 2687 matching lines...) Expand 10 before | Expand all | Expand 10 after
2698 2698
2699 private: 2699 private:
2700 const intptr_t class_id_; 2700 const intptr_t class_id_;
2701 2701
2702 DISALLOW_COPY_AND_ASSIGN(StringCharCodeAtInstr); 2702 DISALLOW_COPY_AND_ASSIGN(StringCharCodeAtInstr);
2703 }; 2703 };
2704 2704
2705 2705
2706 class StringFromCharCodeInstr : public TemplateDefinition<1> { 2706 class StringFromCharCodeInstr : public TemplateDefinition<1> {
2707 public: 2707 public:
2708 explicit StringFromCharCodeInstr(Value* char_code) { 2708 explicit StringFromCharCodeInstr(Value* char_code,
2709 intptr_t cid) : cid_(cid) {
2709 ASSERT(char_code != NULL); 2710 ASSERT(char_code != NULL);
2710 ASSERT(char_code->definition()->IsStringCharCodeAt() && 2711 ASSERT(char_code->definition()->IsStringCharCodeAt() &&
2711 (char_code->definition()->AsStringCharCodeAt()->class_id() == 2712 (char_code->definition()->AsStringCharCodeAt()->class_id() ==
2712 kOneByteStringCid)); 2713 kOneByteStringCid));
2713 inputs_[0] = char_code; 2714 inputs_[0] = char_code;
2714 } 2715 }
2715 2716
2716 DECLARE_INSTRUCTION(StringFromCharCode) 2717 DECLARE_INSTRUCTION(StringFromCharCode)
2717 virtual RawAbstractType* CompileType() const; 2718 virtual RawAbstractType* CompileType() const;
2718 2719
2719 Value* char_code() const { return inputs_[0]; } 2720 Value* char_code() const { return inputs_[0]; }
2720 2721
2721 virtual bool CanDeoptimize() const { return false; } 2722 virtual bool CanDeoptimize() const { return false; }
2722 2723
2723 virtual bool HasSideEffect() const { return false; } 2724 virtual bool HasSideEffect() const { return false; }
2724 2725
2725 virtual intptr_t ResultCid() const; 2726 virtual intptr_t ResultCid() const { return cid_; }
2726 2727
2727 virtual bool AttributesEqual(Instruction* other) const { return true; } 2728 virtual bool AttributesEqual(Instruction* other) const { return true; }
2728 2729
2729 virtual bool AffectedBySideEffect() const { return false; } 2730 virtual bool AffectedBySideEffect() const { return false; }
2730 2731
2731 private: 2732 private:
2733 const intptr_t cid_;
2734
2732 DISALLOW_COPY_AND_ASSIGN(StringFromCharCodeInstr); 2735 DISALLOW_COPY_AND_ASSIGN(StringFromCharCodeInstr);
2733 }; 2736 };
2734 2737
2735 2738
2736 class LoadIndexedInstr : public TemplateDefinition<2> { 2739 class LoadIndexedInstr : public TemplateDefinition<2> {
2737 public: 2740 public:
2738 LoadIndexedInstr(Value* array, Value* index, intptr_t class_id) 2741 LoadIndexedInstr(Value* array, Value* index, intptr_t class_id)
2739 : class_id_(class_id) { 2742 : class_id_(class_id) {
2740 ASSERT(array != NULL); 2743 ASSERT(array != NULL);
2741 ASSERT(index != NULL); 2744 ASSERT(index != NULL);
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after
4294 ForwardInstructionIterator* current_iterator_; 4297 ForwardInstructionIterator* current_iterator_;
4295 4298
4296 private: 4299 private:
4297 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 4300 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
4298 }; 4301 };
4299 4302
4300 4303
4301 } // namespace dart 4304 } // namespace dart
4302 4305
4303 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 4306 #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