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

Unified Diff: src/interpreter/interpreter.cc

Issue 2302923002: [stubs] Port ToName stub to TurboFan. (Closed)
Patch Set: Created 4 years, 3 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 a8d2e1ef772929cb7175c71041ae00b0cf5d2a13..d6c2227b01c49e013549e57b166c28ad7c8731cf 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -1300,13 +1300,20 @@ void Interpreter::DoUnaryOpWithFeedback(InterpreterAssembler* assembler) {
__ Dispatch();
}
+template <class Generator>
+void Interpreter::DoConversionOp(InterpreterAssembler* assembler) {
+ Node* value = __ GetAccumulator();
+ Node* context = __ GetContext();
+ Node* result = Generator::Generate(assembler, value, context);
+ __ StoreRegister(result, __ BytecodeOperandReg(0));
+ __ Dispatch();
+}
+
// ToName
//
// Cast the object referenced by the accumulator to a name.
void Interpreter::DoToName(InterpreterAssembler* assembler) {
- Node* result = BuildUnaryOp(CodeFactory::ToName(isolate_), assembler);
- __ StoreRegister(result, __ BytecodeOperandReg(0));
- __ Dispatch();
+ DoConversionOp<ToNameStub>(assembler);
}
// ToNumber

Powered by Google App Engine
This is Rietveld 408576698