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

Side by Side Diff: src/interpreter/bytecode-array-builder.cc

Issue 1845313002: [interpreter] A few code coverage improvements. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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
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/bytecode-array-builder.h" 5 #include "src/interpreter/bytecode-array-builder.h"
6 #include "src/compiler.h" 6 #include "src/compiler.h"
7 #include "src/interpreter/interpreter-intrinsics.h" 7 #include "src/interpreter/interpreter-intrinsics.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 Output(Bytecode::kLdaTrue); 337 Output(Bytecode::kLdaTrue);
338 return *this; 338 return *this;
339 } 339 }
340 340
341 341
342 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadFalse() { 342 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadFalse() {
343 Output(Bytecode::kLdaFalse); 343 Output(Bytecode::kLdaFalse);
344 return *this; 344 return *this;
345 } 345 }
346 346
347
348 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadBooleanConstant(bool value) {
349 if (value) {
350 LoadTrue();
351 } else {
352 LoadFalse();
353 }
354 return *this;
355 }
356
357 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadAccumulatorWithRegister( 347 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadAccumulatorWithRegister(
358 Register reg) { 348 Register reg) {
359 if (!IsRegisterInAccumulator(reg)) { 349 if (!IsRegisterInAccumulator(reg)) {
360 OperandScale operand_scale = 350 OperandScale operand_scale =
361 OperandSizesToScale(SizeForRegisterOperand(reg)); 351 OperandSizesToScale(SizeForRegisterOperand(reg));
362 OutputScaled(Bytecode::kLdar, operand_scale, RegisterOperand(reg)); 352 OutputScaled(Bytecode::kLdar, operand_scale, RegisterOperand(reg));
363 } 353 }
364 return *this; 354 return *this;
365 } 355 }
366 356
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1495 } 1485 }
1496 1486
1497 uint32_t BytecodeArrayBuilder::UnsignedOperand(size_t value) { 1487 uint32_t BytecodeArrayBuilder::UnsignedOperand(size_t value) {
1498 DCHECK_LE(value, kMaxUInt32); 1488 DCHECK_LE(value, kMaxUInt32);
1499 return static_cast<uint32_t>(value); 1489 return static_cast<uint32_t>(value);
1500 } 1490 }
1501 1491
1502 } // namespace interpreter 1492 } // namespace interpreter
1503 } // namespace internal 1493 } // namespace internal
1504 } // namespace v8 1494 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698