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

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

Issue 10860007: Reland "Record the arguments for CreateArrayComp correctly as arguments.". (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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/il_printer.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 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 const intptr_t try_index_; 1240 const intptr_t try_index_;
1241 1241
1242 DISALLOW_COPY_AND_ASSIGN(AllocateObjectWithBoundsCheckComp); 1242 DISALLOW_COPY_AND_ASSIGN(AllocateObjectWithBoundsCheckComp);
1243 }; 1243 };
1244 1244
1245 1245
1246 class CreateArrayComp : public TemplateComputation<1> { 1246 class CreateArrayComp : public TemplateComputation<1> {
1247 public: 1247 public:
1248 CreateArrayComp(intptr_t token_pos, 1248 CreateArrayComp(intptr_t token_pos,
1249 intptr_t try_index, 1249 intptr_t try_index,
1250 ZoneGrowableArray<Value*>* elements, 1250 ZoneGrowableArray<PushArgumentInstr*>* arguments,
1251 Value* element_type) 1251 Value* element_type)
1252 : token_pos_(token_pos), 1252 : token_pos_(token_pos),
1253 try_index_(try_index), 1253 try_index_(try_index),
1254 elements_(elements) { 1254 arguments_(arguments) {
1255 #if defined(DEBUG) 1255 #if defined(DEBUG)
1256 for (int i = 0; i < ElementCount(); ++i) { 1256 for (int i = 0; i < ArgumentCount(); ++i) {
1257 ASSERT(ElementAt(i) != NULL); 1257 ASSERT(ArgumentAt(i) != NULL);
1258 } 1258 }
1259 ASSERT(element_type != NULL); 1259 ASSERT(element_type != NULL);
1260 #endif 1260 #endif
1261 inputs_[0] = element_type; 1261 inputs_[0] = element_type;
1262 } 1262 }
1263 1263
1264 DECLARE_CALL_COMPUTATION(CreateArray) 1264 DECLARE_CALL_COMPUTATION(CreateArray)
1265 1265
1266 virtual intptr_t ArgumentCount() const { return ElementCount(); } 1266 virtual intptr_t ArgumentCount() const { return arguments_->length(); }
1267 1267
1268 intptr_t token_pos() const { return token_pos_; } 1268 intptr_t token_pos() const { return token_pos_; }
1269 intptr_t try_index() const { return try_index_; } 1269 intptr_t try_index() const { return try_index_; }
1270 intptr_t ElementCount() const { return elements_->length(); } 1270 PushArgumentInstr* ArgumentAt(intptr_t i) const { return (*arguments_)[i]; }
1271 Value* ElementAt(intptr_t i) const { return (*elements_)[i]; }
1272 Value* element_type() const { return inputs_[0]; } 1271 Value* element_type() const { return inputs_[0]; }
1273 1272
1274 virtual void PrintOperandsTo(BufferFormatter* f) const; 1273 virtual void PrintOperandsTo(BufferFormatter* f) const;
1275 1274
1276 virtual bool CanDeoptimize() const { return false; } 1275 virtual bool CanDeoptimize() const { return false; }
1277 1276
1278 private: 1277 private:
1279 const intptr_t token_pos_; 1278 const intptr_t token_pos_;
1280 const intptr_t try_index_; 1279 const intptr_t try_index_;
1281 ZoneGrowableArray<Value*>* const elements_; 1280 ZoneGrowableArray<PushArgumentInstr*>* const arguments_;
1282 1281
1283 DISALLOW_COPY_AND_ASSIGN(CreateArrayComp); 1282 DISALLOW_COPY_AND_ASSIGN(CreateArrayComp);
1284 }; 1283 };
1285 1284
1286 1285
1287 class CreateClosureComp : public TemplateComputation<0> { 1286 class CreateClosureComp : public TemplateComputation<0> {
1288 public: 1287 public:
1289 CreateClosureComp(ClosureNode* node, 1288 CreateClosureComp(ClosureNode* node,
1290 intptr_t try_index, 1289 intptr_t try_index,
1291 ZoneGrowableArray<PushArgumentInstr*>* arguments) 1290 ZoneGrowableArray<PushArgumentInstr*>* arguments)
(...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after
2965 ForwardInstructionIterator* current_iterator_; 2964 ForwardInstructionIterator* current_iterator_;
2966 2965
2967 private: 2966 private:
2968 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 2967 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
2969 }; 2968 };
2970 2969
2971 2970
2972 } // namespace dart 2971 } // namespace dart
2973 2972
2974 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 2973 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698