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

Unified Diff: src/interpreter/bytecode-pipeline.h

Issue 2684993002: [interpreter] Create custom call opcodes for specific argument counts (Closed)
Patch Set: Fix golden files again Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-pipeline.h
diff --git a/src/interpreter/bytecode-pipeline.h b/src/interpreter/bytecode-pipeline.h
index 03d40f73443ab7fbc200884da530e68f0f40ed3c..23cad237dd9afc7ba1ea525fb390a83f4a991287 100644
--- a/src/interpreter/bytecode-pipeline.h
+++ b/src/interpreter/bytecode-pipeline.h
@@ -191,6 +191,21 @@ class V8_EXPORT_PRIVATE BytecodeNode final : NON_EXPORTED_BASE(ZoneObject) {
SetOperand(3, operand3);
}
+ INLINE(BytecodeNode(Bytecode bytecode, uint32_t operand0, uint32_t operand1,
+ uint32_t operand2, uint32_t operand3, uint32_t operand4,
+ BytecodeSourceInfo source_info = BytecodeSourceInfo()))
+ : bytecode_(bytecode),
+ operand_count_(5),
+ operand_scale_(OperandScale::kSingle),
+ source_info_(source_info) {
+ DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), operand_count());
+ SetOperand(0, operand0);
+ SetOperand(1, operand1);
+ SetOperand(2, operand2);
+ SetOperand(3, operand3);
+ SetOperand(4, operand4);
+ }
+
#define DEFINE_BYTECODE_NODE_CREATOR(Name, ...) \
template <typename... Operands> \
INLINE(static BytecodeNode Name(BytecodeSourceInfo source_info, \
@@ -261,7 +276,7 @@ class V8_EXPORT_PRIVATE BytecodeNode final : NON_EXPORTED_BASE(ZoneObject) {
OperandScale operand_scale,
BytecodeSourceInfo source_info, uint32_t operand0 = 0,
uint32_t operand1 = 0, uint32_t operand2 = 0,
- uint32_t operand3 = 0))
+ uint32_t operand3 = 0, uint32_t operand4 = 0))
: bytecode_(bytecode),
operand_count_(operand_count),
operand_scale_(operand_scale),
@@ -271,6 +286,7 @@ class V8_EXPORT_PRIVATE BytecodeNode final : NON_EXPORTED_BASE(ZoneObject) {
operands_[1] = operand1;
operands_[2] = operand2;
operands_[3] = operand3;
+ operands_[4] = operand4;
}
template <Bytecode bytecode, AccumulatorUse accum_use>
@@ -336,6 +352,29 @@ class V8_EXPORT_PRIVATE BytecodeNode final : NON_EXPORTED_BASE(ZoneObject) {
operand2, operand3);
}
+ template <Bytecode bytecode, AccumulatorUse accum_use,
+ OperandType operand0_type, OperandType operand1_type,
+ OperandType operand2_type, OperandType operand3_type,
+ OperandType operand4_type>
+ INLINE(static BytecodeNode Create(BytecodeSourceInfo source_info,
+ uint32_t operand0, uint32_t operand1,
+ uint32_t operand2, uint32_t operand3,
+ uint32_t operand4)) {
+ DCHECK_EQ(Bytecodes::GetOperandType(bytecode, 0), operand0_type);
+ DCHECK_EQ(Bytecodes::GetOperandType(bytecode, 1), operand1_type);
+ DCHECK_EQ(Bytecodes::GetOperandType(bytecode, 2), operand2_type);
+ DCHECK_EQ(Bytecodes::GetOperandType(bytecode, 3), operand3_type);
+ DCHECK_EQ(Bytecodes::GetOperandType(bytecode, 4), operand4_type);
+ OperandScale scale = OperandScale::kSingle;
+ scale = std::max(scale, ScaleForOperand<operand0_type>(operand0));
+ scale = std::max(scale, ScaleForOperand<operand1_type>(operand1));
+ scale = std::max(scale, ScaleForOperand<operand2_type>(operand2));
+ scale = std::max(scale, ScaleForOperand<operand3_type>(operand3));
+ scale = std::max(scale, ScaleForOperand<operand4_type>(operand4));
+ return BytecodeNode(bytecode, 5, scale, source_info, operand0, operand1,
+ operand2, operand3, operand4);
+ }
+
template <OperandType operand_type>
INLINE(static OperandScale ScaleForOperand(uint32_t operand)) {
if (BytecodeOperands::IsScalableUnsignedByte(operand_type)) {
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698