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

Unified Diff: src/interpreter/interpreter.cc

Issue 1402943002: [Interpreter] Support for operator new. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: One more test. 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/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 39ff4d964932be4d867da4ff365102ed22d7c873..83efe581f77c2286b3aba47ea9a48651f1cf420a 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -537,6 +537,25 @@ void Interpreter::DoCallRuntime(compiler::InterpreterAssembler* assembler) {
}
+// New <constructor> <arg_count>
+//
+// Call operator new with |constructor| and the first argument in
+// register |first_arg| and |arg_count| arguments in subsequent
+//
+void Interpreter::DoNew(compiler::InterpreterAssembler* assembler) {
+ Callable ic = CodeFactory::InterpreterPushArgsAndConstruct(isolate_);
+ Node* constructor_index = __ BytecodeOperandReg8(0);
+ Node* constructor = __ LoadRegister(constructor_index);
+ Node* first_arg_reg = __ BytecodeOperandReg8(1);
+ Node* first_arg = __ RegisterLocation(first_arg_reg);
+ Node* args_count = __ BytecodeOperandCount8(2);
+ Node* result =
+ __ CallConstruct(constructor, constructor, first_arg, args_count);
+ __ SetAccumulator(result);
+ __ Dispatch();
+}
+
+
// TestEqual <src>
//
// Test if the value in the <src> register equals the accumulator.

Powered by Google App Engine
This is Rietveld 408576698