[ignition] Optimizing Smi only comparisons
There are various situations where we explicitly compare a SMI against another SMI (e.g., BuildIndexedJump). This is also a common pattern for generated code (e.g., comparing a loop variable with an integer). Instead of using the generic equality/strict-equality stub for this, which is expensive, this CL offers a simple comparison stub, repurposing the TestEqualStrictNoFeedback bytecode to TestReferenceEqual Bug: v8:5310 Change-Id: Ib2b47cd24d5386cf0d20d3bd794776dc6e3a02a5 Reviewed-on: https://chromium-review.googlesource.com/1007542 Reviewed-by: Leszek Swirski <leszeks@chromium.org> Commit-Queue: Christian O. Andersson <cricke@chromium.org> Cr-Commit-Position: refs/heads/master@{#52655}
This commit is contained in:
parent
f459a424df
commit
894b95fe38
@ -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) {
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -270,6 +270,7 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
|
||||
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<BytecodeGenerator> {
|
||||
|
||||
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_;
|
||||
|
@ -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) \
|
||||
|
@ -1797,18 +1797,14 @@ IGNITION_HANDLER(TestGreaterThanOrEqual, InterpreterCompareOpAssembler) {
|
||||
CompareOpWithFeedback(Operation::kGreaterThanOrEqual);
|
||||
}
|
||||
|
||||
// TestEqualStrictNoFeedback <src>
|
||||
// TestReferenceEqual <src>
|
||||
//
|
||||
// Test if the value in the <src> register is strictly equal to the accumulator.
|
||||
// Type feedback is not collected.
|
||||
IGNITION_HANDLER(TestEqualStrictNoFeedback, InterpreterAssembler) {
|
||||
// Test if the value in the <src> 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();
|
||||
}
|
||||
|
@ -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),
|
||||
|
@ -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),
|
||||
|
@ -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),
|
||||
|
@ -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),
|
||||
|
@ -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),
|
||||
|
@ -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),
|
||||
|
@ -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),
|
||||
|
@ -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),
|
||||
]
|
||||
|
@ -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),
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user