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

Side by Side Diff: src/compiler/mips64/instruction-selector-mips64.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 | « src/compiler/mips/instruction-selector-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 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 size_t output_count = 0; 102 size_t output_count = 0;
103 103
104 inputs[input_count++] = g.UseRegister(m.left().node()); 104 inputs[input_count++] = g.UseRegister(m.left().node());
105 inputs[input_count++] = g.UseOperand(m.right().node(), opcode); 105 inputs[input_count++] = g.UseOperand(m.right().node(), opcode);
106 106
107 if (cont->IsBranch()) { 107 if (cont->IsBranch()) {
108 inputs[input_count++] = g.Label(cont->true_block()); 108 inputs[input_count++] = g.Label(cont->true_block());
109 inputs[input_count++] = g.Label(cont->false_block()); 109 inputs[input_count++] = g.Label(cont->false_block());
110 } 110 }
111 111
112 outputs[output_count++] = g.DefineAsRegister(node); 112 if (cont->IsDeoptimize()) {
113 // If we can deoptimize as a result of the binop, we need to make sure that
114 // the deopt inputs are not overwritten by the binop result. One way
115 // to achieve that is to declare the output register as same-as-first.
116 outputs[output_count++] = g.DefineSameAsFirst(node);
117 } else {
118 outputs[output_count++] = g.DefineAsRegister(node);
119 }
113 if (cont->IsSet()) { 120 if (cont->IsSet()) {
114 outputs[output_count++] = g.DefineAsRegister(cont->result()); 121 outputs[output_count++] = g.DefineAsRegister(cont->result());
115 } 122 }
116 123
117 DCHECK_NE(0u, input_count); 124 DCHECK_NE(0u, input_count);
118 DCHECK_NE(0u, output_count); 125 DCHECK_NE(0u, output_count);
119 DCHECK_GE(arraysize(inputs), input_count); 126 DCHECK_GE(arraysize(inputs), input_count);
120 DCHECK_GE(arraysize(outputs), output_count); 127 DCHECK_GE(arraysize(outputs), output_count);
121 128
122 opcode = cont->Encode(opcode); 129 opcode = cont->Encode(opcode);
(...skipping 1963 matching lines...) Expand 10 before | Expand all | Expand 10 after
2086 } else { 2093 } else {
2087 DCHECK(kArchVariant == kMips64r2); 2094 DCHECK(kArchVariant == kMips64r2);
2088 return MachineOperatorBuilder::AlignmentRequirements:: 2095 return MachineOperatorBuilder::AlignmentRequirements::
2089 NoUnalignedAccessSupport(); 2096 NoUnalignedAccessSupport();
2090 } 2097 }
2091 } 2098 }
2092 2099
2093 } // namespace compiler 2100 } // namespace compiler
2094 } // namespace internal 2101 } // namespace internal
2095 } // namespace v8 2102 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips/instruction-selector-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698