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

Unified Diff: src/interpreter/interpreter.cc

Issue 2165953002: [interpreter] Add a register operand to ToNumber (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: comments Created 4 years, 5 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 b461264c22863fcf3c73c3768da8ad0d43696e82..a6c89851b3a290ac2eec307eca60413bfc5bf67b 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -997,13 +997,17 @@ void Interpreter::DoShiftRightSmi(InterpreterAssembler* assembler) {
__ Dispatch();
}
-void Interpreter::DoUnaryOp(Callable callable,
- InterpreterAssembler* assembler) {
+Node* Interpreter::BuildUnaryOp(Callable callable,
+ InterpreterAssembler* assembler) {
Node* target = __ HeapConstant(callable.code());
Node* accumulator = __ GetAccumulator();
Node* context = __ GetContext();
- Node* result =
- __ CallStub(callable.descriptor(), target, context, accumulator);
+ return __ CallStub(callable.descriptor(), target, context, accumulator);
+}
+
+void Interpreter::DoUnaryOp(Callable callable,
+ InterpreterAssembler* assembler) {
+ Node* result = BuildUnaryOp(callable, assembler);
__ SetAccumulator(result);
__ Dispatch();
}
@@ -1028,7 +1032,9 @@ void Interpreter::DoToName(InterpreterAssembler* assembler) {
//
// Cast the object referenced by the accumulator to a number.
void Interpreter::DoToNumber(InterpreterAssembler* assembler) {
- DoUnaryOp(CodeFactory::ToNumber(isolate_), assembler);
+ Node* result = BuildUnaryOp(CodeFactory::ToNumber(isolate_), assembler);
+ __ StoreRegister(result, __ BytecodeOperandReg(0));
+ __ Dispatch();
}
// ToObject
« no previous file with comments | « src/interpreter/interpreter.h ('k') | test/cctest/interpreter/bytecode_expectations/AssignmentsInBinaryExpression.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698