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

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

Issue 14856015: Bias commutative single-use register inputs and support lea adds (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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 | « no previous file | src/ia32/lithium-codegen-ia32.cc » ('j') | src/ia32/lithium-ia32.cc » ('J')
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 3376 matching lines...) Expand 10 before | Expand all | Expand 10 after
3387 observed_input_representation_[0] = Representation::None(); 3387 observed_input_representation_[0] = Representation::None();
3388 observed_input_representation_[1] = Representation::None(); 3388 observed_input_representation_[1] = Representation::None();
3389 } 3389 }
3390 3390
3391 HValue* context() { return OperandAt(0); } 3391 HValue* context() { return OperandAt(0); }
3392 HValue* left() { return OperandAt(1); } 3392 HValue* left() { return OperandAt(1); }
3393 HValue* right() { return OperandAt(2); } 3393 HValue* right() { return OperandAt(2); }
3394 3394
3395 // TODO(kasperl): Move these helpers to the IA-32 Lithium 3395 // TODO(kasperl): Move these helpers to the IA-32 Lithium
3396 // instruction sequence builder. 3396 // instruction sequence builder.
3397 HValue* LeastConstantOperand() { 3397 HValue* BetterCandidateForRegisterOperand() {
3398 if (IsCommutative() && left()->IsConstant()) return right(); 3398 if (IsCommutative()) {
3399 if (left()->IsConstant()) return right();
3400 if (right()->IsConstant()) return left();
3401 if (right()->UseCount() == 1) return right();
3402 }
3399 return left(); 3403 return left();
3400 } 3404 }
3401 3405
3402 HValue* MostConstantOperand() { 3406 HValue* WorseCandidateForRegisterOperand() {
3403 if (IsCommutative() && left()->IsConstant()) return left(); 3407 if (IsCommutative()) {
3408 if (left()->IsConstant()) return left();
3409 if (right()->IsConstant()) return right();
3410 if (right()->UseCount() == 1) return left();
3411 }
3404 return right(); 3412 return right();
3405 } 3413 }
3406 3414
3407 void set_observed_input_representation(int index, Representation rep) { 3415 void set_observed_input_representation(int index, Representation rep) {
3408 ASSERT(index >= 1 && index <= 2); 3416 ASSERT(index >= 1 && index <= 2);
3409 observed_input_representation_[index - 1] = rep; 3417 observed_input_representation_[index - 1] = rep;
3410 } 3418 }
3411 3419
3412 virtual void initialize_output_representation(Representation observed) { 3420 virtual void initialize_output_representation(Representation observed) {
3413 observed_output_representation_ = observed; 3421 observed_output_representation_ = observed;
(...skipping 3143 matching lines...) Expand 10 before | Expand all | Expand 10 after
6557 virtual bool IsDeletable() const { return true; } 6565 virtual bool IsDeletable() const { return true; }
6558 }; 6566 };
6559 6567
6560 6568
6561 #undef DECLARE_INSTRUCTION 6569 #undef DECLARE_INSTRUCTION
6562 #undef DECLARE_CONCRETE_INSTRUCTION 6570 #undef DECLARE_CONCRETE_INSTRUCTION
6563 6571
6564 } } // namespace v8::internal 6572 } } // namespace v8::internal
6565 6573
6566 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 6574 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « no previous file | src/ia32/lithium-codegen-ia32.cc » ('j') | src/ia32/lithium-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698