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

Side by Side Diff: src/compiler/instruction-selector-impl.h

Issue 745633002: [turbofan] Clean up and factor out branch generation logic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix IA32 fall through. Created 6 years, 1 month 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
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/mips/code-generator-mips.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ 5 #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_
6 #define V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ 6 #define V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_
7 7
8 #include "src/compiler/generic-node-inl.h" 8 #include "src/compiler/generic-node-inl.h"
9 #include "src/compiler/instruction.h" 9 #include "src/compiler/instruction.h"
10 #include "src/compiler/instruction-selector.h" 10 #include "src/compiler/instruction-selector.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 DCHECK(IsBranch()); 250 DCHECK(IsBranch());
251 return true_block_; 251 return true_block_;
252 } 252 }
253 BasicBlock* false_block() const { 253 BasicBlock* false_block() const {
254 DCHECK(IsBranch()); 254 DCHECK(IsBranch());
255 return false_block_; 255 return false_block_;
256 } 256 }
257 257
258 void Negate() { 258 void Negate() {
259 DCHECK(!IsNone()); 259 DCHECK(!IsNone());
260 condition_ = static_cast<FlagsCondition>(condition_ ^ 1); 260 condition_ = NegateFlagsCondition(condition_);
261 } 261 }
262 262
263 void Commute() { 263 void Commute() {
264 DCHECK(!IsNone()); 264 DCHECK(!IsNone());
265 switch (condition_) { 265 switch (condition_) {
266 case kEqual: 266 case kEqual:
267 case kNotEqual: 267 case kNotEqual:
268 case kOverflow: 268 case kOverflow:
269 case kNotOverflow: 269 case kNotOverflow:
270 return; 270 return;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 } 310 }
311 UNREACHABLE(); 311 UNREACHABLE();
312 } 312 }
313 313
314 void OverwriteAndNegateIfEqual(FlagsCondition condition) { 314 void OverwriteAndNegateIfEqual(FlagsCondition condition) {
315 bool negate = condition_ == kEqual; 315 bool negate = condition_ == kEqual;
316 condition_ = condition; 316 condition_ = condition;
317 if (negate) Negate(); 317 if (negate) Negate();
318 } 318 }
319 319
320 void SwapBlocks() { std::swap(true_block_, false_block_); }
321
322 // Encodes this flags continuation into the given opcode. 320 // Encodes this flags continuation into the given opcode.
323 InstructionCode Encode(InstructionCode opcode) { 321 InstructionCode Encode(InstructionCode opcode) {
324 opcode |= FlagsModeField::encode(mode_); 322 opcode |= FlagsModeField::encode(mode_);
325 if (mode_ != kFlags_none) { 323 if (mode_ != kFlags_none) {
326 opcode |= FlagsConditionField::encode(condition_); 324 opcode |= FlagsConditionField::encode(condition_);
327 } 325 }
328 return opcode; 326 return opcode;
329 } 327 }
330 328
331 private: 329 private:
(...skipping 29 matching lines...) Expand all
361 : (frame_state_descriptor->GetTotalSize() + 359 : (frame_state_descriptor->GetTotalSize() +
362 1); // Include deopt id. 360 1); // Include deopt id.
363 } 361 }
364 }; 362 };
365 363
366 } // namespace compiler 364 } // namespace compiler
367 } // namespace internal 365 } // namespace internal
368 } // namespace v8 366 } // namespace v8
369 367
370 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ 368 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_
OLDNEW
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/mips/code-generator-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698