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

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

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-assembler.cc ('k') | src/interpreter/interpreter-intrinsics.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter-intrinsics.h
diff --git a/src/interpreter/interpreter-intrinsics.h b/src/interpreter/interpreter-intrinsics.h
index 8606235a2e16d3300e1a7746b5468fd188ad468e..fdb7e9b7fffb6ed23d6f3dab7490f5a63cf86567 100644
--- a/src/interpreter/interpreter-intrinsics.h
+++ b/src/interpreter/interpreter-intrinsics.h
@@ -20,6 +20,8 @@ namespace compiler {
class Node;
} // namespace compiler
+namespace interpreter {
+
// List of supported intrisics, with upper case name, lower case name and
// expected number of arguments (-1 denoting argument count is variable).
#define INTRINSICS_LIST(V) \
@@ -31,10 +33,16 @@ class Node;
V(IsSmi, is_smi, 1) \
V(IsTypedArray, is_typed_array, 1)
-namespace interpreter {
-
class IntrinsicsHelper {
public:
+ enum class IntrinsicId {
+#define DECLARE_INTRINSIC_ID(name, lower_case, count) k##name,
+ INTRINSICS_LIST(DECLARE_INTRINSIC_ID)
+#undef DECLARE_INTRINSIC_ID
+ kIdCount
+ };
+ STATIC_ASSERT(static_cast<uint32_t>(IntrinsicId::kIdCount) <= kMaxUInt8);
+
explicit IntrinsicsHelper(InterpreterAssembler* assembler);
compiler::Node* InvokeIntrinsic(compiler::Node* function_id,
@@ -43,6 +51,8 @@ class IntrinsicsHelper {
compiler::Node* arg_count);
static bool IsSupported(Runtime::FunctionId function_id);
+ static IntrinsicId FromRuntimeId(Runtime::FunctionId function_id);
+ static Runtime::FunctionId ToRuntimeId(IntrinsicId intrinsic_id);
private:
enum InstanceTypeCompareMode {
« no previous file with comments | « src/interpreter/interpreter-assembler.cc ('k') | src/interpreter/interpreter-intrinsics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698