diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc index 76c3978f60..9538515b0c 100644 --- a/src/compiler/bytecode-graph-builder.cc +++ b/src/compiler/bytecode-graph-builder.cc @@ -2413,19 +2413,12 @@ void BytecodeGraphBuilder::VisitTestGreaterThanOrEqual() { BuildCompareOp(javascript()->GreaterThanOrEqual(GetCompareOperationHint())); } -void BytecodeGraphBuilder::VisitTestEqualStrictNoFeedback() { - // TODO(5310): Currently this is used with both Smi operands and with - // string operands. We pass string operands for static property check in - // VisitClassLiteralProperties. This should be changed, so we only use this - // for Smi operations and lower it to SpeculativeNumberEqual[kSignedSmall] - PrepareEagerCheckpoint(); +void BytecodeGraphBuilder::VisitTestReferenceEqual() { Node* left = environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); Node* right = environment()->LookupAccumulator(); - - Node* node = NewNode(javascript()->StrictEqual(CompareOperationHint::kAny), - left, right); - environment()->BindAccumulator(node, Environment::kAttachFrameState); + Node* result = NewNode(simplified()->ReferenceEqual(), left, right); + environment()->BindAccumulator(result); } void BytecodeGraphBuilder::BuildTestingOp(const Operator* op) { diff --git a/src/debug/debug-evaluate.cc b/src/debug/debug-evaluate.cc index a689b4cc62..334ba1a023 100644 --- a/src/debug/debug-evaluate.cc +++ b/src/debug/debug-evaluate.cc @@ -548,7 +548,7 @@ bool BytecodeHasNoSideEffect(interpreter::Bytecode bytecode) { case Bytecode::kTestGreaterThanOrEqual: case Bytecode::kTestInstanceOf: case Bytecode::kTestIn: - case Bytecode::kTestEqualStrictNoFeedback: + case Bytecode::kTestReferenceEqual: case Bytecode::kTestUndetectable: case Bytecode::kTestTypeOf: case Bytecode::kTestUndefined: diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc index 0558f45acf..6144f1f1ac 100644 --- a/src/interpreter/bytecode-array-builder.cc +++ b/src/interpreter/bytecode-array-builder.cc @@ -511,9 +511,6 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::CompareOperation( BytecodeArrayBuilder& BytecodeArrayBuilder::CompareOperation(Token::Value op, Register reg) { switch (op) { - case Token::Value::EQ_STRICT: - OutputTestEqualStrictNoFeedback(reg); - break; case Token::Value::IN: OutputTestIn(reg); break; @@ -523,6 +520,11 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::CompareOperation(Token::Value op, return *this; } +BytecodeArrayBuilder& BytecodeArrayBuilder::CompareReference(Register reg) { + OutputTestReferenceEqual(reg); + return *this; +} + BytecodeArrayBuilder& BytecodeArrayBuilder::CompareUndetectable() { OutputTestUndetectable(); return *this; diff --git a/src/interpreter/bytecode-array-builder.h b/src/interpreter/bytecode-array-builder.h index a22462d1fa..a2c5cadcc0 100644 --- a/src/interpreter/bytecode-array-builder.h +++ b/src/interpreter/bytecode-array-builder.h @@ -366,6 +366,7 @@ class V8_EXPORT_PRIVATE BytecodeArrayBuilder final { BytecodeArrayBuilder& CompareOperation(Token::Value op, Register reg, int feedback_slot); BytecodeArrayBuilder& CompareOperation(Token::Value op, Register reg); + BytecodeArrayBuilder& CompareReference(Register reg); BytecodeArrayBuilder& CompareUndetectable(); BytecodeArrayBuilder& CompareUndefined(); BytecodeArrayBuilder& CompareNull(); diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc index 4f0d3ebbef..a893eee3c9 100644 --- a/src/interpreter/bytecode-generator.cc +++ b/src/interpreter/bytecode-generator.cc @@ -235,7 +235,7 @@ class BytecodeGenerator::ControlScope::DeferredCommands final { builder() ->LoadLiteral(Smi::FromInt(entry.token)) - .CompareOperation(Token::EQ_STRICT, token_register_) + .CompareReference(token_register_) .JumpIfFalse(ToBooleanMode::kAlreadyBoolean, &fall_through); if (CommandUsesAccumulator(entry.command)) { @@ -899,6 +899,7 @@ BytecodeGenerator::BytecodeGenerator( execution_context_(nullptr), execution_result_(nullptr), incoming_new_target_or_generator_(), + dummy_feedback_slot_(), generator_jump_table_(nullptr), suspend_count_(0), loop_depth_(0), @@ -1846,10 +1847,13 @@ void BytecodeGenerator::BuildClassLiteral(ClassLiteral* expr) { // computed property name case in the parser. Since this is the only // case where we need to check for an own read only property we // special case this so we do not need to do this for every property. + + FeedbackSlot slot = GetDummyCompareICSlot(); BytecodeLabel done; builder() ->LoadLiteral(ast_string_constants()->prototype_string()) - .CompareOperation(Token::Value::EQ_STRICT, key) + .CompareOperation(Token::Value::EQ_STRICT, key, + feedback_index(slot)) .JumpIfFalse(ToBooleanMode::kAlreadyBoolean, &done) .CallRuntime(Runtime::kThrowStaticPrototypeError) .Bind(&done); @@ -3219,7 +3223,7 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) { feedback_index(feedback_spec()->AddLoadICSlot())) .StoreAccumulatorInRegister(output_value) .LoadLiteral(Smi::FromInt(JSGeneratorObject::kReturn)) - .CompareOperation(Token::EQ_STRICT, resume_mode) + .CompareReference(resume_mode) .JumpIfFalse(ToBooleanMode::kAlreadyBoolean, &completion_is_output_value) .LoadAccumulatorWithRegister(output_value); if (iterator_type == IteratorType::kAsync) { @@ -3288,7 +3292,7 @@ void BytecodeGenerator::BuildAwait(Expression* await_expr) { .CallRuntime(Runtime::kInlineGeneratorGetResumeMode, generator_object()) .StoreAccumulatorInRegister(resume_mode) .LoadLiteral(Smi::FromInt(JSGeneratorObject::kNext)) - .CompareOperation(Token::EQ_STRICT, resume_mode) + .CompareReference(resume_mode) .JumpIfTrue(ToBooleanMode::kAlreadyBoolean, &resume_next); // Resume with "throw" completion (rethrow the received value). @@ -5050,6 +5054,14 @@ FeedbackSlot BytecodeGenerator::GetCachedCreateClosureSlot( return slot; } +FeedbackSlot BytecodeGenerator::GetDummyCompareICSlot() { + if (!dummy_feedback_slot_.IsInvalid()) { + return dummy_feedback_slot_; + } + dummy_feedback_slot_ = feedback_spec()->AddCompareICSlot(); + return dummy_feedback_slot_; +} + Runtime::FunctionId BytecodeGenerator::StoreToSuperRuntimeId() { return is_strict(language_mode()) ? Runtime::kStoreToSuper_Strict : Runtime::kStoreToSuper_Sloppy; diff --git a/src/interpreter/bytecode-generator.h b/src/interpreter/bytecode-generator.h index febaf97b4e..88c2193a3e 100644 --- a/src/interpreter/bytecode-generator.h +++ b/src/interpreter/bytecode-generator.h @@ -270,6 +270,7 @@ class BytecodeGenerator final : public AstVisitor { FeedbackSlot GetCachedStoreGlobalICSlot(LanguageMode language_mode, Variable* variable); FeedbackSlot GetCachedCreateClosureSlot(FunctionLiteral* literal); + FeedbackSlot GetDummyCompareICSlot(); void AddToEagerLiteralsIfEager(FunctionLiteral* literal); @@ -356,6 +357,10 @@ class BytecodeGenerator final : public AstVisitor { Register incoming_new_target_or_generator_; + // Dummy feedback slot for compare operations, where we don't care about + // feedback + FeedbackSlot dummy_feedback_slot_; + BytecodeJumpTable* generator_jump_table_; int suspend_count_; int loop_depth_; diff --git a/src/interpreter/bytecodes.h b/src/interpreter/bytecodes.h index 1d133a0eef..6bbc3feea4 100644 --- a/src/interpreter/bytecodes.h +++ b/src/interpreter/bytecodes.h @@ -209,7 +209,7 @@ namespace interpreter { OperandType::kIdx) \ V(TestGreaterThanOrEqual, AccumulatorUse::kReadWrite, OperandType::kReg, \ OperandType::kIdx) \ - V(TestEqualStrictNoFeedback, AccumulatorUse::kReadWrite, OperandType::kReg) \ + V(TestReferenceEqual, AccumulatorUse::kReadWrite, OperandType::kReg) \ V(TestInstanceOf, AccumulatorUse::kReadWrite, OperandType::kReg, \ OperandType::kIdx) \ V(TestIn, AccumulatorUse::kReadWrite, OperandType::kReg) \ diff --git a/src/interpreter/interpreter-generator.cc b/src/interpreter/interpreter-generator.cc index 961597ee26..d88a06f1fe 100644 --- a/src/interpreter/interpreter-generator.cc +++ b/src/interpreter/interpreter-generator.cc @@ -1797,18 +1797,14 @@ IGNITION_HANDLER(TestGreaterThanOrEqual, InterpreterCompareOpAssembler) { CompareOpWithFeedback(Operation::kGreaterThanOrEqual); } -// TestEqualStrictNoFeedback +// TestReferenceEqual // -// Test if the value in the register is strictly equal to the accumulator. -// Type feedback is not collected. -IGNITION_HANDLER(TestEqualStrictNoFeedback, InterpreterAssembler) { +// Test if the value in the register is equal to the accumulator +// by means of simple comparison. For SMIs and simple reference comparisons. +IGNITION_HANDLER(TestReferenceEqual, InterpreterAssembler) { Node* lhs = LoadRegisterAtOperandIndex(0); Node* rhs = GetAccumulator(); - // TODO(5310): This is called only when lhs and rhs are Smis (for ex: - // try-finally or generators) or strings (only when visiting - // ClassLiteralProperties). We should be able to optimize this and not perform - // the full strict equality. - Node* result = StrictEqual(lhs, rhs); + Node* result = SelectBooleanConstant(WordEqual(lhs, rhs)); SetAccumulator(result); Dispatch(); } diff --git a/test/cctest/interpreter/bytecode_expectations/AsyncGenerators.golden b/test/cctest/interpreter/bytecode_expectations/AsyncGenerators.golden index df6b372358..e9d6e0c292 100644 --- a/test/cctest/interpreter/bytecode_expectations/AsyncGenerators.golden +++ b/test/cctest/interpreter/bytecode_expectations/AsyncGenerators.golden @@ -46,7 +46,7 @@ bytecodes: [ B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), B(Star), R(6), B(LdaZero), - B(TestEqualStrictNoFeedback), R(6), + B(TestReferenceEqual), R(6), B(JumpIfTrue), U8(5), B(Ldar), R(5), B(ReThrow), @@ -173,7 +173,7 @@ bytecodes: [ B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), B(Star), R(6), B(LdaZero), - B(TestEqualStrictNoFeedback), R(6), + B(TestReferenceEqual), R(6), B(JumpIfTrue), U8(5), B(Ldar), R(5), B(ReThrow), @@ -411,7 +411,7 @@ bytecodes: [ B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1), B(Star), R(16), B(LdaZero), - B(TestEqualStrictNoFeedback), R(16), + B(TestReferenceEqual), R(16), B(JumpIfTrue), U8(5), B(Ldar), R(15), B(ReThrow), @@ -587,7 +587,7 @@ bytecodes: [ B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), B(Star), R(13), B(LdaZero), - B(TestEqualStrictNoFeedback), R(13), + B(TestReferenceEqual), R(13), B(JumpIfTrue), U8(5), B(Ldar), R(12), B(ReThrow), @@ -605,7 +605,7 @@ bytecodes: [ B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), B(Star), R(13), B(LdaZero), - B(TestEqualStrictNoFeedback), R(13), + B(TestReferenceEqual), R(13), B(JumpIfTrue), U8(5), B(Ldar), R(12), B(ReThrow), @@ -630,7 +630,7 @@ bytecodes: [ B(LdaNamedProperty), R(5), U8(16), U8(32), B(Star), R(7), B(LdaSmi), I8(1), - B(TestEqualStrictNoFeedback), R(6), + B(TestReferenceEqual), R(6), B(JumpIfFalse), U8(10), B(LdaZero), B(Star), R(1), @@ -646,7 +646,7 @@ bytecodes: [ B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), B(Star), R(6), B(LdaZero), - B(TestEqualStrictNoFeedback), R(6), + B(TestReferenceEqual), R(6), B(JumpIfTrue), U8(5), B(Ldar), R(5), B(ReThrow), diff --git a/test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden b/test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden index ab03cea491..36ab53df73 100644 --- a/test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden +++ b/test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden @@ -88,7 +88,7 @@ snippet: " " frame size: 11 parameter count: 1 -bytecode array length: 75 +bytecode array length: 76 bytecodes: [ B(CreateFunctionContext), U8(2), B(PushContext), R(2), @@ -110,11 +110,11 @@ bytecodes: [ B(LdaImmutableCurrentContextSlot), U8(5), /* 106 E> */ B(ToName), R(9), B(LdaConstant), U8(5), - B(TestEqualStrictNoFeedback), R(9), + B(TestEqualStrict), R(9), U8(2), B(Mov), R(3), R(5), B(JumpIfFalse), U8(7), B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0), - B(CreateClosure), U8(6), U8(2), U8(2), + B(CreateClosure), U8(6), U8(3), U8(2), B(Star), R(10), B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(7), B(Star), R(4), diff --git a/test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden b/test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden index 95400dacf8..109d9faf6a 100644 --- a/test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden +++ b/test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden @@ -60,7 +60,7 @@ bytecodes: [ B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1), B(Star), R(21), B(LdaZero), - B(TestEqualStrictNoFeedback), R(21), + B(TestReferenceEqual), R(21), B(JumpIfTrue), U8(5), B(Ldar), R(20), B(ReThrow), @@ -144,7 +144,7 @@ bytecodes: [ B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1), B(Star), R(21), B(LdaZero), - B(TestEqualStrictNoFeedback), R(21), + B(TestReferenceEqual), R(21), B(JumpIfTrue), U8(5), B(Ldar), R(20), B(ReThrow), @@ -167,7 +167,7 @@ bytecodes: [ B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1), B(Star), R(20), B(LdaZero), - B(TestEqualStrictNoFeedback), R(20), + B(TestReferenceEqual), R(20), B(JumpIfTrue), U8(5), B(Ldar), R(19), B(ReThrow), @@ -179,7 +179,7 @@ bytecodes: [ B(Ldar), R(18), B(SetPendingMessage), B(LdaZero), - B(TestEqualStrictNoFeedback), R(16), + B(TestReferenceEqual), R(16), B(JumpIfFalse), U8(5), B(Ldar), R(17), B(ReThrow), @@ -313,7 +313,7 @@ bytecodes: [ B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1), B(Star), R(21), B(LdaZero), - B(TestEqualStrictNoFeedback), R(21), + B(TestReferenceEqual), R(21), B(JumpIfTrue), U8(5), B(Ldar), R(20), B(ReThrow), @@ -398,7 +398,7 @@ bytecodes: [ B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1), B(Star), R(21), B(LdaZero), - B(TestEqualStrictNoFeedback), R(21), + B(TestReferenceEqual), R(21), B(JumpIfTrue), U8(5), B(Ldar), R(20), B(ReThrow), @@ -421,7 +421,7 @@ bytecodes: [ B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1), B(Star), R(20), B(LdaZero), - B(TestEqualStrictNoFeedback), R(20), + B(TestReferenceEqual), R(20), B(JumpIfTrue), U8(5), B(Ldar), R(19), B(ReThrow), @@ -582,7 +582,7 @@ bytecodes: [ B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1), B(Star), R(21), B(LdaZero), - B(TestEqualStrictNoFeedback), R(21), + B(TestReferenceEqual), R(21), B(JumpIfTrue), U8(5), B(Ldar), R(20), B(ReThrow), @@ -674,7 +674,7 @@ bytecodes: [ B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1), B(Star), R(21), B(LdaZero), - B(TestEqualStrictNoFeedback), R(21), + B(TestReferenceEqual), R(21), B(JumpIfTrue), U8(5), B(Ldar), R(20), B(ReThrow), @@ -697,7 +697,7 @@ bytecodes: [ B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1), B(Star), R(20), B(LdaZero), - B(TestEqualStrictNoFeedback), R(20), + B(TestReferenceEqual), R(20), B(JumpIfTrue), U8(5), B(Ldar), R(19), B(ReThrow), @@ -709,7 +709,7 @@ bytecodes: [ B(Ldar), R(18), B(SetPendingMessage), B(LdaZero), - B(TestEqualStrictNoFeedback), R(16), + B(TestReferenceEqual), R(16), B(JumpIfFalse), U8(5), B(Ldar), R(17), B(ReThrow), diff --git a/test/cctest/interpreter/bytecode_expectations/ForOf.golden b/test/cctest/interpreter/bytecode_expectations/ForOf.golden index 00f90714d3..7ec4597b80 100644 --- a/test/cctest/interpreter/bytecode_expectations/ForOf.golden +++ b/test/cctest/interpreter/bytecode_expectations/ForOf.golden @@ -112,7 +112,7 @@ bytecodes: [ B(Ldar), R(11), B(SetPendingMessage), B(LdaZero), - B(TestEqualStrictNoFeedback), R(9), + B(TestReferenceEqual), R(9), B(JumpIfFalse), U8(5), B(Ldar), R(10), B(ReThrow), @@ -392,7 +392,7 @@ bytecodes: [ B(Ldar), R(11), B(SetPendingMessage), B(LdaZero), - B(TestEqualStrictNoFeedback), R(9), + B(TestReferenceEqual), R(9), B(JumpIfFalse), U8(5), B(Ldar), R(10), B(ReThrow), diff --git a/test/cctest/interpreter/bytecode_expectations/ForOfLoop.golden b/test/cctest/interpreter/bytecode_expectations/ForOfLoop.golden index 1a0155da79..c679e53795 100644 --- a/test/cctest/interpreter/bytecode_expectations/ForOfLoop.golden +++ b/test/cctest/interpreter/bytecode_expectations/ForOfLoop.golden @@ -116,7 +116,7 @@ bytecodes: [ B(Ldar), R(13), B(SetPendingMessage), B(LdaZero), - B(TestEqualStrictNoFeedback), R(11), + B(TestReferenceEqual), R(11), B(JumpIfFalse), U8(5), B(Ldar), R(12), B(ReThrow), @@ -287,7 +287,7 @@ bytecodes: [ B(Ldar), R(13), B(SetPendingMessage), B(LdaZero), - B(TestEqualStrictNoFeedback), R(11), + B(TestReferenceEqual), R(11), B(JumpIfFalse), U8(5), B(Ldar), R(12), B(ReThrow), @@ -434,7 +434,7 @@ bytecodes: [ B(Ldar), R(11), B(SetPendingMessage), B(LdaZero), - B(TestEqualStrictNoFeedback), R(9), + B(TestReferenceEqual), R(9), B(JumpIfFalse), U8(5), B(Ldar), R(10), B(ReThrow), @@ -585,7 +585,7 @@ bytecodes: [ B(Ldar), R(16), B(SetPendingMessage), B(LdaZero), - B(TestEqualStrictNoFeedback), R(14), + B(TestReferenceEqual), R(14), B(JumpIfFalse), U8(5), B(Ldar), R(15), B(ReThrow), @@ -739,7 +739,7 @@ bytecodes: [ B(Ldar), R(15), B(SetPendingMessage), B(LdaZero), - B(TestEqualStrictNoFeedback), R(13), + B(TestReferenceEqual), R(13), B(JumpIfFalse), U8(5), B(Ldar), R(14), B(ReThrow), @@ -1063,7 +1063,7 @@ bytecodes: [ B(Ldar), R(20), B(SetPendingMessage), B(LdaZero), - B(TestEqualStrictNoFeedback), R(18), + B(TestReferenceEqual), R(18), B(JumpIfFalse), U8(5), B(Ldar), R(19), B(ReThrow), @@ -1203,7 +1203,7 @@ bytecodes: [ B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1), B(Star), R(22), B(LdaZero), - B(TestEqualStrictNoFeedback), R(22), + B(TestReferenceEqual), R(22), B(JumpIfTrue), U8(5), B(Ldar), R(21), B(ReThrow), @@ -1279,7 +1279,7 @@ bytecodes: [ B(Ldar), R(19), B(SetPendingMessage), B(LdaZero), - B(TestEqualStrictNoFeedback), R(17), + B(TestReferenceEqual), R(17), B(JumpIfFalse), U8(5), B(Ldar), R(18), B(ReThrow), diff --git a/test/cctest/interpreter/bytecode_expectations/Generators.golden b/test/cctest/interpreter/bytecode_expectations/Generators.golden index 2dc77a7986..6d95879281 100644 --- a/test/cctest/interpreter/bytecode_expectations/Generators.golden +++ b/test/cctest/interpreter/bytecode_expectations/Generators.golden @@ -348,7 +348,7 @@ bytecodes: [ B(LdaNamedProperty), R(1), U8(12), U8(26), B(Star), R(3), B(LdaSmi), I8(1), - B(TestEqualStrictNoFeedback), R(2), + B(TestReferenceEqual), R(2), B(JumpIfFalse), U8(5), B(Ldar), R(3), /* 54 S> */ B(Return), diff --git a/test/cctest/interpreter/bytecode_expectations/StandardForLoop.golden b/test/cctest/interpreter/bytecode_expectations/StandardForLoop.golden index 80609db7b8..425a16f84d 100644 --- a/test/cctest/interpreter/bytecode_expectations/StandardForLoop.golden +++ b/test/cctest/interpreter/bytecode_expectations/StandardForLoop.golden @@ -500,7 +500,7 @@ bytecodes: [ B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1), B(Star), R(8), B(LdaZero), - B(TestEqualStrictNoFeedback), R(8), + B(TestReferenceEqual), R(8), B(JumpIfTrue), U8(5), B(Ldar), R(7), B(ReThrow), diff --git a/test/cctest/interpreter/bytecode_expectations/StaticClassFields.golden b/test/cctest/interpreter/bytecode_expectations/StaticClassFields.golden index 342af2fe11..94b20b020c 100644 --- a/test/cctest/interpreter/bytecode_expectations/StaticClassFields.golden +++ b/test/cctest/interpreter/bytecode_expectations/StaticClassFields.golden @@ -29,7 +29,7 @@ snippet: " " frame size: 11 parameter count: 1 -bytecode array length: 193 +bytecode array length: 195 bytecodes: [ /* 30 E> */ B(StackCheck), B(Ldar), R(closure), @@ -51,7 +51,7 @@ bytecodes: [ B(LdaConstant), U8(4), B(Star), R(10), B(LdaConstant), U8(5), - B(TestEqualStrictNoFeedback), R(10), + B(TestEqualStrict), R(10), U8(1), B(Mov), R(5), R(7), B(JumpIfFalse), U8(7), B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0), @@ -60,12 +60,12 @@ bytecodes: [ B(CallRuntime), U16(Runtime::kDefineClass), R(6), U8(5), B(Star), R(6), B(Mov), R(5), R(1), - B(CreateClosure), U8(6), U8(1), U8(2), + B(CreateClosure), U8(6), U8(2), U8(2), B(Star), R(7), - B(StaNamedProperty), R(5), U8(7), U8(2), - B(CreateClosure), U8(8), U8(4), U8(2), + B(StaNamedProperty), R(5), U8(7), U8(3), + B(CreateClosure), U8(8), U8(5), U8(2), B(Star), R(9), - B(CallProperty0), R(9), R(1), U8(5), + B(CallProperty0), R(9), R(1), U8(6), B(PopContext), R(4), B(Mov), R(1), R(2), B(Ldar), R(closure), @@ -77,7 +77,7 @@ bytecodes: [ B(StaCurrentContextSlot), U8(5), B(LdaTheHole), B(Star), R(8), - B(CreateClosure), U8(11), U8(7), U8(2), + B(CreateClosure), U8(11), U8(8), U8(2), B(Star), R(5), B(LdaConstant), U8(10), B(Star), R(6), @@ -87,7 +87,7 @@ bytecodes: [ B(LdaConstant), U8(4), B(Star), R(10), B(LdaConstant), U8(5), - B(TestEqualStrictNoFeedback), R(10), + B(TestEqualStrict), R(10), U8(1), B(Mov), R(5), R(7), B(JumpIfFalse), U8(7), B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0), @@ -96,18 +96,18 @@ bytecodes: [ B(CallRuntime), U16(Runtime::kDefineClass), R(6), U8(5), B(Star), R(6), B(Mov), R(5), R(0), - B(CreateClosure), U8(12), U8(8), U8(2), + B(CreateClosure), U8(12), U8(9), U8(2), B(Star), R(7), - B(StaNamedProperty), R(5), U8(7), U8(9), - B(CreateClosure), U8(13), U8(11), U8(2), + B(StaNamedProperty), R(5), U8(7), U8(10), + B(CreateClosure), U8(13), U8(12), U8(2), B(Star), R(9), - B(CallProperty0), R(9), R(0), U8(12), + B(CallProperty0), R(9), R(0), U8(13), B(PopContext), R(4), B(Mov), R(0), R(3), /* 197 S> */ B(Ldar), R(2), - /* 197 E> */ B(Construct), R(2), R(0), U8(0), U8(14), + /* 197 E> */ B(Construct), R(2), R(0), U8(0), U8(15), /* 206 S> */ B(Ldar), R(0), - /* 206 E> */ B(Construct), R(0), R(0), U8(0), U8(16), + /* 206 E> */ B(Construct), R(0), R(0), U8(0), U8(17), B(LdaUndefined), /* 215 S> */ B(Return), ] @@ -168,7 +168,7 @@ snippet: " " frame size: 15 parameter count: 1 -bytecode array length: 346 +bytecode array length: 349 bytecodes: [ /* 30 E> */ B(StackCheck), B(Ldar), R(closure), @@ -197,7 +197,7 @@ bytecodes: [ B(LdaConstant), U8(6), B(Star), R(12), B(LdaConstant), U8(7), - B(TestEqualStrictNoFeedback), R(12), + B(TestEqualStrict), R(12), U8(2), B(Mov), R(13), R(10), B(Mov), R(7), R(9), B(JumpIfFalse), U8(7), @@ -207,12 +207,12 @@ bytecodes: [ B(CallRuntime), U16(Runtime::kDefineClass), R(8), U8(5), B(Star), R(8), B(Mov), R(7), R(2), - B(CreateClosure), U8(8), U8(2), U8(2), + B(CreateClosure), U8(8), U8(3), U8(2), B(Star), R(9), - B(StaNamedProperty), R(7), U8(9), U8(3), - B(CreateClosure), U8(10), U8(5), U8(2), + B(StaNamedProperty), R(7), U8(9), U8(4), + B(CreateClosure), U8(10), U8(6), U8(2), B(Star), R(11), - B(CallProperty0), R(11), R(2), U8(6), + B(CallProperty0), R(11), R(2), U8(7), B(PopContext), R(6), B(Mov), R(2), R(3), B(Ldar), R(closure), @@ -224,14 +224,14 @@ bytecodes: [ B(StaCurrentContextSlot), U8(5), B(LdaTheHole), B(Star), R(14), - B(CreateClosure), U8(14), U8(8), U8(2), + B(CreateClosure), U8(14), U8(9), U8(2), B(Star), R(11), B(LdaConstant), U8(13), B(Star), R(12), B(Mov), R(11), R(13), B(CallRuntime), U16(Runtime::kDefineClass), R(12), U8(3), B(Star), R(12), - B(CreateClosure), U8(15), U8(9), U8(2), + B(CreateClosure), U8(15), U8(10), U8(2), B(Star), R(7), B(LdaConstant), U8(12), B(Star), R(8), @@ -241,24 +241,24 @@ bytecodes: [ B(LdaConstant), U8(6), B(Star), R(12), B(LdaConstant), U8(7), - B(TestEqualStrictNoFeedback), R(12), + B(TestEqualStrict), R(12), U8(2), B(Mov), R(7), R(9), B(Mov), R(13), R(10), B(JumpIfFalse), U8(7), B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0), B(Ldar), R(12), B(StaCurrentContextSlot), U8(5), - B(CreateClosure), U8(16), U8(10), U8(2), + B(CreateClosure), U8(16), U8(11), U8(2), B(Star), R(13), B(CallRuntime), U16(Runtime::kDefineClass), R(8), U8(6), B(Star), R(8), B(Mov), R(7), R(1), - B(CreateClosure), U8(17), U8(11), U8(2), + B(CreateClosure), U8(17), U8(12), U8(2), B(Star), R(9), - B(StaNamedProperty), R(7), U8(9), U8(12), - B(CreateClosure), U8(18), U8(14), U8(2), + B(StaNamedProperty), R(7), U8(9), U8(13), + B(CreateClosure), U8(18), U8(15), U8(2), B(Star), R(11), - B(CallProperty0), R(11), R(1), U8(15), + B(CallProperty0), R(11), R(1), U8(16), B(PopContext), R(6), B(Mov), R(1), R(4), B(Ldar), R(closure), @@ -268,7 +268,7 @@ bytecodes: [ B(StaCurrentContextSlot), U8(4), B(LdaTheHole), B(StaCurrentContextSlot), U8(5), - /* 313 E> */ B(CreateClosure), U8(21), U8(17), U8(2), + /* 313 E> */ B(CreateClosure), U8(21), U8(18), U8(2), B(Star), R(7), B(LdaConstant), U8(20), B(Star), R(8), @@ -278,7 +278,7 @@ bytecodes: [ B(LdaConstant), U8(6), B(Star), R(12), B(LdaConstant), U8(7), - B(TestEqualStrictNoFeedback), R(12), + B(TestEqualStrict), R(12), U8(2), B(Mov), R(1), R(10), B(Mov), R(7), R(9), B(JumpIfFalse), U8(7), @@ -288,22 +288,22 @@ bytecodes: [ B(CallRuntime), U16(Runtime::kDefineClass), R(8), U8(5), B(Star), R(8), B(Mov), R(7), R(0), - B(CreateClosure), U8(22), U8(18), U8(2), + B(CreateClosure), U8(22), U8(19), U8(2), B(Star), R(9), - B(StaNamedProperty), R(7), U8(9), U8(19), - B(CreateClosure), U8(23), U8(21), U8(2), + B(StaNamedProperty), R(7), U8(9), U8(20), + B(CreateClosure), U8(23), U8(22), U8(2), B(Star), R(11), B(Ldar), R(0), - B(StaNamedProperty), R(11), U8(24), U8(22), - B(CallProperty0), R(11), R(0), U8(24), + B(StaNamedProperty), R(11), U8(24), U8(23), + B(CallProperty0), R(11), R(0), U8(25), B(PopContext), R(6), B(Mov), R(0), R(5), /* 456 S> */ B(Ldar), R(3), - /* 456 E> */ B(Construct), R(3), R(0), U8(0), U8(26), + /* 456 E> */ B(Construct), R(3), R(0), U8(0), U8(27), /* 465 S> */ B(Ldar), R(4), - /* 465 E> */ B(Construct), R(4), R(0), U8(0), U8(28), + /* 465 E> */ B(Construct), R(4), R(0), U8(0), U8(29), /* 474 S> */ B(Ldar), R(0), - /* 474 E> */ B(Construct), R(0), R(0), U8(0), U8(30), + /* 474 E> */ B(Construct), R(0), R(0), U8(0), U8(31), B(LdaUndefined), /* 483 S> */ B(Return), ] diff --git a/test/cctest/interpreter/bytecode_expectations/TryFinally.golden b/test/cctest/interpreter/bytecode_expectations/TryFinally.golden index 3aa7006e38..9c3215fa9f 100644 --- a/test/cctest/interpreter/bytecode_expectations/TryFinally.golden +++ b/test/cctest/interpreter/bytecode_expectations/TryFinally.golden @@ -35,7 +35,7 @@ bytecodes: [ B(Ldar), R(3), /* 72 E> */ B(SetPendingMessage), B(LdaZero), - B(TestEqualStrictNoFeedback), R(1), + B(TestReferenceEqual), R(1), B(JumpIfFalse), U8(5), B(Ldar), R(2), B(ReThrow), @@ -91,7 +91,7 @@ bytecodes: [ B(Ldar), R(3), /* 92 E> */ B(SetPendingMessage), B(LdaZero), - B(TestEqualStrictNoFeedback), R(1), + B(TestReferenceEqual), R(1), B(JumpIfFalse), U8(5), B(Ldar), R(2), B(ReThrow), @@ -162,7 +162,7 @@ bytecodes: [ B(Ldar), R(3), /* 116 E> */ B(SetPendingMessage), B(LdaZero), - B(TestEqualStrictNoFeedback), R(1), + B(TestReferenceEqual), R(1), B(JumpIfFalse), U8(5), B(Ldar), R(2), B(ReThrow), diff --git a/test/unittests/interpreter/bytecode-array-builder-unittest.cc b/test/unittests/interpreter/bytecode-array-builder-unittest.cc index e6348f4785..cd0704c63d 100644 --- a/test/unittests/interpreter/bytecode-array-builder-unittest.cc +++ b/test/unittests/interpreter/bytecode-array-builder-unittest.cc @@ -249,7 +249,6 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) { // Emit test operator invocations. builder.CompareOperation(Token::Value::EQ, reg, 1) .CompareOperation(Token::Value::EQ_STRICT, reg, 2) - .CompareOperation(Token::Value::EQ_STRICT, reg) .CompareOperation(Token::Value::LT, reg, 3) .CompareOperation(Token::Value::GT, reg, 4) .CompareOperation(Token::Value::LTE, reg, 5) @@ -257,6 +256,7 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) { .CompareTypeOf(TestTypeOfFlags::LiteralFlag::kNumber) .CompareOperation(Token::Value::INSTANCEOF, reg, 7) .CompareOperation(Token::Value::IN, reg) + .CompareReference(reg) .CompareUndetectable() .CompareUndefined() .CompareNull();