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

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

Issue 563973004: Call special VM interpolate for single element interpolation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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
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 3782 matching lines...) Expand 10 before | Expand all | Expand 10 after
3793 3793
3794 private: 3794 private:
3795 const intptr_t cid_; 3795 const intptr_t cid_;
3796 3796
3797 DISALLOW_COPY_AND_ASSIGN(StringToCharCodeInstr); 3797 DISALLOW_COPY_AND_ASSIGN(StringToCharCodeInstr);
3798 }; 3798 };
3799 3799
3800 3800
3801 class StringInterpolateInstr : public TemplateDefinition<1> { 3801 class StringInterpolateInstr : public TemplateDefinition<1> {
3802 public: 3802 public:
3803 StringInterpolateInstr(Value* value, intptr_t token_pos) 3803 StringInterpolateInstr(Value* value, intptr_t token_pos, bool singleton)
3804 : token_pos_(token_pos), function_(Function::Handle()) { 3804 : token_pos_(token_pos),
3805 function_(Function::Handle()),
3806 singleton_(singleton) {
3805 SetInputAt(0, value); 3807 SetInputAt(0, value);
3806 } 3808 }
3807 3809
3810 bool IsSingleton() const { return singleton_; }
Florian Schneider 2014/09/12 10:33:37 This accessor may be removed if not needed.
Lasse Reichstein Nielsen 2014/09/12 12:49:39 Done.
3811
3808 Value* value() const { return inputs_[0]; } 3812 Value* value() const { return inputs_[0]; }
3809 virtual intptr_t token_pos() const { return token_pos_; } 3813 virtual intptr_t token_pos() const { return token_pos_; }
3810 3814
3811 virtual CompileType ComputeType() const; 3815 virtual CompileType ComputeType() const;
3812 // Issues a static call to Dart code which calls toString on objects. 3816 // Issues a static call to Dart code which calls toString on objects.
3813 virtual EffectSet Effects() const { return EffectSet::All(); } 3817 virtual EffectSet Effects() const { return EffectSet::All(); }
3814 virtual bool CanDeoptimize() const { return true; } 3818 virtual bool CanDeoptimize() const { return true; }
3815 virtual bool MayThrow() const { return true; } 3819 virtual bool MayThrow() const { return true; }
3816 3820
3817 const Function& CallFunction() const; 3821 const Function& CallFunction() const;
3818 3822
3819 virtual Definition* Canonicalize(FlowGraph* flow_graph); 3823 virtual Definition* Canonicalize(FlowGraph* flow_graph);
3820 3824
3821 DECLARE_INSTRUCTION(StringInterpolate) 3825 DECLARE_INSTRUCTION(StringInterpolate)
3822 3826
3823 private: 3827 private:
3824 const intptr_t token_pos_; 3828 const intptr_t token_pos_;
3825 Function& function_; 3829 Function& function_;
3830 const bool singleton_;
Florian Schneider 2014/09/12 10:33:37 I'd rename singleton_ to is_singleton_ for consist
Lasse Reichstein Nielsen 2014/09/12 12:49:39 Done.
3826 3831
3827 DISALLOW_COPY_AND_ASSIGN(StringInterpolateInstr); 3832 DISALLOW_COPY_AND_ASSIGN(StringInterpolateInstr);
3828 }; 3833 };
3829 3834
3830 3835
3831 class StoreIndexedInstr : public TemplateDefinition<3> { 3836 class StoreIndexedInstr : public TemplateDefinition<3> {
3832 public: 3837 public:
3833 StoreIndexedInstr(Value* array, 3838 StoreIndexedInstr(Value* array,
3834 Value* index, 3839 Value* index,
3835 Value* value, 3840 Value* value,
(...skipping 4614 matching lines...) Expand 10 before | Expand all | Expand 10 after
8450 Isolate* isolate, bool opt) const { \ 8455 Isolate* isolate, bool opt) const { \
8451 UNIMPLEMENTED(); \ 8456 UNIMPLEMENTED(); \
8452 return NULL; \ 8457 return NULL; \
8453 } \ 8458 } \
8454 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } 8459 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); }
8455 8460
8456 8461
8457 } // namespace dart 8462 } // namespace dart
8458 8463
8459 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 8464 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698