Commit c81bbda7 authored by bmeurer's avatar bmeurer Committed by Commit bot

[Interpreter] Implement TypeOf bytecode using the TypeofStub.

We already have a code stub that implements Typeof, so we don't
need a special runtime entry here to implement the TypeOf handler.

R=rmcilroy@chromium.org

Review URL: https://codereview.chromium.org/1732273002

Cr-Commit-Position: refs/heads/master@{#34283}
parent 4d325854
......@@ -900,10 +900,12 @@ void Interpreter::DoLogicalNot(InterpreterAssembler* assembler) {
// Load the accumulator with the string representating type of the
// object in the accumulator.
void Interpreter::DoTypeOf(InterpreterAssembler* assembler) {
Callable callable = CodeFactory::Typeof(isolate_);
Node* target = __ HeapConstant(callable.code());
Node* accumulator = __ GetAccumulator();
Node* context = __ GetContext();
Node* result =
__ CallRuntime(Runtime::kInterpreterTypeOf, context, accumulator);
__ CallStub(callable.descriptor(), target, context, accumulator);
__ SetAccumulator(result);
__ Dispatch();
}
......
......@@ -135,14 +135,6 @@ RUNTIME_FUNCTION(Runtime_InterpreterLogicalNot) {
}
RUNTIME_FUNCTION(Runtime_InterpreterTypeOf) {
HandleScope shs(isolate);
DCHECK_EQ(1, args.length());
CONVERT_ARG_HANDLE_CHECKED(Object, x, 0);
return Object::cast(*Object::TypeOf(isolate, x));
}
RUNTIME_FUNCTION(Runtime_InterpreterNewClosure) {
HandleScope scope(isolate);
DCHECK_EQ(2, args.length());
......
......@@ -216,7 +216,6 @@ namespace internal {
F(InterpreterGreaterThanOrEqual, 2, 1) \
F(InterpreterToBoolean, 1, 1) \
F(InterpreterLogicalNot, 1, 1) \
F(InterpreterTypeOf, 1, 1) \
F(InterpreterNewClosure, 2, 1) \
F(InterpreterTraceBytecodeEntry, 3, 1) \
F(InterpreterTraceBytecodeExit, 3, 1) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment