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

Side by Side Diff: src/interpreter/bytecodes.cc

Issue 1546683002: [Interpreter] Add support for jumps using constants with wide operands. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporate comments on patchset 13. Created 4 years, 11 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/interpreter/bytecodes.h ('k') | src/interpreter/constant-array-builder.h » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/interpreter/bytecodes.h" 5 #include "src/interpreter/bytecodes.h"
6 6
7 #include "src/frames.h" 7 #include "src/frames.h"
8 #include "src/interpreter/bytecode-traits.h" 8 #include "src/interpreter/bytecode-traits.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 return bytecode == Bytecode::kJumpIfTrueConstant || 174 return bytecode == Bytecode::kJumpIfTrueConstant ||
175 bytecode == Bytecode::kJumpIfFalseConstant || 175 bytecode == Bytecode::kJumpIfFalseConstant ||
176 bytecode == Bytecode::kJumpIfToBooleanTrueConstant || 176 bytecode == Bytecode::kJumpIfToBooleanTrueConstant ||
177 bytecode == Bytecode::kJumpIfToBooleanFalseConstant || 177 bytecode == Bytecode::kJumpIfToBooleanFalseConstant ||
178 bytecode == Bytecode::kJumpIfNullConstant || 178 bytecode == Bytecode::kJumpIfNullConstant ||
179 bytecode == Bytecode::kJumpIfUndefinedConstant; 179 bytecode == Bytecode::kJumpIfUndefinedConstant;
180 } 180 }
181 181
182 182
183 // static 183 // static
184 bool Bytecodes::IsConditionalJumpConstantWide(Bytecode bytecode) {
185 return bytecode == Bytecode::kJumpIfTrueConstantWide ||
186 bytecode == Bytecode::kJumpIfFalseConstantWide ||
187 bytecode == Bytecode::kJumpIfToBooleanTrueConstantWide ||
188 bytecode == Bytecode::kJumpIfToBooleanFalseConstantWide ||
189 bytecode == Bytecode::kJumpIfNullConstantWide ||
190 bytecode == Bytecode::kJumpIfUndefinedConstantWide;
191 }
192
193
194 // static
184 bool Bytecodes::IsConditionalJump(Bytecode bytecode) { 195 bool Bytecodes::IsConditionalJump(Bytecode bytecode) {
185 return IsConditionalJumpImmediate(bytecode) || 196 return IsConditionalJumpImmediate(bytecode) ||
186 IsConditionalJumpConstant(bytecode); 197 IsConditionalJumpConstant(bytecode) ||
198 IsConditionalJumpConstantWide(bytecode);
187 } 199 }
188 200
189 201
190 // static 202 // static
191 bool Bytecodes::IsJumpImmediate(Bytecode bytecode) { 203 bool Bytecodes::IsJumpImmediate(Bytecode bytecode) {
192 return bytecode == Bytecode::kJump || IsConditionalJumpImmediate(bytecode); 204 return bytecode == Bytecode::kJump || IsConditionalJumpImmediate(bytecode);
193 } 205 }
194 206
195 207
196 // static 208 // static
197 bool Bytecodes::IsJumpConstant(Bytecode bytecode) { 209 bool Bytecodes::IsJumpConstant(Bytecode bytecode) {
198 return bytecode == Bytecode::kJumpConstant || 210 return bytecode == Bytecode::kJumpConstant ||
199 IsConditionalJumpConstant(bytecode); 211 IsConditionalJumpConstant(bytecode);
200 } 212 }
201 213
202 214
203 // static 215 // static
216 bool Bytecodes::IsJumpConstantWide(Bytecode bytecode) {
217 return bytecode == Bytecode::kJumpConstantWide ||
218 IsConditionalJumpConstantWide(bytecode);
219 }
220
221
222 // static
204 bool Bytecodes::IsJump(Bytecode bytecode) { 223 bool Bytecodes::IsJump(Bytecode bytecode) {
205 return IsJumpImmediate(bytecode) || IsJumpConstant(bytecode); 224 return IsJumpImmediate(bytecode) || IsJumpConstant(bytecode) ||
225 IsJumpConstantWide(bytecode);
206 } 226 }
207 227
208 228
209 // static 229 // static
210 bool Bytecodes::IsJumpOrReturn(Bytecode bytecode) { 230 bool Bytecodes::IsJumpOrReturn(Bytecode bytecode) {
211 return bytecode == Bytecode::kReturn || IsJump(bytecode); 231 return bytecode == Bytecode::kReturn || IsJump(bytecode);
212 } 232 }
213 233
214 234
215 // static 235 // static
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 } 433 }
414 if (reg5.is_valid() && reg4.index() + 1 != reg5.index()) { 434 if (reg5.is_valid() && reg4.index() + 1 != reg5.index()) {
415 return false; 435 return false;
416 } 436 }
417 return true; 437 return true;
418 } 438 }
419 439
420 } // namespace interpreter 440 } // namespace interpreter
421 } // namespace internal 441 } // namespace internal
422 } // namespace v8 442 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/interpreter/constant-array-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698