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

Unified Diff: src/interpreter/interpreter.cc

Issue 1390483002: [Interpreter] Unary operators - typeof, void, and logical not. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. 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 dcd3c44e5473c18fc2343b8d1d6a2994c8bceb27..6a54d186ca1c2215df4066aeb128ba58de7a433b 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -334,6 +334,29 @@ void Interpreter::DoMod(compiler::InterpreterAssembler* assembler) {
}
+// LogicalNot
+//
+// Perform logical-not on the accumulator, first casting the
+// accumulator to a boolean value if required.
+void Interpreter::DoLogicalNot(compiler::InterpreterAssembler* assembler) {
+ Node* accumulator = __ GetAccumulator();
+ Node* result = __ CallRuntime(Runtime::kInterpreterLogicalNot, accumulator);
+ __ SetAccumulator(result);
+ __ Dispatch();
+}
+
+
+// TypeOf
+//
+// Load accumulator with string representating type of object in accumulator.
rmcilroy 2015/10/06 10:39:15 nit - a string representation of the type of the o
oth 2015/10/06 12:35:06 Done, and added the definite and indefinite articl
+void Interpreter::DoTypeOf(compiler::InterpreterAssembler* assembler) {
+ Node* accumulator = __ GetAccumulator();
+ Node* result = __ CallRuntime(Runtime::kInterpreterTypeOf, accumulator);
+ __ SetAccumulator(result);
+ __ Dispatch();
+}
+
+
// Call <callable> <receiver> <arg_count>
//
// Call a JSfunction or Callable in |callable| with receiver and |arg_count|
@@ -457,8 +480,9 @@ void Interpreter::DoTestInstanceOf(compiler::InterpreterAssembler* assembler) {
//
// Cast the object referenced by the accumulator to a boolean.
void Interpreter::DoToBoolean(compiler::InterpreterAssembler* assembler) {
- // TODO(oth): The next CL for test operations has interpreter specific
- // runtime calls. This looks like another candidate.
rmcilroy 2015/10/06 10:39:15 Looks like you aren't rebased on master - this cha
oth 2015/10/06 12:35:06 Acknowledged.
+ Node* accumulator = __ GetAccumulator();
+ Node* result = __ CallRuntime(Runtime::kInterpreterToBoolean, accumulator);
+ __ SetAccumulator(result);
__ Dispatch();
}

Powered by Google App Engine
This is Rietveld 408576698