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

Unified Diff: src/interpreter/interpreter-intrinsics.cc

Issue 2084623002: Reland: [Interpreter] Map runtime id's to intrinsic id's in InvokeIntrinsic bytecode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Reland Created 4 years, 6 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/interpreter-intrinsics.h ('k') | test/cctest/interpreter/bytecode-expectations-printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter-intrinsics.cc
diff --git a/src/interpreter/interpreter-intrinsics.cc b/src/interpreter/interpreter-intrinsics.cc
index f961b3b29ad170c0497d736933b8066a86a32e6f..bf1f7d3e4691e85d4c892d7ed759579042f7e728 100644
--- a/src/interpreter/interpreter-intrinsics.cc
+++ b/src/interpreter/interpreter-intrinsics.cc
@@ -15,6 +15,7 @@ using compiler::Node;
IntrinsicsHelper::IntrinsicsHelper(InterpreterAssembler* assembler)
: assembler_(assembler) {}
+// static
bool IntrinsicsHelper::IsSupported(Runtime::FunctionId function_id) {
switch (function_id) {
#define SUPPORTED(name, lower_case, count) case Runtime::kInline##name:
@@ -26,6 +27,36 @@ bool IntrinsicsHelper::IsSupported(Runtime::FunctionId function_id) {
}
}
+// static
+IntrinsicsHelper::IntrinsicId IntrinsicsHelper::FromRuntimeId(
+ Runtime::FunctionId function_id) {
+ switch (function_id) {
+#define TO_RUNTIME_ID(name, lower_case, count) \
+ case Runtime::kInline##name: \
+ return IntrinsicId::k##name;
+ INTRINSICS_LIST(TO_RUNTIME_ID)
+#undef TO_RUNTIME_ID
+ default:
+ UNREACHABLE();
+ return static_cast<IntrinsicsHelper::IntrinsicId>(-1);
+ }
+}
+
+// static
+Runtime::FunctionId IntrinsicsHelper::ToRuntimeId(
+ IntrinsicsHelper::IntrinsicId intrinsic_id) {
+ switch (intrinsic_id) {
+#define TO_INTRINSIC_ID(name, lower_case, count) \
+ case IntrinsicId::k##name: \
+ return Runtime::kInline##name;
+ INTRINSICS_LIST(TO_INTRINSIC_ID)
+#undef TO_INTRINSIC_ID
+ default:
+ UNREACHABLE();
+ return static_cast<Runtime::FunctionId>(-1);
+ }
+}
+
Node* IntrinsicsHelper::InvokeIntrinsic(Node* function_id, Node* context,
Node* first_arg_reg, Node* arg_count) {
InterpreterAssembler::Label abort(assembler_), end(assembler_);
@@ -42,7 +73,7 @@ Node* IntrinsicsHelper::InvokeIntrinsic(Node* function_id, Node* context,
#undef LABEL_POINTER
#define CASE(name, lower_case, count) \
- static_cast<int32_t>(Runtime::kInline##name),
+ static_cast<int32_t>(IntrinsicId::k##name),
int32_t cases[] = {INTRINSICS_LIST(CASE)};
#undef CASE
« no previous file with comments | « src/interpreter/interpreter-intrinsics.h ('k') | test/cctest/interpreter/bytecode-expectations-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698