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

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

Issue 10933043: Use ICData to collect type feedback on instance setter value. If value is always Smi, insert a smi … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language_ia32.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 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after
2148 2148
2149 private: 2149 private:
2150 const Field& field_; 2150 const Field& field_;
2151 2151
2152 DISALLOW_COPY_AND_ASSIGN(LoadInstanceFieldInstr); 2152 DISALLOW_COPY_AND_ASSIGN(LoadInstanceFieldInstr);
2153 }; 2153 };
2154 2154
2155 2155
2156 class StoreInstanceFieldInstr : public TemplateDefinition<2> { 2156 class StoreInstanceFieldInstr : public TemplateDefinition<2> {
2157 public: 2157 public:
2158 StoreInstanceFieldInstr(const Field& field, Value* instance, Value* value) 2158 StoreInstanceFieldInstr(const Field& field,
2159 : field_(field) { 2159 Value* instance,
2160 Value* value)
2161 : field_(field), may_need_store_barrier_(true) {
Vyacheslav Egorov (Google) 2012/09/12 10:43:43 Is there any reason for not passing it as a parame
srdjan 2012/09/12 10:52:52 Changed as suggested.
2160 ASSERT(instance != NULL); 2162 ASSERT(instance != NULL);
2161 ASSERT(value != NULL); 2163 ASSERT(value != NULL);
2162 inputs_[0] = instance; 2164 inputs_[0] = instance;
2163 inputs_[1] = value; 2165 inputs_[1] = value;
2164 } 2166 }
2165 2167
2166 DECLARE_INSTRUCTION(StoreInstanceField) 2168 DECLARE_INSTRUCTION(StoreInstanceField)
2167 virtual RawAbstractType* CompileType() const; 2169 virtual RawAbstractType* CompileType() const;
2168 2170
2169 const Field& field() const { return field_; } 2171 const Field& field() const { return field_; }
2170 2172
2171 Value* instance() const { return inputs_[0]; } 2173 Value* instance() const { return inputs_[0]; }
2172 Value* value() const { return inputs_[1]; } 2174 Value* value() const { return inputs_[1]; }
2175 bool may_need_store_barrier() const {
2176 return may_need_store_barrier_;
2177 }
2178 void set_may_need_store_barrier(bool value) {
2179 may_need_store_barrier_ = value;
2180 }
2173 2181
2174 virtual void PrintOperandsTo(BufferFormatter* f) const; 2182 virtual void PrintOperandsTo(BufferFormatter* f) const;
2175 2183
2176 virtual bool CanDeoptimize() const { return false; } 2184 virtual bool CanDeoptimize() const { return false; }
2177 virtual intptr_t ResultCid() const { return kDynamicCid; } 2185 virtual intptr_t ResultCid() const { return kDynamicCid; }
2178 2186
2179 private: 2187 private:
2180 const Field& field_; 2188 const Field& field_;
2189 bool may_need_store_barrier_;
Vyacheslav Egorov (Google) 2012/09/12 10:43:43 I would call it emit_store_barrier_
srdjan 2012/09/12 10:52:52 Done.
2181 2190
2182 DISALLOW_COPY_AND_ASSIGN(StoreInstanceFieldInstr); 2191 DISALLOW_COPY_AND_ASSIGN(StoreInstanceFieldInstr);
2183 }; 2192 };
2184 2193
2185 2194
2186 class LoadStaticFieldInstr : public TemplateDefinition<0> { 2195 class LoadStaticFieldInstr : public TemplateDefinition<0> {
2187 public: 2196 public:
2188 explicit LoadStaticFieldInstr(const Field& field) : field_(field) {} 2197 explicit LoadStaticFieldInstr(const Field& field) : field_(field) {}
2189 2198
2190 DECLARE_INSTRUCTION(LoadStaticField); 2199 DECLARE_INSTRUCTION(LoadStaticField);
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after
3448 ForwardInstructionIterator* current_iterator_; 3457 ForwardInstructionIterator* current_iterator_;
3449 3458
3450 private: 3459 private:
3451 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 3460 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
3452 }; 3461 };
3453 3462
3454 3463
3455 } // namespace dart 3464 } // namespace dart
3456 3465
3457 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 3466 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698