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

Unified Diff: src/ffi/ffi-compiler.h

Issue 2607993003: FFI Compiler based on code stub assembler (Closed)
Patch Set: Introduce FFIAssembler class Created 3 years, 11 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/ffi/ffi-compiler.h
diff --git a/src/ffi/ffi-compiler.h b/src/ffi/ffi-compiler.h
new file mode 100644
index 0000000000000000000000000000000000000000..868cc08bfab6ba0e7435cdb066a9c33837f5d687
--- /dev/null
+++ b/src/ffi/ffi-compiler.h
@@ -0,0 +1,46 @@
+// Copyright 2017 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SRC_FFI_FFI_COMPILER_H_
+#define SRC_FFI_FFI_COMPILER_H_
+
+#include "src/code-stub-assembler.h"
+#include "src/machine-type.h"
+
+namespace v8 {
+namespace internal {
+
+typedef compiler::Node Node;
+typedef compiler::CodeAssemblerState CodeAssemblerState;
+
+void InstallFFIMap(Isolate* isolate);
+
+namespace ffi {
+
+typedef Signature<MachineType> FFISignature;
+
+struct NativeFunction {
+ FFISignature* sig;
+ uint8_t* start;
+};
+
+class FFIAssembler : public CodeStubAssembler {
Igor Sheludko 2017/01/18 18:18:14 Since nobody uses it outside the .cc file, it coul
mattloring 2017/01/18 18:26:24 Done.
+ public:
+ explicit FFIAssembler(CodeAssemblerState* state) : CodeStubAssembler(state) {}
+
+ Node* ToJS(Node* node, Node* context, MachineType type);
+
+ Node* FromJS(Node* node, Node* context, MachineType type);
+
+ Handle<Code> GenerateJSToNativeWrapper(NativeFunction* func);
+};
+
+Handle<JSFunction> CompileJSToNativeWrapper(Isolate* isolate,
+ Handle<String> name,
+ NativeFunction func);
+} // namespace ffi
+} // namespace internal
+} // namespace v8
+
+#endif // SRC_FFI_FFI_COMPILER_H_
« no previous file with comments | « src/ffi/OWNERS ('k') | src/ffi/ffi-compiler.cc » ('j') | src/ffi/ffi-compiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698