v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
js-generic-lowering.h
Go to the documentation of this file.
1// Copyright 2014 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_COMPILER_JS_GENERIC_LOWERING_H_
6#define V8_COMPILER_JS_GENERIC_LOWERING_H_
7
11
12namespace v8 {
13namespace internal {
14namespace compiler {
15
16// Forward declarations.
17class CommonOperatorBuilder;
18class JSGraph;
19class MachineOperatorBuilder;
20class Linkage;
21
22
23// Lowers JS-level operators to runtime and IC calls in the "generic" case.
24class JSGenericLowering final : public AdvancedReducer {
25 public:
28
29 const char* reducer_name() const override { return "JSGenericLowering"; }
30
31 Reduction Reduce(Node* node) final;
32
33 protected:
34#define DECLARE_LOWER(x, ...) void Lower##x(Node* node);
35 // Dispatched depending on opcode.
37#undef DECLARE_LOWER
38
39 // Helpers to replace existing nodes with a generic call.
40 void ReplaceWithBuiltinCall(Node* node, Builtin builtin);
41 void ReplaceWithBuiltinCall(Node* node, Callable c,
43 void ReplaceWithBuiltinCall(Node* node, Callable c,
45 Operator::Properties properties);
46 void ReplaceWithRuntimeCall(Node* node, Runtime::FunctionId f, int args = -1);
47
48 void ReplaceUnaryOpWithBuiltinCall(Node* node,
49 Builtin builtin_without_feedback,
50 Builtin builtin_with_feedback);
51 void ReplaceBinaryOpWithBuiltinCall(Node* node,
52 Builtin builtin_without_feedback,
53 Builtin builtin_with_feedback);
54
55 Zone* zone() const;
56 Isolate* isolate() const;
57 JSGraph* jsgraph() const { return jsgraph_; }
58 TFGraph* graph() const;
61 JSHeapBroker* broker() const { return broker_; }
62
63 private:
66};
67
68} // namespace compiler
69} // namespace internal
70} // namespace v8
71
72#endif // V8_COMPILER_JS_GENERIC_LOWERING_H_
friend Zone
Definition asm-types.cc:195
void ReplaceBinaryOpWithBuiltinCall(Node *node, Builtin builtin_without_feedback, Builtin builtin_with_feedback)
void ReplaceWithRuntimeCall(Node *node, Runtime::FunctionId f, int args=-1)
void ReplaceWithBuiltinCall(Node *node, Builtin builtin)
void ReplaceUnaryOpWithBuiltinCall(Node *node, Builtin builtin_without_feedback, Builtin builtin_with_feedback)
const char * reducer_name() const override
JSGenericLowering(JSGraph *jsgraph, Editor *editor, JSHeapBroker *broker)
base::Flags< Property, uint8_t > Properties
Definition operator.h:60
base::Vector< const DirectHandle< Object > > args
Definition execution.cc:74
#define DECLARE_LOWER(x,...)
#define JS_OP_LIST(V)
Definition opcodes.h:257