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

Side by Side Diff: src/compiler/mips/instruction-selector-mips.cc

Issue 2133503004: MIPS: [turbofan] Make sure binop results do not overwrite deoptimization inputs on arm. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | src/compiler/mips64/instruction-selector-mips64.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 #include "src/base/adapters.h" 5 #include "src/base/adapters.h"
6 #include "src/base/bits.h" 6 #include "src/base/bits.h"
7 #include "src/compiler/instruction-selector-impl.h" 7 #include "src/compiler/instruction-selector-impl.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 10
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 size_t output_count = 0; 97 size_t output_count = 0;
98 98
99 inputs[input_count++] = g.UseRegister(m.left().node()); 99 inputs[input_count++] = g.UseRegister(m.left().node());
100 inputs[input_count++] = g.UseOperand(m.right().node(), opcode); 100 inputs[input_count++] = g.UseOperand(m.right().node(), opcode);
101 101
102 if (cont->IsBranch()) { 102 if (cont->IsBranch()) {
103 inputs[input_count++] = g.Label(cont->true_block()); 103 inputs[input_count++] = g.Label(cont->true_block());
104 inputs[input_count++] = g.Label(cont->false_block()); 104 inputs[input_count++] = g.Label(cont->false_block());
105 } 105 }
106 106
107 outputs[output_count++] = g.DefineAsRegister(node); 107 if (cont->IsDeoptimize()) {
108 // If we can deoptimize as a result of the binop, we need to make sure that
109 // the deopt inputs are not overwritten by the binop result. One way
110 // to achieve that is to declare the output register as same-as-first.
111 outputs[output_count++] = g.DefineSameAsFirst(node);
112 } else {
113 outputs[output_count++] = g.DefineAsRegister(node);
114 }
108 if (cont->IsSet()) { 115 if (cont->IsSet()) {
109 outputs[output_count++] = g.DefineAsRegister(cont->result()); 116 outputs[output_count++] = g.DefineAsRegister(cont->result());
110 } 117 }
111 118
112 DCHECK_NE(0u, input_count); 119 DCHECK_NE(0u, input_count);
113 DCHECK_NE(0u, output_count); 120 DCHECK_NE(0u, output_count);
114 DCHECK_GE(arraysize(inputs), input_count); 121 DCHECK_GE(arraysize(inputs), input_count);
115 DCHECK_GE(arraysize(outputs), output_count); 122 DCHECK_GE(arraysize(outputs), output_count);
116 123
117 opcode = cont->Encode(opcode); 124 opcode = cont->Encode(opcode);
(...skipping 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) || 1590 DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) ||
1584 IsMipsArchVariant(kMips32r2)); 1591 IsMipsArchVariant(kMips32r2));
1585 return MachineOperatorBuilder::AlignmentRequirements:: 1592 return MachineOperatorBuilder::AlignmentRequirements::
1586 NoUnalignedAccessSupport(); 1593 NoUnalignedAccessSupport();
1587 } 1594 }
1588 } 1595 }
1589 1596
1590 } // namespace compiler 1597 } // namespace compiler
1591 } // namespace internal 1598 } // namespace internal
1592 } // namespace v8 1599 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/mips64/instruction-selector-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698