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

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

Issue 10910252: Improve register usage for StoreInstanceField. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Addressed comment and improved StoreIndexed as well. 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_compiler.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 inputs_[1] = value; 2148 inputs_[1] = value;
2149 } 2149 }
2150 2150
2151 DECLARE_INSTRUCTION(StoreInstanceField) 2151 DECLARE_INSTRUCTION(StoreInstanceField)
2152 virtual RawAbstractType* CompileType() const; 2152 virtual RawAbstractType* CompileType() const;
2153 2153
2154 const Field& field() const { return field_; } 2154 const Field& field() const { return field_; }
2155 2155
2156 Value* instance() const { return inputs_[0]; } 2156 Value* instance() const { return inputs_[0]; }
2157 Value* value() const { return inputs_[1]; } 2157 Value* value() const { return inputs_[1]; }
2158 bool emit_store_barrier() const { 2158 bool ShouldEmitStoreBarrier() const {
2159 return emit_store_barrier_; 2159 return value()->NeedsStoreBuffer() && emit_store_barrier_;
2160 } 2160 }
2161 2161
2162 virtual void PrintOperandsTo(BufferFormatter* f) const; 2162 virtual void PrintOperandsTo(BufferFormatter* f) const;
2163 2163
2164 virtual bool CanDeoptimize() const { return false; } 2164 virtual bool CanDeoptimize() const { return false; }
2165 virtual intptr_t ResultCid() const { return kDynamicCid; } 2165 virtual intptr_t ResultCid() const { return kDynamicCid; }
2166 2166
2167 private: 2167 private:
2168 const Field& field_; 2168 const Field& field_;
2169 const bool emit_store_barrier_; 2169 const bool emit_store_barrier_;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
2258 inputs_[2] = value; 2258 inputs_[2] = value;
2259 } 2259 }
2260 2260
2261 DECLARE_INSTRUCTION(StoreIndexed) 2261 DECLARE_INSTRUCTION(StoreIndexed)
2262 virtual RawAbstractType* CompileType() const; 2262 virtual RawAbstractType* CompileType() const;
2263 2263
2264 Value* array() const { return inputs_[0]; } 2264 Value* array() const { return inputs_[0]; }
2265 Value* index() const { return inputs_[1]; } 2265 Value* index() const { return inputs_[1]; }
2266 Value* value() const { return inputs_[2]; } 2266 Value* value() const { return inputs_[2]; }
2267 2267
2268 bool emit_store_barrier() const { return emit_store_barrier_; } 2268 bool ShouldEmitStoreBarrier() const {
2269 return value()->NeedsStoreBuffer() && emit_store_barrier_;
2270 }
2269 2271
2270 virtual bool CanDeoptimize() const { return false; } 2272 virtual bool CanDeoptimize() const { return false; }
2271 virtual intptr_t ResultCid() const { return kDynamicCid; } 2273 virtual intptr_t ResultCid() const { return kDynamicCid; }
2272 2274
2273 private: 2275 private:
2274 const bool emit_store_barrier_; 2276 const bool emit_store_barrier_;
2275 2277
2276 DISALLOW_COPY_AND_ASSIGN(StoreIndexedInstr); 2278 DISALLOW_COPY_AND_ASSIGN(StoreIndexedInstr);
2277 }; 2279 };
2278 2280
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after
3439 ForwardInstructionIterator* current_iterator_; 3441 ForwardInstructionIterator* current_iterator_;
3440 3442
3441 private: 3443 private:
3442 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 3444 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
3443 }; 3445 };
3444 3446
3445 3447
3446 } // namespace dart 3448 } // namespace dart
3447 3449
3448 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 3450 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698