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

Unified Diff: src/interpreter/bytecode-array-builder.cc

Issue 1645763003: [Interpreter] TurboFan implementation of intrinsics. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update Created 4 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
Index: src/interpreter/bytecode-array-builder.cc
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc
index 68972c81c2a26786bcf9bf3f919974aca3102069..f1dd7670891e5542df517084421aa2864ea19c6f 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -4,6 +4,7 @@
#include "src/interpreter/bytecode-array-builder.h"
#include "src/compiler.h"
+#include "src/interpreter/interpreter-intrinsics.h"
namespace v8 {
namespace internal {
@@ -1122,19 +1123,22 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime(
DCHECK_EQ(0u, arg_count);
first_arg = Register(0);
}
+ Bytecode bytecode = IntrinsicsHelper::IsSupported(function_id)
+ ? Bytecode::kInvokeIntrinsic
+ : Bytecode::kCallRuntime;
if (FitsInReg8Operand(first_arg) && FitsInIdx8Operand(arg_count)) {
- Output(Bytecode::kCallRuntime, static_cast<uint16_t>(function_id),
+ Output(bytecode, static_cast<uint16_t>(function_id),
first_arg.ToRawOperand(), static_cast<uint8_t>(arg_count));
} else if (FitsInReg16Operand(first_arg) && FitsInIdx16Operand(arg_count)) {
- Output(Bytecode::kCallRuntimeWide, static_cast<uint16_t>(function_id),
- first_arg.ToRawOperand(), static_cast<uint16_t>(arg_count));
+ Output(BytecodeForWideOperands(bytecode),
+ static_cast<uint16_t>(function_id), first_arg.ToRawOperand(),
+ static_cast<uint16_t>(arg_count));
} else {
UNIMPLEMENTED();
}
return *this;
}
-
BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntimeForPair(
Runtime::FunctionId function_id, Register first_arg, size_t arg_count,
Register first_return) {
@@ -1476,6 +1480,10 @@ Bytecode BytecodeArrayBuilder::BytecodeForWideOperands(Bytecode bytecode) {
return Bytecode::kStaLookupSlotStrictWide;
case Bytecode::kStaLookupSlotSloppy:
return Bytecode::kStaLookupSlotSloppyWide;
+ case Bytecode::kInvokeIntrinsic:
+ return Bytecode::kInvokeIntrinsicWide;
+ case Bytecode::kCallRuntime:
+ return Bytecode::kCallRuntimeWide;
default:
UNREACHABLE();
return static_cast<Bytecode>(-1);

Powered by Google App Engine
This is Rietveld 408576698