| Index: src/interpreter/interpreter.cc
|
| diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
|
| index a898ae459d6fb7281ff39e721d884f2f02cbead0..ba4d71321ccb587779e7d950b2a61b0278555c01 100644
|
| --- a/src/interpreter/interpreter.cc
|
| +++ b/src/interpreter/interpreter.cc
|
| @@ -931,7 +931,8 @@ void Interpreter::DoBinaryOpWithFeedback(InterpreterAssembler* assembler) {
|
| }
|
|
|
| template <class Generator>
|
| -void Interpreter::DoCompareOpWithFeedback(InterpreterAssembler* assembler) {
|
| +void Interpreter::DoCompareOpWithFeedback(InterpreterAssembler* assembler,
|
| + Generator generator) {
|
| Node* reg_index = __ BytecodeOperandReg(0);
|
| Node* lhs = __ LoadRegister(reg_index);
|
| Node* rhs = __ GetAccumulator();
|
| @@ -999,7 +1000,7 @@ void Interpreter::DoCompareOpWithFeedback(InterpreterAssembler* assembler) {
|
| __ Goto(&skip_feedback_update);
|
|
|
| __ Bind(&skip_feedback_update);
|
| - Node* result = Generator::Generate(assembler, lhs, rhs, context);
|
| + Node* result = generator(assembler, lhs, rhs, context);
|
| __ SetAccumulator(result);
|
| __ Dispatch();
|
| }
|
| @@ -1520,7 +1521,13 @@ void Interpreter::DoLogicalNot(InterpreterAssembler* assembler) {
|
| // Load the accumulator with the string representating type of the
|
| // object in the accumulator.
|
| void Interpreter::DoTypeOf(InterpreterAssembler* assembler) {
|
| - DoUnaryOp<TypeofStub>(assembler);
|
| + struct Generator {
|
| + static Node* Generate(InterpreterAssembler* assembler, Node* value,
|
| + Node* context) {
|
| + return assembler->Typeof(value, context);
|
| + }
|
| + };
|
| + DoUnaryOp<Generator>(assembler);
|
| }
|
|
|
| void Interpreter::DoDelete(Runtime::FunctionId function_id,
|
| @@ -1698,35 +1705,55 @@ void Interpreter::DoNew(InterpreterAssembler* assembler) {
|
| //
|
| // Test if the value in the <src> register equals the accumulator.
|
| void Interpreter::DoTestEqual(InterpreterAssembler* assembler) {
|
| - DoCompareOpWithFeedback<EqualStub>(assembler);
|
| + DoCompareOpWithFeedback(assembler, [](CodeStubAssembler* assembler, Node* lhs,
|
| + Node* rhs, Node* context) {
|
| + return assembler->Equal(CodeStubAssembler::kDontNegateResult, lhs, rhs,
|
| + context);
|
| + });
|
| }
|
|
|
| // TestNotEqual <src>
|
| //
|
| // Test if the value in the <src> register is not equal to the accumulator.
|
| void Interpreter::DoTestNotEqual(InterpreterAssembler* assembler) {
|
| - DoCompareOpWithFeedback<NotEqualStub>(assembler);
|
| + DoCompareOpWithFeedback(assembler, [](CodeStubAssembler* assembler, Node* lhs,
|
| + Node* rhs, Node* context) {
|
| + return assembler->Equal(CodeStubAssembler::kNegateResult, lhs, rhs,
|
| + context);
|
| + });
|
| }
|
|
|
| // TestEqualStrict <src>
|
| //
|
| // Test if the value in the <src> register is strictly equal to the accumulator.
|
| void Interpreter::DoTestEqualStrict(InterpreterAssembler* assembler) {
|
| - DoCompareOpWithFeedback<StrictEqualStub>(assembler);
|
| + DoCompareOpWithFeedback(assembler, [](CodeStubAssembler* assembler, Node* lhs,
|
| + Node* rhs, Node* context) {
|
| + return assembler->StrictEqual(CodeStubAssembler::kDontNegateResult, lhs,
|
| + rhs, context);
|
| + });
|
| }
|
|
|
| // TestLessThan <src>
|
| //
|
| // Test if the value in the <src> register is less than the accumulator.
|
| void Interpreter::DoTestLessThan(InterpreterAssembler* assembler) {
|
| - DoCompareOpWithFeedback<LessThanStub>(assembler);
|
| + DoCompareOpWithFeedback(assembler, [](CodeStubAssembler* assembler, Node* lhs,
|
| + Node* rhs, Node* context) {
|
| + return assembler->RelationalComparison(CodeStubAssembler::kLessThan, lhs,
|
| + rhs, context);
|
| + });
|
| }
|
|
|
| // TestGreaterThan <src>
|
| //
|
| // Test if the value in the <src> register is greater than the accumulator.
|
| void Interpreter::DoTestGreaterThan(InterpreterAssembler* assembler) {
|
| - DoCompareOpWithFeedback<GreaterThanStub>(assembler);
|
| + DoCompareOpWithFeedback(assembler, [](CodeStubAssembler* assembler, Node* lhs,
|
| + Node* rhs, Node* context) {
|
| + return assembler->RelationalComparison(CodeStubAssembler::kGreaterThan, lhs,
|
| + rhs, context);
|
| + });
|
| }
|
|
|
| // TestLessThanOrEqual <src>
|
| @@ -1734,7 +1761,11 @@ void Interpreter::DoTestGreaterThan(InterpreterAssembler* assembler) {
|
| // Test if the value in the <src> register is less than or equal to the
|
| // accumulator.
|
| void Interpreter::DoTestLessThanOrEqual(InterpreterAssembler* assembler) {
|
| - DoCompareOpWithFeedback<LessThanOrEqualStub>(assembler);
|
| + DoCompareOpWithFeedback(assembler, [](CodeStubAssembler* assembler, Node* lhs,
|
| + Node* rhs, Node* context) {
|
| + return assembler->RelationalComparison(CodeStubAssembler::kLessThanOrEqual,
|
| + lhs, rhs, context);
|
| + });
|
| }
|
|
|
| // TestGreaterThanOrEqual <src>
|
| @@ -1742,7 +1773,11 @@ void Interpreter::DoTestLessThanOrEqual(InterpreterAssembler* assembler) {
|
| // Test if the value in the <src> register is greater than or equal to the
|
| // accumulator.
|
| void Interpreter::DoTestGreaterThanOrEqual(InterpreterAssembler* assembler) {
|
| - DoCompareOpWithFeedback<GreaterThanOrEqualStub>(assembler);
|
| + DoCompareOpWithFeedback(assembler, [](CodeStubAssembler* assembler, Node* lhs,
|
| + Node* rhs, Node* context) {
|
| + return assembler->RelationalComparison(
|
| + CodeStubAssembler::kGreaterThanOrEqual, lhs, rhs, context);
|
| + });
|
| }
|
|
|
| // TestIn <src>
|
| @@ -1750,7 +1785,15 @@ void Interpreter::DoTestGreaterThanOrEqual(InterpreterAssembler* assembler) {
|
| // Test if the object referenced by the register operand is a property of the
|
| // object referenced by the accumulator.
|
| void Interpreter::DoTestIn(InterpreterAssembler* assembler) {
|
| - DoBinaryOp<HasPropertyStub>(assembler);
|
| + struct Generator {
|
| + static Node* Generate(InterpreterAssembler* assembler,
|
| + compiler::Node* object, compiler::Node* key,
|
| + compiler::Node* context) {
|
| + return assembler->HasProperty(object, key, context,
|
| + Runtime::kHasProperty);
|
| + }
|
| + };
|
| + DoBinaryOp<Generator>(assembler);
|
| }
|
|
|
| // TestInstanceOf <src>
|
| @@ -1758,7 +1801,14 @@ void Interpreter::DoTestIn(InterpreterAssembler* assembler) {
|
| // Test if the object referenced by the <src> register is an an instance of type
|
| // referenced by the accumulator.
|
| void Interpreter::DoTestInstanceOf(InterpreterAssembler* assembler) {
|
| - DoBinaryOp<InstanceOfStub>(assembler);
|
| + struct Generator {
|
| + static Node* Generate(InterpreterAssembler* assembler,
|
| + compiler::Node* object, compiler::Node* callable,
|
| + compiler::Node* context) {
|
| + return assembler->InstanceOf(object, callable, context);
|
| + }
|
| + };
|
| + DoBinaryOp<Generator>(assembler);
|
| }
|
|
|
| // Jump <imm>
|
|
|