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

Unified Diff: src/compiler/interpreter-assembler.cc

Issue 1402943002: [Interpreter] Support for operator new. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporate review comments on patch sets 2 and 3. Created 5 years, 2 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/compiler/interpreter-assembler.cc
diff --git a/src/compiler/interpreter-assembler.cc b/src/compiler/interpreter-assembler.cc
index 8794bfb52a42255943a90722b505bdd018007c9e..0c086c5c6e9282ecfd2b24c330131ad3a1f0ccd7 100644
--- a/src/compiler/interpreter-assembler.cc
+++ b/src/compiler/interpreter-assembler.cc
@@ -311,6 +311,26 @@ Node* InterpreterAssembler::LoadTypeFeedbackVector() {
}
+Node* InterpreterAssembler::CallConstruct(Node* original_constructor,
+ Node* constructor, Node* first_arg,
+ Node* arg_count) {
+ Callable callable = CodeFactory::InterpreterPushArgsAndConstruct(isolate());
+ CallDescriptor* descriptor = Linkage::GetStubCallDescriptor(
+ isolate(), zone(), callable.descriptor(), 0, CallDescriptor::kNoFlags);
+
+ Node* code_target = HeapConstant(callable.code());
+
+ Node** args = zone()->NewArray<Node*>(5);
+ args[0] = arg_count;
+ args[1] = original_constructor;
+ args[2] = constructor;
+ args[3] = first_arg;
+ args[4] = ContextTaggedPointer();
+
+ return CallN(descriptor, code_target, args);
+}
+
+
Node* InterpreterAssembler::CallN(CallDescriptor* descriptor, Node* code_target,
Node** args) {
Node* stack_pointer_before_call = nullptr;

Powered by Google App Engine
This is Rietveld 408576698