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

Unified Diff: src/compiler/code-assembler.h

Issue 2567333002: [promises] port NewPromiseCapability to TF (Closed)
Patch Set: fix cctests and stuff Created 4 years 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/compiler/code-assembler.h
diff --git a/src/compiler/code-assembler.h b/src/compiler/code-assembler.h
index 98192330b62f238cfb9a1692d37204f1fee69bc6..63cb6b22fd8fd5de2717c476b378e51935280220 100644
--- a/src/compiler/code-assembler.h
+++ b/src/compiler/code-assembler.h
@@ -350,6 +350,18 @@ class V8_EXPORT_PRIVATE CodeAssembler {
return CallStub(callable, context, function, arity, receiver, args...);
}
+ template <class... TArgs>
+ Node* ConstructJS(Callable const& callable, Node* context, Node* new_target,
+ TArgs... args) {
+ int argc = static_cast<int>(sizeof...(args));
+ Node* arity = Int32Constant(argc);
+ Node* receiver = LoadRoot(Heap::kUndefinedValueRootIndex);
+
+ // Construct(target, new_target, arity, receiver, arguments...)
+ return CallStub(callable, context, new_target, new_target, arity, receiver,
+ args...);
+ }
+
// Call to a C function with two arguments.
Node* CallCFunction2(MachineType return_type, MachineType arg0_type,
MachineType arg1_type, Node* function, Node* arg0,
@@ -462,6 +474,7 @@ class V8_EXPORT_PRIVATE CodeAssemblerState {
~CodeAssemblerState();
const char* name() const { return name_; }
+ int parameter_count() const;
private:
friend class CodeAssembler;

Powered by Google App Engine
This is Rietveld 408576698