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

Side by Side Diff: src/hydrogen-instructions.h

Issue 14471034: Better handling of Phi nodes with constant inputs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: cleanup as discussed Created 7 years, 8 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/hydrogen.cc ('k') | src/hydrogen-instructions.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 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 3125 matching lines...) Expand 10 before | Expand all | Expand 10 after
3136 HValue* input = OperandAt(i); 3136 HValue* input = OperandAt(i);
3137 PrintF("#%d %s: Input #%d %s at %d is NCTI\n", 3137 PrintF("#%d %s: Input #%d %s at %d is NCTI\n",
3138 id(), Mnemonic(), input->id(), input->Mnemonic(), i); 3138 id(), Mnemonic(), input->id(), input->Mnemonic(), i);
3139 } 3139 }
3140 return false; 3140 return false;
3141 } 3141 }
3142 } 3142 }
3143 return true; 3143 return true;
3144 } 3144 }
3145 3145
3146 void SimplifyConstantInputs();
3147
3146 protected: 3148 protected:
3147 virtual void DeleteFromGraph(); 3149 virtual void DeleteFromGraph();
3148 virtual void InternalSetOperandAt(int index, HValue* value) { 3150 virtual void InternalSetOperandAt(int index, HValue* value) {
3149 inputs_[index] = value; 3151 inputs_[index] = value;
3150 } 3152 }
3151 3153
3152 virtual bool IsRelationTrueInternal(NumericRelation relation, 3154 virtual bool IsRelationTrueInternal(NumericRelation relation,
3153 HValue* other, 3155 HValue* other,
3154 int offset = 0, 3156 int offset = 0,
3155 int scale = 0); 3157 int scale = 0);
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
3437 HValue* LeastConstantOperand() { 3439 HValue* LeastConstantOperand() {
3438 if (IsCommutative() && left()->IsConstant()) return right(); 3440 if (IsCommutative() && left()->IsConstant()) return right();
3439 return left(); 3441 return left();
3440 } 3442 }
3441 3443
3442 HValue* MostConstantOperand() { 3444 HValue* MostConstantOperand() {
3443 if (IsCommutative() && left()->IsConstant()) return left(); 3445 if (IsCommutative() && left()->IsConstant()) return left();
3444 return right(); 3446 return right();
3445 } 3447 }
3446 3448
3447 void set_observed_input_representation(Representation left, 3449 void set_observed_input_representation(int index, Representation rep) {
3448 Representation right) { 3450 ASSERT(index >= 1 && index <= 2);
3449 observed_input_representation_[0] = left; 3451 observed_input_representation_[index - 1] = rep;
3450 observed_input_representation_[1] = right;
3451 } 3452 }
3452 3453
3453 virtual void initialize_output_representation(Representation observed) { 3454 virtual void initialize_output_representation(Representation observed) {
3454 observed_output_representation_ = observed; 3455 observed_output_representation_ = observed;
3455 } 3456 }
3456 3457
3457 virtual Representation observed_input_representation(int index) { 3458 virtual Representation observed_input_representation(int index) {
3458 if (index == 0) return Representation::Tagged(); 3459 if (index == 0) return Representation::Tagged();
3459 return observed_input_representation_[index - 1]; 3460 return observed_input_representation_[index - 1];
3460 } 3461 }
(...skipping 3089 matching lines...) Expand 10 before | Expand all | Expand 10 after
6550 virtual bool IsDeletable() const { return true; } 6551 virtual bool IsDeletable() const { return true; }
6551 }; 6552 };
6552 6553
6553 6554
6554 #undef DECLARE_INSTRUCTION 6555 #undef DECLARE_INSTRUCTION
6555 #undef DECLARE_CONCRETE_INSTRUCTION 6556 #undef DECLARE_CONCRETE_INSTRUCTION
6556 6557
6557 } } // namespace v8::internal 6558 } } // namespace v8::internal
6558 6559
6559 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 6560 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698