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: src/mips/lithium-mips.h

Issue 17504002: MIPS: Lithium codegen should not pass around block_ids. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 | « src/mips/lithium-codegen-mips.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { 481 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> {
482 public: 482 public:
483 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } 483 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; }
484 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") 484 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
485 }; 485 };
486 486
487 487
488 template<int I, int T> 488 template<int I, int T>
489 class LControlInstruction: public LTemplateInstruction<0, I, T> { 489 class LControlInstruction: public LTemplateInstruction<0, I, T> {
490 public: 490 public:
491 LControlInstruction() : false_label_(NULL), true_label_(NULL) { }
492
491 virtual bool IsControl() const { return true; } 493 virtual bool IsControl() const { return true; }
492 494
493 int SuccessorCount() { return hydrogen()->SuccessorCount(); } 495 int SuccessorCount() { return hydrogen()->SuccessorCount(); }
494 HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); } 496 HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); }
495 int true_block_id() { return hydrogen()->SuccessorAt(0)->block_id(); } 497
496 int false_block_id() { return hydrogen()->SuccessorAt(1)->block_id(); } 498 int TrueDestination(LChunk* chunk) {
499 return chunk->LookupDestination(true_block_id());
500 }
501 int FalseDestination(LChunk* chunk) {
502 return chunk->LookupDestination(false_block_id());
503 }
504
505 Label* TrueLabel(LChunk* chunk) {
506 if (true_label_ == NULL) {
507 true_label_ = chunk->GetAssemblyLabel(TrueDestination(chunk));
508 }
509 return true_label_;
510 }
511 Label* FalseLabel(LChunk* chunk) {
512 if (false_label_ == NULL) {
513 false_label_ = chunk->GetAssemblyLabel(FalseDestination(chunk));
514 }
515 return false_label_;
516 }
517
518 protected:
519 int true_block_id() { return SuccessorAt(0)->block_id(); }
520 int false_block_id() { return SuccessorAt(1)->block_id(); }
497 521
498 private: 522 private:
499 HControlInstruction* hydrogen() { 523 HControlInstruction* hydrogen() {
500 return HControlInstruction::cast(this->hydrogen_value()); 524 return HControlInstruction::cast(this->hydrogen_value());
501 } 525 }
526
527 Label* false_label_;
528 Label* true_label_;
502 }; 529 };
503 530
504 531
505 class LWrapReceiver: public LTemplateInstruction<1, 2, 0> { 532 class LWrapReceiver: public LTemplateInstruction<1, 2, 0> {
506 public: 533 public:
507 LWrapReceiver(LOperand* receiver, LOperand* function) { 534 LWrapReceiver(LOperand* receiver, LOperand* function) {
508 inputs_[0] = receiver; 535 inputs_[0] = receiver;
509 inputs_[1] = function; 536 inputs_[1] = function;
510 } 537 }
511 538
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 1236
1210 LOperand* value() { return inputs_[0]; } 1237 LOperand* value() { return inputs_[0]; }
1211 1238
1212 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") 1239 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
1213 DECLARE_HYDROGEN_ACCESSOR(Branch) 1240 DECLARE_HYDROGEN_ACCESSOR(Branch)
1214 1241
1215 virtual void PrintDataTo(StringStream* stream); 1242 virtual void PrintDataTo(StringStream* stream);
1216 }; 1243 };
1217 1244
1218 1245
1219 class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 1> { 1246 class LCmpMapAndBranch: public LControlInstruction<1, 1> {
1220 public: 1247 public:
1221 LCmpMapAndBranch(LOperand* value, LOperand* temp) { 1248 LCmpMapAndBranch(LOperand* value, LOperand* temp) {
1222 inputs_[0] = value; 1249 inputs_[0] = value;
1223 temps_[0] = temp; 1250 temps_[0] = temp;
1224 } 1251 }
1225 1252
1226 LOperand* value() { return inputs_[0]; } 1253 LOperand* value() { return inputs_[0]; }
1227 LOperand* temp() { return temps_[0]; } 1254 LOperand* temp() { return temps_[0]; }
1228 1255
1229 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") 1256 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
1230 DECLARE_HYDROGEN_ACCESSOR(CompareMap) 1257 DECLARE_HYDROGEN_ACCESSOR(CompareMap)
1231 1258
1232 virtual bool IsControl() const { return true; }
1233
1234 Handle<Map> map() const { return hydrogen()->map(); } 1259 Handle<Map> map() const { return hydrogen()->map(); }
1235 int true_block_id() const {
1236 return hydrogen()->FirstSuccessor()->block_id();
1237 }
1238 int false_block_id() const {
1239 return hydrogen()->SecondSuccessor()->block_id();
1240 }
1241 }; 1260 };
1242 1261
1243 1262
1244 class LFixedArrayBaseLength: public LTemplateInstruction<1, 1, 0> { 1263 class LFixedArrayBaseLength: public LTemplateInstruction<1, 1, 0> {
1245 public: 1264 public:
1246 explicit LFixedArrayBaseLength(LOperand* value) { 1265 explicit LFixedArrayBaseLength(LOperand* value) {
1247 inputs_[0] = value; 1266 inputs_[0] = value;
1248 } 1267 }
1249 1268
1250 LOperand* value() { return inputs_[0]; } 1269 LOperand* value() { return inputs_[0]; }
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after
2820 2839
2821 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2840 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2822 }; 2841 };
2823 2842
2824 #undef DECLARE_HYDROGEN_ACCESSOR 2843 #undef DECLARE_HYDROGEN_ACCESSOR
2825 #undef DECLARE_CONCRETE_INSTRUCTION 2844 #undef DECLARE_CONCRETE_INSTRUCTION
2826 2845
2827 } } // namespace v8::internal 2846 } } // namespace v8::internal
2828 2847
2829 #endif // V8_MIPS_LITHIUM_MIPS_H_ 2848 #endif // V8_MIPS_LITHIUM_MIPS_H_
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698