[Cleanup][Interpreter] Move feedback slot allocation to bytecode generator

Moves the feedback vector slot allocation out of ast-numbering and into
bytecode generation directly. This has a couple of benifits, including reduced
AST size, avoid code duplication and reduced feedback vector sizes in many cases
due to only allocating slots when needed. Also removes AstProperties since
this is no longer needed.

AstNumbering is now only used to allocate suspend ids for generators.

BUG=v8:6921

Change-Id: I103e8593c94ef5b2e56c34ef4f77bd6e7d64796f
Reviewed-on: https://chromium-review.googlesource.com/722959
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48757}
This commit is contained in:
Ross McIlroy 2017-10-19 16:12:42 +01:00 committed by Commit Bot
parent 3d4a982685
commit ed592eb03f
54 changed files with 804 additions and 1469 deletions

View File

@ -15,16 +15,11 @@ namespace internal {
class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
public:
AstNumberingVisitor(uintptr_t stack_limit, Zone* zone,
Compiler::EagerInnerFunctionLiterals* eager_literals,
bool collect_type_profile = false)
Compiler::EagerInnerFunctionLiterals* eager_literals)
: zone_(zone),
eager_literals_(eager_literals),
suspend_count_(0),
properties_(zone),
language_mode_(LanguageMode::kSloppy),
slot_cache_(zone),
dont_optimize_reason_(kNoReason),
collect_type_profile_(collect_type_profile) {
dont_optimize_reason_(kNoReason) {
InitializeAstVisitor(stack_limit);
}
@ -36,10 +31,6 @@ class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
AST_NODE_LIST(DEFINE_VISIT)
#undef DEFINE_VISIT
void VisitVariableProxy(VariableProxy* node, TypeofMode typeof_mode);
void VisitVariableProxyReference(VariableProxy* node);
void VisitPropertyReference(Property* node);
void VisitReference(Expression* expr);
void VisitSuspend(Suspend* node);
void VisitStatementsAndDeclarations(Block* node);
@ -52,25 +43,6 @@ class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
dont_optimize_reason_ = reason;
}
template <typename Node>
void ReserveFeedbackSlots(Node* node) {
node->AssignFeedbackSlots(properties_.get_spec(), language_mode_,
function_kind_, &slot_cache_);
}
class LanguageModeScope {
public:
LanguageModeScope(AstNumberingVisitor* visitor, LanguageMode language_mode)
: visitor_(visitor), outer_language_mode_(visitor->language_mode_) {
visitor_->language_mode_ = language_mode;
}
~LanguageModeScope() { visitor_->language_mode_ = outer_language_mode_; }
private:
AstNumberingVisitor* visitor_;
LanguageMode outer_language_mode_;
};
BailoutReason dont_optimize_reason() const { return dont_optimize_reason_; }
Zone* zone() const { return zone_; }
@ -78,105 +50,72 @@ class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
Zone* zone_;
Compiler::EagerInnerFunctionLiterals* eager_literals_;
int suspend_count_;
AstProperties properties_;
LanguageMode language_mode_;
FunctionKind function_kind_;
// The slot cache allows us to reuse certain feedback slots.
FeedbackSlotCache slot_cache_;
BailoutReason dont_optimize_reason_;
bool collect_type_profile_;
DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
DISALLOW_COPY_AND_ASSIGN(AstNumberingVisitor);
};
void AstNumberingVisitor::VisitVariableDeclaration(VariableDeclaration* node) {
VisitVariableProxy(node->proxy());
}
void AstNumberingVisitor::VisitEmptyStatement(EmptyStatement* node) {
}
void AstNumberingVisitor::VisitSloppyBlockFunctionStatement(
SloppyBlockFunctionStatement* node) {
Visit(node->statement());
}
void AstNumberingVisitor::VisitContinueStatement(ContinueStatement* node) {
}
void AstNumberingVisitor::VisitBreakStatement(BreakStatement* node) {
}
void AstNumberingVisitor::VisitDebuggerStatement(DebuggerStatement* node) {
}
void AstNumberingVisitor::VisitNativeFunctionLiteral(
NativeFunctionLiteral* node) {
DisableOptimization(kNativeFunctionLiteral);
ReserveFeedbackSlots(node);
}
void AstNumberingVisitor::VisitDoExpression(DoExpression* node) {
Visit(node->block());
Visit(node->result());
}
void AstNumberingVisitor::VisitLiteral(Literal* node) {
}
void AstNumberingVisitor::VisitRegExpLiteral(RegExpLiteral* node) {
ReserveFeedbackSlots(node);
}
void AstNumberingVisitor::VisitVariableProxyReference(VariableProxy* node) {
}
void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node,
TypeofMode typeof_mode) {
VisitVariableProxyReference(node);
node->AssignFeedbackSlots(properties_.get_spec(), typeof_mode, &slot_cache_);
}
void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node) {
VisitVariableProxy(node, NOT_INSIDE_TYPEOF);
}
void AstNumberingVisitor::VisitThisFunction(ThisFunction* node) {
}
void AstNumberingVisitor::VisitSuperPropertyReference(
SuperPropertyReference* node) {
Visit(node->this_var());
Visit(node->home_object());
}
void AstNumberingVisitor::VisitSuperCallReference(SuperCallReference* node) {
Visit(node->this_var());
Visit(node->new_target_var());
Visit(node->this_function_var());
}
void AstNumberingVisitor::VisitExpressionStatement(ExpressionStatement* node) {
Visit(node->expression());
}
void AstNumberingVisitor::VisitReturnStatement(ReturnStatement* node) {
Visit(node->expression());
}
@ -196,7 +135,6 @@ void AstNumberingVisitor::VisitYieldStar(YieldStar* node) {
node->set_await_delegated_iterator_output_suspend_id(suspend_count_++);
}
Visit(node->expression());
ReserveFeedbackSlots(node);
}
void AstNumberingVisitor::VisitAwait(Await* node) { VisitSuspend(node); }
@ -205,32 +143,16 @@ void AstNumberingVisitor::VisitThrow(Throw* node) {
Visit(node->exception());
}
void AstNumberingVisitor::VisitUnaryOperation(UnaryOperation* node) {
if ((node->op() == Token::TYPEOF) && node->expression()->IsVariableProxy()) {
VariableProxy* proxy = node->expression()->AsVariableProxy();
VisitVariableProxy(proxy, INSIDE_TYPEOF);
} else {
Visit(node->expression());
}
ReserveFeedbackSlots(node);
Visit(node->expression());
}
void AstNumberingVisitor::VisitCountOperation(CountOperation* node) {
Visit(node->expression());
ReserveFeedbackSlots(node);
}
void AstNumberingVisitor::VisitBlock(Block* node) {
Scope* scope = node->scope();
if (scope != nullptr) {
LanguageModeScope language_mode_scope(this, scope->language_mode());
VisitStatementsAndDeclarations(node);
} else {
VisitStatementsAndDeclarations(node);
}
VisitStatementsAndDeclarations(node);
}
void AstNumberingVisitor::VisitStatementsAndDeclarations(Block* node) {
@ -245,18 +167,15 @@ void AstNumberingVisitor::VisitFunctionDeclaration(FunctionDeclaration* node) {
VisitFunctionLiteral(node->fun());
}
void AstNumberingVisitor::VisitCallRuntime(CallRuntime* node) {
VisitArguments(node->arguments());
}
void AstNumberingVisitor::VisitWithStatement(WithStatement* node) {
Visit(node->expression());
Visit(node->statement());
}
void AstNumberingVisitor::VisitDoWhileStatement(DoWhileStatement* node) {
node->set_first_suspend_id(suspend_count_);
Visit(node->body());
@ -264,7 +183,6 @@ void AstNumberingVisitor::VisitDoWhileStatement(DoWhileStatement* node) {
node->set_suspend_count(suspend_count_ - node->first_suspend_id());
}
void AstNumberingVisitor::VisitWhileStatement(WhileStatement* node) {
node->set_first_suspend_id(suspend_count_);
Visit(node->cond());
@ -272,46 +190,25 @@ void AstNumberingVisitor::VisitWhileStatement(WhileStatement* node) {
node->set_suspend_count(suspend_count_ - node->first_suspend_id());
}
void AstNumberingVisitor::VisitTryCatchStatement(TryCatchStatement* node) {
DCHECK(node->scope() == nullptr || !node->scope()->HasBeenRemoved());
Visit(node->try_block());
Visit(node->catch_block());
}
void AstNumberingVisitor::VisitTryFinallyStatement(TryFinallyStatement* node) {
Visit(node->try_block());
Visit(node->finally_block());
}
void AstNumberingVisitor::VisitPropertyReference(Property* node) {
void AstNumberingVisitor::VisitProperty(Property* node) {
Visit(node->key());
Visit(node->obj());
}
void AstNumberingVisitor::VisitReference(Expression* expr) {
DCHECK(expr->IsProperty() || expr->IsVariableProxy());
if (expr->IsProperty()) {
VisitPropertyReference(expr->AsProperty());
} else {
VisitVariableProxyReference(expr->AsVariableProxy());
}
}
void AstNumberingVisitor::VisitProperty(Property* node) {
VisitPropertyReference(node);
ReserveFeedbackSlots(node);
}
void AstNumberingVisitor::VisitAssignment(Assignment* node) {
VisitReference(node->target());
Visit(node->target());
Visit(node->value());
ReserveFeedbackSlots(node);
}
void AstNumberingVisitor::VisitCompoundAssignment(CompoundAssignment* node) {
@ -322,14 +219,11 @@ void AstNumberingVisitor::VisitCompoundAssignment(CompoundAssignment* node) {
void AstNumberingVisitor::VisitBinaryOperation(BinaryOperation* node) {
Visit(node->left());
Visit(node->right());
ReserveFeedbackSlots(node);
}
void AstNumberingVisitor::VisitCompareOperation(CompareOperation* node) {
Visit(node->left());
Visit(node->right());
ReserveFeedbackSlots(node);
}
void AstNumberingVisitor::VisitSpread(Spread* node) {
@ -342,7 +236,6 @@ void AstNumberingVisitor::VisitEmptyParentheses(EmptyParentheses* node) {
void AstNumberingVisitor::VisitGetIterator(GetIterator* node) {
Visit(node->iterable());
ReserveFeedbackSlots(node);
}
void AstNumberingVisitor::VisitGetTemplateObject(GetTemplateObject* node) {}
@ -358,10 +251,8 @@ void AstNumberingVisitor::VisitForInStatement(ForInStatement* node) {
Visit(node->each());
Visit(node->body());
node->set_suspend_count(suspend_count_ - node->first_suspend_id());
ReserveFeedbackSlots(node);
}
void AstNumberingVisitor::VisitForOfStatement(ForOfStatement* node) {
Visit(node->assign_iterator()); // Not part of loop.
node->set_first_suspend_id(suspend_count_);
@ -372,14 +263,12 @@ void AstNumberingVisitor::VisitForOfStatement(ForOfStatement* node) {
node->set_suspend_count(suspend_count_ - node->first_suspend_id());
}
void AstNumberingVisitor::VisitConditional(Conditional* node) {
Visit(node->condition());
Visit(node->then_expression());
Visit(node->else_expression());
}
void AstNumberingVisitor::VisitIfStatement(IfStatement* node) {
Visit(node->condition());
Visit(node->then_statement());
@ -388,17 +277,14 @@ void AstNumberingVisitor::VisitIfStatement(IfStatement* node) {
}
}
void AstNumberingVisitor::VisitSwitchStatement(SwitchStatement* node) {
Visit(node->tag());
for (CaseClause* clause : *node->cases()) {
if (!clause->is_default()) Visit(clause->label());
VisitStatements(clause->statements());
ReserveFeedbackSlots(clause);
}
}
void AstNumberingVisitor::VisitForStatement(ForStatement* node) {
if (node->init() != nullptr) Visit(node->init()); // Not part of loop.
node->set_first_suspend_id(suspend_count_);
@ -408,18 +294,14 @@ void AstNumberingVisitor::VisitForStatement(ForStatement* node) {
node->set_suspend_count(suspend_count_ - node->first_suspend_id());
}
void AstNumberingVisitor::VisitClassLiteral(ClassLiteral* node) {
LanguageModeScope language_mode_scope(this, LanguageMode::kStrict);
if (node->extends()) Visit(node->extends());
if (node->constructor()) Visit(node->constructor());
for (int i = 0; i < node->properties()->length(); i++) {
VisitLiteralProperty(node->properties()->at(i));
}
ReserveFeedbackSlots(node);
}
void AstNumberingVisitor::VisitObjectLiteral(ObjectLiteral* node) {
for (int i = 0; i < node->properties()->length(); i++) {
VisitLiteralProperty(node->properties()->at(i));
@ -429,7 +311,6 @@ void AstNumberingVisitor::VisitObjectLiteral(ObjectLiteral* node) {
// is shadowed by a later occurrence of the same key. For the
// marked expressions, no store code will be is emitted.
node->CalculateEmitStore(zone_);
ReserveFeedbackSlots(node);
}
void AstNumberingVisitor::VisitLiteralProperty(LiteralProperty* node) {
@ -442,24 +323,18 @@ void AstNumberingVisitor::VisitArrayLiteral(ArrayLiteral* node) {
Visit(node->values()->at(i));
}
node->InitDepthAndFlags();
ReserveFeedbackSlots(node);
}
void AstNumberingVisitor::VisitCall(Call* node) {
ReserveFeedbackSlots(node);
Visit(node->expression());
VisitArguments(node->arguments());
}
void AstNumberingVisitor::VisitCallNew(CallNew* node) {
ReserveFeedbackSlots(node);
Visit(node->expression());
VisitArguments(node->arguments());
}
void AstNumberingVisitor::VisitStatements(ZoneList<Statement*>* statements) {
if (statements == nullptr) return;
for (int i = 0; i < statements->length(); i++) {
@ -472,14 +347,12 @@ void AstNumberingVisitor::VisitDeclarations(Declaration::List* decls) {
for (Declaration* decl : *decls) Visit(decl);
}
void AstNumberingVisitor::VisitArguments(ZoneList<Expression*>* arguments) {
for (int i = 0; i < arguments->length(); i++) {
Visit(arguments->at(i));
}
}
void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) {
if (node->ShouldEagerCompile()) {
if (eager_literals_) {
@ -494,30 +367,21 @@ void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) {
return;
}
}
ReserveFeedbackSlots(node);
}
void AstNumberingVisitor::VisitRewritableExpression(
RewritableExpression* node) {
Visit(node->expression());
}
bool AstNumberingVisitor::Renumber(FunctionLiteral* node) {
DeclarationScope* scope = node->scope();
DCHECK(!scope->HasBeenRemoved());
function_kind_ = node->kind();
LanguageModeScope language_mode_scope(this, node->language_mode());
if (collect_type_profile_) {
properties_.get_spec()->AddTypeProfileSlot();
}
VisitDeclarations(scope->declarations());
VisitStatements(node->body());
node->set_ast_properties(&properties_);
node->set_dont_optimize_reason(dont_optimize_reason());
node->set_suspend_count(suspend_count_);
@ -526,14 +390,12 @@ bool AstNumberingVisitor::Renumber(FunctionLiteral* node) {
bool AstNumbering::Renumber(
uintptr_t stack_limit, Zone* zone, FunctionLiteral* function,
Compiler::EagerInnerFunctionLiterals* eager_literals,
bool collect_type_profile) {
Compiler::EagerInnerFunctionLiterals* eager_literals) {
DisallowHeapAllocation no_allocation;
DisallowHandleAllocation no_handles;
DisallowHandleDereference no_deref;
AstNumberingVisitor visitor(stack_limit, zone, eager_literals,
collect_type_profile);
AstNumberingVisitor visitor(stack_limit, zone, eager_literals);
return visitor.Renumber(function);
}
} // namespace internal

View File

@ -22,13 +22,12 @@ template <typename T>
class ZoneVector;
namespace AstNumbering {
// Assign type feedback IDs, bailout IDs, and generator suspend IDs to an AST
// node tree; perform catch prediction for TryStatements. If |eager_literals| is
// non-null, adds any eager inner literal functions into it.
// Assign bailout IDs, and generator suspend IDs to an AST node tree; perform
// catch prediction for TryStatements. If |eager_literals| is non-null, adds any
// eager inner literal functions into it.
bool Renumber(
uintptr_t stack_limit, Zone* zone, FunctionLiteral* function,
ThreadedList<ThreadedListZoneEntry<FunctionLiteral*>>* eager_literals,
bool collect_type_profile = false);
ThreadedList<ThreadedListZoneEntry<FunctionLiteral*>>* eager_literals);
}
// Some details on suspend IDs

View File

@ -201,76 +201,12 @@ void VariableProxy::BindTo(Variable* var) {
if (is_assigned()) var->set_maybe_assigned();
}
void VariableProxy::AssignFeedbackSlots(FeedbackVectorSpec* spec,
TypeofMode typeof_mode,
FeedbackSlotCache* cache) {
if (UsesVariableFeedbackSlot()) {
// VariableProxies that point to the same Variable within a function can
// make their loads from the same IC slot.
if (var()->IsUnallocated() || var()->mode() == DYNAMIC_GLOBAL) {
FeedbackSlot slot = cache->Get(typeof_mode, var());
if (!slot.IsInvalid()) {
variable_feedback_slot_ = slot;
return;
}
variable_feedback_slot_ = spec->AddLoadGlobalICSlot(typeof_mode);
cache->Put(typeof_mode, var(), variable_feedback_slot_);
} else {
variable_feedback_slot_ = spec->AddLoadICSlot();
}
}
}
static void AssignVectorSlots(Expression* expr, FeedbackVectorSpec* spec,
LanguageMode language_mode,
FeedbackSlot* out_slot) {
Property* property = expr->AsProperty();
LhsKind assign_type = Property::GetAssignType(property);
// TODO(ishell): consider using ICSlotCache for variables here.
if (assign_type == VARIABLE &&
expr->AsVariableProxy()->var()->IsUnallocated()) {
*out_slot = spec->AddStoreGlobalICSlot(language_mode);
} else if (assign_type == NAMED_PROPERTY) {
*out_slot = spec->AddStoreICSlot(language_mode);
} else if (assign_type == KEYED_PROPERTY) {
*out_slot = spec->AddKeyedStoreICSlot(language_mode);
}
}
void ForInStatement::AssignFeedbackSlots(FeedbackVectorSpec* spec,
LanguageMode language_mode,
FunctionKind kind,
FeedbackSlotCache* cache) {
AssignVectorSlots(each(), spec, language_mode, &each_slot_);
for_in_feedback_slot_ = spec->AddForInSlot();
}
Assignment::Assignment(NodeType node_type, Token::Value op, Expression* target,
Expression* value, int pos)
: Expression(pos, node_type), target_(target), value_(value) {
bit_field_ |= TokenField::encode(op);
}
void Assignment::AssignFeedbackSlots(FeedbackVectorSpec* spec,
LanguageMode language_mode,
FunctionKind kind,
FeedbackSlotCache* cache) {
AssignVectorSlots(target(), spec, language_mode, &slot_);
}
void CountOperation::AssignFeedbackSlots(FeedbackVectorSpec* spec,
LanguageMode language_mode,
FunctionKind kind,
FeedbackSlotCache* cache) {
AssignVectorSlots(expression(), spec, language_mode, &slot_);
// Assign a slot to collect feedback about binary operations. Used only in
// ignition. Fullcodegen uses AstId to record type feedback.
binary_operation_slot_ = spec->AddInterpreterBinaryOpICSlot();
}
bool FunctionLiteral::ShouldEagerCompile() const {
return scope()->ShouldEagerCompile();
}
@ -332,16 +268,6 @@ ObjectLiteralProperty::ObjectLiteralProperty(AstValueFactory* ast_value_factory,
}
}
FeedbackSlot LiteralProperty::GetStoreDataPropertySlot() const {
int offset = FunctionLiteral::NeedsHomeObject(value_) ? 1 : 0;
return GetSlot(offset);
}
void LiteralProperty::SetStoreDataPropertySlot(FeedbackSlot slot) {
int offset = FunctionLiteral::NeedsHomeObject(value_) ? 1 : 0;
return SetSlot(slot, offset);
}
bool LiteralProperty::NeedsSetFunctionName() const {
return is_computed_name_ && (value_->IsAnonymousFunctionDefinition() ||
value_->IsConciseMethodDefinition() ||
@ -355,27 +281,6 @@ ClassLiteralProperty::ClassLiteralProperty(Expression* key, Expression* value,
kind_(kind),
is_static_(is_static) {}
void ClassLiteral::AssignFeedbackSlots(FeedbackVectorSpec* spec,
LanguageMode language_mode,
FunctionKind kind,
FeedbackSlotCache* cache) {
// This logic that computes the number of slots needed for vector store
// ICs must mirror BytecodeGenerator::VisitClassLiteral.
if (FunctionLiteral::NeedsHomeObject(constructor())) {
home_object_slot_ = spec->AddStoreICSlot(language_mode);
}
for (int i = 0; i < properties()->length(); i++) {
ClassLiteral::Property* property = properties()->at(i);
Expression* value = property->value();
if (FunctionLiteral::NeedsHomeObject(value)) {
property->SetSlot(spec->AddStoreICSlot(language_mode));
}
property->SetStoreDataPropertySlot(
spec->AddStoreDataPropertyInLiteralICSlot());
}
}
bool ObjectLiteral::Property::IsCompileTimeValue() const {
return kind_ == CONSTANT ||
(kind_ == MATERIALIZED_LITERAL &&
@ -389,77 +294,6 @@ void ObjectLiteral::Property::set_emit_store(bool emit_store) {
bool ObjectLiteral::Property::emit_store() const { return emit_store_; }
void ObjectLiteral::AssignFeedbackSlots(FeedbackVectorSpec* spec,
LanguageMode language_mode,
FunctionKind kind,
FeedbackSlotCache* cache) {
// The empty object literal doesn't need any feedback vector slot.
if (this->IsEmptyObjectLiteral()) return;
MaterializedLiteral::AssignFeedbackSlots(spec, language_mode, kind, cache);
// This logic that computes the number of slots needed for vector store
// ics must mirror FullCodeGenerator::VisitObjectLiteral.
int property_index = 0;
for (; property_index < properties()->length(); property_index++) {
ObjectLiteral::Property* property = properties()->at(property_index);
if (property->is_computed_name()) break;
if (property->IsCompileTimeValue()) continue;
Literal* key = property->key()->AsLiteral();
Expression* value = property->value();
switch (property->kind()) {
case ObjectLiteral::Property::SPREAD:
case ObjectLiteral::Property::CONSTANT:
UNREACHABLE();
case ObjectLiteral::Property::MATERIALIZED_LITERAL:
// Fall through.
case ObjectLiteral::Property::COMPUTED:
// It is safe to use [[Put]] here because the boilerplate already
// contains computed properties with an uninitialized value.
if (key->IsStringLiteral()) {
if (property->emit_store()) {
property->SetSlot(spec->AddStoreOwnICSlot());
if (FunctionLiteral::NeedsHomeObject(value)) {
property->SetSlot(spec->AddStoreICSlot(language_mode), 1);
}
}
break;
}
if (property->emit_store() && FunctionLiteral::NeedsHomeObject(value)) {
property->SetSlot(spec->AddStoreICSlot(language_mode));
}
break;
case ObjectLiteral::Property::PROTOTYPE:
break;
case ObjectLiteral::Property::GETTER:
if (property->emit_store() && FunctionLiteral::NeedsHomeObject(value)) {
property->SetSlot(spec->AddStoreICSlot(language_mode));
}
break;
case ObjectLiteral::Property::SETTER:
if (property->emit_store() && FunctionLiteral::NeedsHomeObject(value)) {
property->SetSlot(spec->AddStoreICSlot(language_mode));
}
break;
}
}
for (; property_index < properties()->length(); property_index++) {
ObjectLiteral::Property* property = properties()->at(property_index);
Expression* value = property->value();
if (!property->IsPrototype()) {
if (FunctionLiteral::NeedsHomeObject(value)) {
property->SetSlot(spec->AddStoreICSlot(language_mode));
}
}
property->SetStoreDataPropertySlot(
spec->AddStoreDataPropertyInLiteralICSlot());
}
}
void ObjectLiteral::CalculateEmitStore(Zone* zone) {
const auto GETTER = ObjectLiteral::Property::GETTER;
const auto SETTER = ObjectLiteral::Property::SETTER;
@ -757,26 +591,6 @@ void ArrayLiteral::RewindSpreads() {
first_spread_index_ = -1;
}
void ArrayLiteral::AssignFeedbackSlots(FeedbackVectorSpec* spec,
LanguageMode language_mode,
FunctionKind kind,
FeedbackSlotCache* cache) {
MaterializedLiteral::AssignFeedbackSlots(spec, language_mode, kind, cache);
// This logic that computes the number of slots needed for vector store
// ics must mirror FullCodeGenerator::VisitArrayLiteral.
for (int array_index = 0; array_index < values()->length(); array_index++) {
Expression* subexpr = values()->at(array_index);
DCHECK(!subexpr->IsSpread());
if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue;
// We'll reuse the same literal slot for all of the non-constant
// subexpressions that use a keyed store IC.
literal_slot_ = spec->AddKeyedStoreICSlot(language_mode);
return;
}
}
bool MaterializedLiteral::IsSimple() const {
if (IsArrayLiteral()) return AsArrayLiteral()->is_simple();
if (IsObjectLiteral()) return AsObjectLiteral()->is_simple();
@ -847,42 +661,6 @@ Handle<TemplateObjectDescription> GetTemplateObject::GetOrBuildDescription(
this->hash(), raw_strings, cooked_strings);
}
void UnaryOperation::AssignFeedbackSlots(FeedbackVectorSpec* spec,
LanguageMode language_mode,
FunctionKind kind,
FeedbackSlotCache* cache) {
switch (op()) {
// Only unary plus, minus, and bitwise-not currently collect feedback.
case Token::ADD:
case Token::SUB:
case Token::BIT_NOT:
// Note that the slot kind remains "BinaryOp", as the operation
// is transformed into a binary operation in the BytecodeGenerator.
feedback_slot_ = spec->AddInterpreterBinaryOpICSlot();
return;
default:
return;
}
}
void BinaryOperation::AssignFeedbackSlots(FeedbackVectorSpec* spec,
LanguageMode language_mode,
FunctionKind kind,
FeedbackSlotCache* cache) {
// Feedback vector slot is only used by interpreter for binary operations.
// Full-codegen uses AstId to record type feedback.
switch (op()) {
// Comma, logical_or and logical_and do not collect type feedback.
case Token::COMMA:
case Token::AND:
case Token::OR:
return;
default:
feedback_slot_ = spec->AddInterpreterBinaryOpICSlot();
return;
}
}
static bool IsCommutativeOperationWithSmiLiteral(Token::Value op) {
// Add is not commutative due to potential for string addition.
return op == Token::MUL || op == Token::BIT_AND || op == Token::BIT_OR ||
@ -912,22 +690,6 @@ static bool IsTypeof(Expression* expr) {
return maybe_unary != nullptr && maybe_unary->op() == Token::TYPEOF;
}
void CompareOperation::AssignFeedbackSlots(FeedbackVectorSpec* spec,
LanguageMode language_mode,
FunctionKind kind,
FeedbackSlotCache* cache_) {
// Feedback vector slot is only used by interpreter for binary operations.
// Full-codegen uses AstId to record type feedback.
switch (op()) {
// instanceof and in do not collect type feedback.
case Token::INSTANCEOF:
case Token::IN:
return;
default:
feedback_slot_ = spec->AddInterpreterCompareICSlot();
}
}
// Check for the pattern: typeof <expression> equals <string literal>.
static bool MatchLiteralCompareTypeof(Expression* left, Token::Value op,
Expression* right, Expression** expr,
@ -976,7 +738,6 @@ bool CompareOperation::IsLiteralCompareUndefined(Expression** expr) {
MatchLiteralCompareUndefined(right_, op(), left_, expr);
}
// Check for the pattern: null equals <expression>
static bool MatchLiteralCompareNull(Expression* left,
Token::Value op,
@ -989,22 +750,11 @@ static bool MatchLiteralCompareNull(Expression* left,
return false;
}
bool CompareOperation::IsLiteralCompareNull(Expression** expr) {
return MatchLiteralCompareNull(left_, op(), right_, expr) ||
MatchLiteralCompareNull(right_, op(), left_, expr);
}
// ----------------------------------------------------------------------------
// Recording of type feedback
void Call::AssignFeedbackSlots(FeedbackVectorSpec* spec,
LanguageMode language_mode, FunctionKind kind,
FeedbackSlotCache* cache) {
ic_slot_ = spec->AddCallICSlot();
}
Call::CallType Call::GetCallType() const {
VariableProxy* proxy = expression()->AsVariableProxy();
if (proxy != nullptr) {
@ -1035,13 +785,6 @@ Call::CallType Call::GetCallType() const {
CaseClause::CaseClause(Expression* label, ZoneList<Statement*>* statements)
: label_(label), statements_(statements) {}
void CaseClause::AssignFeedbackSlots(FeedbackVectorSpec* spec,
LanguageMode language_mode,
FunctionKind kind,
FeedbackSlotCache* cache) {
feedback_slot_ = spec->AddInterpreterCompareICSlot();
}
uint32_t Literal::Hash() {
return raw_value()->IsString()
? raw_value()->AsString()->Hash()

View File

@ -107,6 +107,7 @@ namespace internal {
EXPRESSION_NODE_LIST(V)
// Forward declarations
class AstNode;
class AstNodeFactory;
class Declaration;
class BreakableStatement;
@ -121,44 +122,6 @@ class Statement;
AST_NODE_LIST(DEF_FORWARD_DECLARATION)
#undef DEF_FORWARD_DECLARATION
class FeedbackSlotCache {
public:
typedef std::pair<TypeofMode, Variable*> Key;
explicit FeedbackSlotCache(Zone* zone) : map_(zone) {}
void Put(TypeofMode typeof_mode, Variable* variable, FeedbackSlot slot) {
Key key = std::make_pair(typeof_mode, variable);
auto entry = std::make_pair(key, slot);
map_.insert(entry);
}
FeedbackSlot Get(TypeofMode typeof_mode, Variable* variable) const {
Key key = std::make_pair(typeof_mode, variable);
auto iter = map_.find(key);
if (iter != map_.end()) {
return iter->second;
}
return FeedbackSlot();
}
private:
ZoneMap<Key, FeedbackSlot> map_;
};
class AstProperties final BASE_EMBEDDED {
public:
explicit AstProperties(Zone* zone) : spec_(zone) {}
const FeedbackVectorSpec* get_spec() const { return &spec_; }
FeedbackVectorSpec* get_spec() { return &spec_; }
private:
FeedbackVectorSpec spec_;
};
class AstNode: public ZoneObject {
public:
#define DECLARE_TYPE_ENUM(type) k##type,
@ -608,15 +571,6 @@ class ForInStatement final : public ForEachStatement {
void set_each(Expression* e) { each_ = e; }
void set_subject(Expression* e) { subject_ = e; }
// Type feedback information.
void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode,
FunctionKind kind, FeedbackSlotCache* cache);
FeedbackSlot EachFeedbackSlot() const { return each_slot_; }
FeedbackSlot ForInFeedbackSlot() {
DCHECK(!for_in_feedback_slot_.IsInvalid());
return for_in_feedback_slot_;
}
enum ForInType { FAST_FOR_IN, SLOW_FOR_IN };
ForInType for_in_type() const { return ForInTypeField::decode(bit_field_); }
void set_for_in_type(ForInType type) {
@ -635,8 +589,6 @@ class ForInStatement final : public ForEachStatement {
Expression* each_;
Expression* subject_;
FeedbackSlot each_slot_;
FeedbackSlot for_in_feedback_slot_;
class ForInTypeField
: public BitField<ForInType, ForEachStatement::kNextBitFieldIndex, 1> {};
@ -819,17 +771,11 @@ class CaseClause final : public ZoneObject {
void set_label(Expression* e) { label_ = e; }
ZoneList<Statement*>* statements() const { return statements_; }
void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode,
FunctionKind kind, FeedbackSlotCache* cache);
FeedbackSlot CompareOperationFeedbackSlot() { return feedback_slot_; }
private:
friend class AstNodeFactory;
CaseClause(Expression* label, ZoneList<Statement*>* statements);
FeedbackSlot feedback_slot_;
Expression* label_;
ZoneList<Statement*>* statements_;
};
@ -1073,20 +1019,10 @@ class Literal final : public Expression {
// Base class for literals that need space in the type feedback vector.
class MaterializedLiteral : public Expression {
public:
void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode,
FunctionKind kind, FeedbackSlotCache* cache) {
literal_slot_ = spec->AddLiteralSlot();
}
FeedbackSlot literal_slot() const { return literal_slot_; }
// A Materializedliteral is simple if the values consist of only
// constants and simple object and array literals.
bool IsSimple() const;
private:
FeedbackSlot literal_slot_;
protected:
MaterializedLiteral(int pos, NodeType type) : Expression(pos, type) {}
@ -1203,21 +1139,6 @@ class LiteralProperty : public ZoneObject {
void set_value(Expression* e) { value_ = e; }
bool is_computed_name() const { return is_computed_name_; }
FeedbackSlot GetSlot(int offset = 0) const {
DCHECK_LT(offset, static_cast<int>(arraysize(slots_)));
return slots_[offset];
}
FeedbackSlot GetStoreDataPropertySlot() const;
void SetSlot(FeedbackSlot slot, int offset = 0) {
DCHECK_LT(offset, static_cast<int>(arraysize(slots_)));
slots_[offset] = slot;
}
void SetStoreDataPropertySlot(FeedbackSlot slot);
bool NeedsSetFunctionName() const;
protected:
@ -1226,7 +1147,6 @@ class LiteralProperty : public ZoneObject {
Expression* key_;
Expression* value_;
FeedbackSlot slots_[2];
bool is_computed_name_;
};
@ -1353,11 +1273,6 @@ class ObjectLiteral final : public AggregateLiteral {
ObjectLiteralProperty* setter;
};
// Object literals need one feedback slot for each non-trivial value, as well
// as some slots for home objects.
void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode,
FunctionKind kind, FeedbackSlotCache* cache);
private:
friend class AstNodeFactory;
@ -1469,10 +1384,6 @@ class ArrayLiteral final : public AggregateLiteral {
// Rewind an array literal omitting everything from the first spread on.
void RewindSpreads();
void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode,
FunctionKind kind, FeedbackSlotCache* cache);
FeedbackSlot LiteralFeedbackSlot() const { return literal_slot_; }
private:
friend class AstNodeFactory;
@ -1482,7 +1393,6 @@ class ArrayLiteral final : public AggregateLiteral {
values_(values) {}
int first_spread_index_;
FeedbackSlot literal_slot_;
Handle<ConstantElementsPair> constant_elements_;
ZoneList<Expression*>* values_;
};
@ -1544,15 +1454,6 @@ class VariableProxy final : public Expression {
// Bind this proxy to the variable var.
void BindTo(Variable* var);
bool UsesVariableFeedbackSlot() const {
return var()->IsUnallocated() || var()->IsLookupSlot();
}
void AssignFeedbackSlots(FeedbackVectorSpec* spec, TypeofMode typeof_mode,
FeedbackSlotCache* cache);
FeedbackSlot VariableFeedbackSlot() { return variable_feedback_slot_; }
void set_next_unresolved(VariableProxy* next) { next_unresolved_ = next; }
VariableProxy* next_unresolved() { return next_unresolved_; }
@ -1582,7 +1483,6 @@ class VariableProxy final : public Expression {
class HoleCheckModeField
: public BitField<HoleCheckMode, IsNewTargetField::kNext, 1> {};
FeedbackSlot variable_feedback_slot_;
union {
const AstRawString* raw_name_; // if !is_resolved_
Variable* var_; // if is_resolved_
@ -1614,17 +1514,6 @@ class Property final : public Expression {
bool IsSuperAccess() { return obj()->IsSuperPropertyReference(); }
void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode,
FunctionKind kind, FeedbackSlotCache* cache) {
if (key()->IsPropertyName()) {
property_feedback_slot_ = spec->AddLoadICSlot();
} else {
property_feedback_slot_ = spec->AddKeyedLoadICSlot();
}
}
FeedbackSlot PropertyFeedbackSlot() const { return property_feedback_slot_; }
// Returns the properties assign type.
static LhsKind GetAssignType(Property* property) {
if (property == nullptr) return VARIABLE;
@ -1641,7 +1530,6 @@ class Property final : public Expression {
: Expression(pos, kProperty), obj_(obj), key_(key) {
}
FeedbackSlot property_feedback_slot_;
Expression* obj_;
Expression* key_;
};
@ -1654,12 +1542,6 @@ class Call final : public Expression {
void set_expression(Expression* e) { expression_ = e; }
// Type feedback information.
void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode,
FunctionKind kind, FeedbackSlotCache* cache);
FeedbackSlot CallFeedbackICSlot() const { return ic_slot_; }
bool is_possibly_eval() const {
return IsPossiblyEvalField::decode(bit_field_);
}
@ -1718,7 +1600,6 @@ class Call final : public Expression {
class IsTaggedTemplateField
: public BitField<bool, IsPossiblyEvalField::kNext, 1> {};
FeedbackSlot ic_slot_;
Expression* expression_;
ZoneList<Expression*>* arguments_;
};
@ -1731,19 +1612,6 @@ class CallNew final : public Expression {
void set_expression(Expression* e) { expression_ = e; }
// Type feedback information.
void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode,
FunctionKind kind, FeedbackSlotCache* cache) {
// CallNew stores feedback in the exact same way as Call. We can
// piggyback on the type feedback infrastructure for calls.
callnew_feedback_slot_ = spec->AddCallICSlot();
}
FeedbackSlot CallNewFeedbackSlot() {
DCHECK(!callnew_feedback_slot_.IsInvalid());
return callnew_feedback_slot_;
}
bool only_last_arg_is_spread() {
return !arguments_->is_empty() && arguments_->last()->IsSpread();
}
@ -1757,7 +1625,6 @@ class CallNew final : public Expression {
arguments_(arguments) {
}
FeedbackSlot callnew_feedback_slot_;
Expression* expression_;
ZoneList<Expression*>* arguments_;
};
@ -1813,11 +1680,6 @@ class UnaryOperation final : public Expression {
Expression* expression() const { return expression_; }
void set_expression(Expression* e) { expression_ = e; }
void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode,
FunctionKind kind, FeedbackSlotCache* cache);
FeedbackSlot UnaryOperationFeedbackSlot() const { return feedback_slot_; }
private:
friend class AstNodeFactory;
@ -1827,7 +1689,6 @@ class UnaryOperation final : public Expression {
DCHECK(Token::IsUnaryOp(op));
}
FeedbackSlot feedback_slot_;
Expression* expression_;
class OperatorField
@ -1843,11 +1704,6 @@ class BinaryOperation final : public Expression {
Expression* right() const { return right_; }
void set_right(Expression* e) { right_ = e; }
void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode,
FunctionKind kind, FeedbackSlotCache* cache);
FeedbackSlot BinaryOperationFeedbackSlot() const { return feedback_slot_; }
// Returns true if one side is a Smi literal, returning the other side's
// sub-expression in |subexpr| and the literal Smi in |literal|.
bool IsSmiLiteralOperation(Expression** subexpr, Smi** literal);
@ -1861,7 +1717,6 @@ class BinaryOperation final : public Expression {
DCHECK(Token::IsBinaryOp(op));
}
FeedbackSlot feedback_slot_;
Expression* left_;
Expression* right_;
@ -1880,15 +1735,6 @@ class CountOperation final : public Expression {
Expression* expression() const { return expression_; }
void set_expression(Expression* e) { expression_ = e; }
// Feedback slot for binary operation is only used by ignition.
FeedbackSlot CountBinaryOpFeedbackSlot() const {
return binary_operation_slot_;
}
void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode,
FunctionKind kind, FeedbackSlotCache* cache);
FeedbackSlot CountSlot() const { return slot_; }
private:
friend class AstNodeFactory;
@ -1901,8 +1747,6 @@ class CountOperation final : public Expression {
: public BitField<bool, Expression::kNextBitFieldIndex, 1> {};
class TokenField : public BitField<Token::Value, IsPrefixField::kNext, 7> {};
FeedbackSlot slot_;
FeedbackSlot binary_operation_slot_;
Expression* expression_;
};
@ -1916,11 +1760,6 @@ class CompareOperation final : public Expression {
void set_left(Expression* e) { left_ = e; }
void set_right(Expression* e) { right_ = e; }
void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode,
FunctionKind kind, FeedbackSlotCache* cache);
FeedbackSlot CompareOperationFeedbackSlot() const { return feedback_slot_; }
// Match special cases.
bool IsLiteralCompareTypeof(Expression** expr, Literal** literal);
bool IsLiteralCompareUndefined(Expression** expr);
@ -1936,7 +1775,6 @@ class CompareOperation final : public Expression {
DCHECK(Token::IsCompareOp(op));
}
FeedbackSlot feedback_slot_;
Expression* left_;
Expression* right_;
@ -2011,10 +1849,6 @@ class Assignment : public Expression {
LookupHoistingModeField::update(bit_field_, static_cast<bool>(mode));
}
void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode,
FunctionKind kind, FeedbackSlotCache* cache);
FeedbackSlot AssignmentSlot() const { return slot_; }
protected:
Assignment(NodeType type, Token::Value op, Expression* target,
Expression* value, int pos);
@ -2027,7 +1861,6 @@ class Assignment : public Expression {
class LookupHoistingModeField : public BitField<bool, TokenField::kNext, 1> {
};
FeedbackSlot slot_;
Expression* target_;
Expression* value_;
};
@ -2183,63 +2016,6 @@ class YieldStar final : public Suspend {
return 1;
}
void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode,
FunctionKind kind, FeedbackSlotCache* cache) {
load_iterable_iterator_slot_ = spec->AddLoadICSlot();
load_iterator_return_slot_ = spec->AddLoadICSlot();
load_iterator_next_slot_ = spec->AddLoadICSlot();
load_iterator_throw_slot_ = spec->AddLoadICSlot();
load_output_done_slot_ = spec->AddLoadICSlot();
load_output_value_slot_ = spec->AddLoadICSlot();
call_iterable_iterator_slot_ = spec->AddCallICSlot();
call_iterator_return_slot1_ = spec->AddCallICSlot();
call_iterator_return_slot2_ = spec->AddCallICSlot();
call_iterator_next_slot_ = spec->AddCallICSlot();
call_iterator_throw_slot_ = spec->AddCallICSlot();
if (IsAsyncGeneratorFunction(kind)) {
load_iterable_async_iterator_slot_ = spec->AddLoadICSlot();
call_iterable_async_iterator_slot_ = spec->AddCallICSlot();
}
}
FeedbackSlot load_iterable_iterator_slot() const {
return load_iterable_iterator_slot_;
}
FeedbackSlot load_iterator_return_slot() const {
return load_iterator_return_slot_;
}
FeedbackSlot load_iterator_next_slot() const {
return load_iterator_next_slot_;
}
FeedbackSlot load_iterator_throw_slot() const {
return load_iterator_throw_slot_;
}
FeedbackSlot load_output_done_slot() const { return load_output_done_slot_; }
FeedbackSlot load_output_value_slot() const {
return load_output_value_slot_;
}
FeedbackSlot call_iterable_iterator_slot() const {
return call_iterable_iterator_slot_;
}
FeedbackSlot call_iterator_return_slot1() const {
return call_iterator_return_slot1_;
}
FeedbackSlot call_iterator_return_slot2() const {
return call_iterator_return_slot2_;
}
FeedbackSlot call_iterator_next_slot() const {
return call_iterator_next_slot_;
}
FeedbackSlot call_iterator_throw_slot() const {
return call_iterator_throw_slot_;
}
FeedbackSlot load_iterable_async_iterator_slot() const {
return load_iterable_async_iterator_slot_;
}
FeedbackSlot call_iterable_async_iterator_slot() const {
return call_iterable_async_iterator_slot_;
}
private:
friend class AstNodeFactory;
@ -2249,21 +2025,6 @@ class YieldStar final : public Suspend {
await_iterator_close_suspend_id_(-1),
await_delegated_iterator_output_suspend_id_(-1) {}
FeedbackSlot load_iterable_iterator_slot_;
FeedbackSlot load_iterator_return_slot_;
FeedbackSlot load_iterator_next_slot_;
FeedbackSlot load_iterator_throw_slot_;
FeedbackSlot load_output_done_slot_;
FeedbackSlot load_output_value_slot_;
FeedbackSlot call_iterable_iterator_slot_;
FeedbackSlot call_iterator_return_slot1_;
FeedbackSlot call_iterator_return_slot2_;
FeedbackSlot call_iterator_next_slot_;
FeedbackSlot call_iterator_throw_slot_;
FeedbackSlot load_iterable_async_iterator_slot_;
FeedbackSlot call_iterable_async_iterator_slot_;
int await_iterator_close_suspend_id_;
int await_delegated_iterator_output_suspend_id_;
};
@ -2330,13 +2091,6 @@ class FunctionLiteral final : public Expression {
}
LanguageMode language_mode() const;
void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode,
FunctionKind kind, FeedbackSlotCache* cache) {
literal_feedback_slot_ = spec->AddCreateClosureSlot();
}
FeedbackSlot LiteralFeedbackSlot() const { return literal_feedback_slot_; }
static bool NeedsHomeObject(Expression* expr);
int expected_property_count() {
@ -2412,13 +2166,6 @@ class FunctionLiteral final : public Expression {
}
FunctionKind kind() const;
void set_ast_properties(AstProperties* ast_properties) {
ast_properties_ = *ast_properties;
}
const FeedbackVectorSpec* feedback_vector_spec() const {
return ast_properties_.get_spec();
}
bool dont_optimize() { return dont_optimize_reason() != kNoReason; }
BailoutReason dont_optimize_reason() {
return DontOptimizeReasonField::decode(bit_field_);
@ -2469,7 +2216,6 @@ class FunctionLiteral final : public Expression {
scope_(scope),
body_(body),
raw_inferred_name_(ast_value_factory->empty_cons_string()),
ast_properties_(zone),
function_literal_id_(function_literal_id),
produced_preparsed_scope_data_(produced_preparsed_scope_data) {
bit_field_ |= FunctionTypeBits::encode(function_type) |
@ -2500,9 +2246,7 @@ class FunctionLiteral final : public Expression {
ZoneList<Statement*>* body_;
const AstConsString* raw_inferred_name_;
Handle<String> inferred_name_;
AstProperties ast_properties_;
int function_literal_id_;
FeedbackSlot literal_feedback_slot_;
ProducedPreParsedScopeData* produced_preparsed_scope_data_;
};
@ -2553,13 +2297,6 @@ class ClassLiteral final : public Expression {
return is_anonymous_expression();
}
// Object literals need one feedback slot for each non-trivial value, as well
// as some slots for home objects.
void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode,
FunctionKind kind, FeedbackSlotCache* cache);
FeedbackSlot HomeObjectSlot() const { return home_object_slot_; }
private:
friend class AstNodeFactory;
@ -2581,7 +2318,6 @@ class ClassLiteral final : public Expression {
}
int end_position_;
FeedbackSlot home_object_slot_;
Scope* scope_;
Variable* class_variable_;
Expression* extends_;
@ -2601,14 +2337,6 @@ class NativeFunctionLiteral final : public Expression {
public:
Handle<String> name() const { return name_->string(); }
v8::Extension* extension() const { return extension_; }
FeedbackSlot LiteralFeedbackSlot() const { return literal_feedback_slot_; }
void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode,
FunctionKind kind, FeedbackSlotCache* cache) {
// TODO(mvstanton): The FeedbackSlotCache can be adapted
// to always return the same slot for this case.
literal_feedback_slot_ = spec->AddCreateClosureSlot();
}
private:
friend class AstNodeFactory;
@ -2619,7 +2347,6 @@ class NativeFunctionLiteral final : public Expression {
name_(name),
extension_(extension) {}
FeedbackSlot literal_feedback_slot_;
const AstRawString* name_;
v8::Extension* extension_;
};
@ -2721,32 +2448,6 @@ class GetIterator final : public Expression {
Expression* iterable() const { return iterable_; }
void set_iterable(Expression* iterable) { iterable_ = iterable; }
void AssignFeedbackSlots(FeedbackVectorSpec* spec, LanguageMode language_mode,
FunctionKind kind, FeedbackSlotCache* cache) {
iterator_property_feedback_slot_ = spec->AddLoadICSlot();
iterator_call_feedback_slot_ = spec->AddCallICSlot();
if (hint() == IteratorType::kAsync) {
async_iterator_property_feedback_slot_ = spec->AddLoadICSlot();
async_iterator_call_feedback_slot_ = spec->AddCallICSlot();
}
}
FeedbackSlot IteratorPropertyFeedbackSlot() const {
return iterator_property_feedback_slot_;
}
FeedbackSlot IteratorCallFeedbackSlot() const {
return iterator_call_feedback_slot_;
}
FeedbackSlot AsyncIteratorPropertyFeedbackSlot() const {
return async_iterator_property_feedback_slot_;
}
FeedbackSlot AsyncIteratorCallFeedbackSlot() const {
return async_iterator_call_feedback_slot_;
}
Expression* iterable_for_call_printer() const {
return destructured_iterable_ != nullptr ? destructured_iterable_
: iterable_;
@ -2775,11 +2476,6 @@ class GetIterator final : public Expression {
// the raw value stored in the variable proxy. This is only used for
// pretty printing error messages.
Expression* destructured_iterable_;
FeedbackSlot iterator_property_feedback_slot_;
FeedbackSlot iterator_call_feedback_slot_;
FeedbackSlot async_iterator_property_feedback_slot_;
FeedbackSlot async_iterator_call_feedback_slot_;
};
// Represents the spec operation `GetTemplateObject(templateLiteral)`

View File

@ -488,16 +488,6 @@ void CallPrinter::PrintLiteral(const AstRawString* value, bool quote) {
#ifdef DEBUG
// A helper for ast nodes that use FeedbackSlots.
static int FormatSlotNode(Vector<char>* buf, Expression* node,
const char* node_name, FeedbackSlot slot) {
int pos = SNPrintF(*buf, "%s", node_name);
if (!slot.IsInvalid()) {
pos += SNPrintF(*buf + pos, " Slot(%d)", slot.ToInt());
}
return pos;
}
const char* AstPrinter::Print(AstNode* node) {
Init();
Visit(node);
@ -1018,11 +1008,9 @@ void AstPrinter::VisitLiteral(Literal* node) {
void AstPrinter::VisitRegExpLiteral(RegExpLiteral* node) {
IndentedScope indent(this, "REGEXP LITERAL", node->position());
EmbeddedVector<char, 128> buf;
SNPrintF(buf, "literal_slot = %d\n", node->literal_slot().ToInt());
PrintIndented(buf.start());
PrintLiteralIndented("PATTERN", node->pattern(), false);
int i = 0;
EmbeddedVector<char, 128> buf;
if (node->flags() & RegExp::kGlobal) buf[i++] = 'g';
if (node->flags() & RegExp::kIgnoreCase) buf[i++] = 'i';
if (node->flags() & RegExp::kMultiline) buf[i++] = 'm';
@ -1037,9 +1025,6 @@ void AstPrinter::VisitRegExpLiteral(RegExpLiteral* node) {
void AstPrinter::VisitObjectLiteral(ObjectLiteral* node) {
IndentedScope indent(this, "OBJ LITERAL", node->position());
EmbeddedVector<char, 128> buf;
SNPrintF(buf, "literal_slot = %d\n", node->literal_slot().ToInt());
PrintIndented(buf.start());
PrintObjectProperties(node->properties());
}
@ -1082,10 +1067,6 @@ void AstPrinter::PrintObjectProperties(
void AstPrinter::VisitArrayLiteral(ArrayLiteral* node) {
IndentedScope indent(this, "ARRAY LITERAL", node->position());
EmbeddedVector<char, 128> buf;
SNPrintF(buf, "literal_slot = %d\n", node->literal_slot().ToInt());
PrintIndented(buf.start());
if (node->values()->length() > 0) {
IndentedScope indent(this, "VALUES", node->position());
for (int i = 0; i < node->values()->length(); i++) {
@ -1097,8 +1078,7 @@ void AstPrinter::VisitArrayLiteral(ArrayLiteral* node) {
void AstPrinter::VisitVariableProxy(VariableProxy* node) {
EmbeddedVector<char, 128> buf;
int pos =
FormatSlotNode(&buf, node, "VAR PROXY", node->VariableFeedbackSlot());
int pos = SNPrintF(buf, "VAR PROXY");
if (!node->is_resolved()) {
SNPrintF(buf + pos, " unresolved");
@ -1169,7 +1149,7 @@ void AstPrinter::VisitThrow(Throw* node) {
void AstPrinter::VisitProperty(Property* node) {
EmbeddedVector<char, 128> buf;
FormatSlotNode(&buf, node, "PROPERTY", node->PropertyFeedbackSlot());
SNPrintF(buf, "PROPERTY");
IndentedScope indent(this, buf.start(), node->position());
Visit(node->obj());
@ -1184,7 +1164,7 @@ void AstPrinter::VisitProperty(Property* node) {
void AstPrinter::VisitCall(Call* node) {
EmbeddedVector<char, 128> buf;
FormatSlotNode(&buf, node, "CALL", node->CallFeedbackICSlot());
SNPrintF(buf, "CALL");
IndentedScope indent(this, buf.start());
Visit(node->expression());

View File

@ -35,6 +35,7 @@ CompilationInfo::CompilationInfo(Zone* zone, Isolate* isolate,
if (parse_info->is_eval()) MarkAsEval();
if (parse_info->is_native()) MarkAsNative();
if (parse_info->will_serialize()) MarkAsSerializing();
if (parse_info->collect_type_profile()) MarkAsCollectTypeProfile();
}
CompilationInfo::CompilationInfo(Zone* zone, Isolate* isolate,
@ -70,6 +71,7 @@ CompilationInfo::CompilationInfo(Vector<const char> debug_name,
code_kind_(code_kind),
mode_(mode),
osr_offset_(BailoutId::None()),
feedback_vector_spec_(zone),
zone_(zone),
deferred_handles_(nullptr),
dependencies_(isolate, zone),

View File

@ -8,6 +8,7 @@
#include <memory>
#include "src/compilation-dependencies.h"
#include "src/feedback-vector.h"
#include "src/frames.h"
#include "src/globals.h"
#include "src/handles.h"
@ -39,14 +40,15 @@ class V8_EXPORT_PRIVATE CompilationInfo final {
kIsEval = 1 << 0,
kIsNative = 1 << 1,
kSerializing = 1 << 2,
kAccessorInliningEnabled = 1 << 3,
kFunctionContextSpecializing = 1 << 4,
kInliningEnabled = 1 << 5,
kDisableFutureOptimization = 1 << 6,
kSplittingEnabled = 1 << 7,
kSourcePositionsEnabled = 1 << 8,
kBailoutOnUninitialized = 1 << 9,
kLoopPeelingEnabled = 1 << 10,
kCollectTypeProfile = 1 << 3,
kAccessorInliningEnabled = 1 << 4,
kFunctionContextSpecializing = 1 << 5,
kInliningEnabled = 1 << 6,
kDisableFutureOptimization = 1 << 7,
kSplittingEnabled = 1 << 8,
kSourcePositionsEnabled = 1 << 9,
kBailoutOnUninitialized = 1 << 10,
kLoopPeelingEnabled = 1 << 11,
};
// Construct a compilation info for unoptimized compilation.
@ -114,6 +116,9 @@ class V8_EXPORT_PRIVATE CompilationInfo final {
void MarkAsNative() { SetFlag(kIsNative); }
bool is_native() const { return GetFlag(kIsNative); }
void MarkAsCollectTypeProfile() { SetFlag(kCollectTypeProfile); }
bool collect_type_profile() const { return GetFlag(kCollectTypeProfile); }
// Flags used by optimized compilation.
void MarkAsFunctionContextSpecializing() {
@ -159,6 +164,8 @@ class V8_EXPORT_PRIVATE CompilationInfo final {
asm_wasm_data_ = asm_wasm_data;
}
FeedbackVectorSpec* feedback_vector_spec() { return &feedback_vector_spec_; }
bool has_context() const;
Context* context() const;
@ -304,6 +311,9 @@ class V8_EXPORT_PRIVATE CompilationInfo final {
// Holds the asm_wasm array generated by the asmjs compiler.
Handle<FixedArray> asm_wasm_data_;
// Holds the feedback vector spec generated during compilation
FeedbackVectorSpec feedback_vector_spec_;
// The zone from which the compilation pipeline working on this
// CompilationInfo allocates.
Zone* zone_;

View File

@ -245,15 +245,14 @@ void EnsureFeedbackMetadata(CompilationInfo* compilation_info) {
if (compilation_info->shared_info()->feedback_metadata()->length() == 0 ||
!compilation_info->shared_info()->is_compiled()) {
Handle<FeedbackMetadata> feedback_metadata = FeedbackMetadata::New(
compilation_info->isolate(),
compilation_info->literal()->feedback_vector_spec());
compilation_info->isolate(), compilation_info->feedback_vector_spec());
compilation_info->shared_info()->set_feedback_metadata(*feedback_metadata);
}
// It's very important that recompiles do not alter the structure of the type
// feedback vector. Verify that the structure fits the function literal.
CHECK(!compilation_info->shared_info()->feedback_metadata()->SpecDiffersFrom(
compilation_info->literal()->feedback_vector_spec()));
compilation_info->feedback_vector_spec()));
}
bool UseAsmWasm(FunctionLiteral* literal, bool asm_wasm_broken) {
@ -362,8 +361,7 @@ bool Renumber(ParseInfo* parse_info,
RuntimeCallTimerScope runtimeTimer(parse_info->runtime_call_stats(),
&RuntimeCallStats::CompileRenumber);
return AstNumbering::Renumber(parse_info->stack_limit(), parse_info->zone(),
parse_info->literal(), eager_literals,
parse_info->collect_type_profile());
parse_info->literal(), eager_literals);
}
std::unique_ptr<CompilationJob> PrepareAndExecuteUnoptimizedCompileJob(

View File

@ -285,7 +285,7 @@ class FeedbackVector : public HeapObject {
};
template <typename Derived>
class FeedbackVectorSpecBase {
class V8_EXPORT_PRIVATE FeedbackVectorSpecBase {
public:
FeedbackSlot AddCallICSlot() { return AddSlot(FeedbackSlotKind::kCall); }
@ -332,11 +332,11 @@ class FeedbackVectorSpecBase {
: FeedbackSlotKind::kStoreKeyedSloppy);
}
FeedbackSlot AddInterpreterBinaryOpICSlot() {
FeedbackSlot AddBinaryOpICSlot() {
return AddSlot(FeedbackSlotKind::kBinaryOp);
}
FeedbackSlot AddInterpreterCompareICSlot() {
FeedbackSlot AddCompareICSlot() {
return AddSlot(FeedbackSlotKind::kCompareOp);
}
@ -389,7 +389,8 @@ class StaticFeedbackVectorSpec
FeedbackSlotKind kinds_[kMaxLength];
};
class FeedbackVectorSpec : public FeedbackVectorSpecBase<FeedbackVectorSpec> {
class V8_EXPORT_PRIVATE FeedbackVectorSpec
: public FeedbackVectorSpecBase<FeedbackVectorSpec> {
public:
explicit FeedbackVectorSpec(Zone* zone) : slot_kinds_(zone) {
slot_kinds_.reserve(16);

View File

@ -39,10 +39,10 @@ class RegisterTransferWriter final
BytecodeArrayBuilder::BytecodeArrayBuilder(
Isolate* isolate, Zone* zone, int parameter_count, int locals_count,
FunctionLiteral* literal,
FeedbackVectorSpec* feedback_vector_spec,
SourcePositionTableBuilder::RecordingMode source_position_mode)
: zone_(zone),
literal_(literal),
feedback_vector_spec_(feedback_vector_spec),
bytecode_generated_(false),
constant_array_builder_(zone),
handler_table_builder_(zone),
@ -692,14 +692,10 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::LoadGlobal(const AstRawString* name,
int feedback_slot,
TypeofMode typeof_mode) {
size_t name_index = GetConstantPoolEntry(name);
// Ensure that typeof mode is in sync with the IC slot kind if the function
// literal is available (not a unit test case).
// TODO(ishell): check only in debug mode.
if (literal_) {
FeedbackSlot slot = FeedbackVector::ToSlot(feedback_slot);
CHECK_EQ(GetTypeofModeFromSlotKind(feedback_vector_spec()->GetKind(slot)),
typeof_mode);
}
// Ensure that typeof mode is in sync with the IC slot kind.
DCHECK_EQ(GetTypeofModeFromSlotKind(feedback_vector_spec()->GetKind(
FeedbackVector::ToSlot(feedback_slot))),
typeof_mode);
if (typeof_mode == INSIDE_TYPEOF) {
OutputLdaGlobalInsideTypeof(name_index, feedback_slot);
} else {
@ -841,16 +837,10 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::CollectTypeProfile(int position) {
BytecodeArrayBuilder& BytecodeArrayBuilder::StoreNamedProperty(
Register object, size_t name_index, int feedback_slot,
LanguageMode language_mode) {
#if DEBUG
// Ensure that language mode is in sync with the IC slot kind if the function
// literal is available (not a unit test case).
if (literal_) {
FeedbackSlot slot = FeedbackVector::ToSlot(feedback_slot);
DCHECK_EQ(
GetLanguageModeFromSlotKind(feedback_vector_spec()->GetKind(slot)),
language_mode);
}
#endif
// Ensure that language mode is in sync with the IC slot kind.
DCHECK_EQ(GetLanguageModeFromSlotKind(feedback_vector_spec()->GetKind(
FeedbackVector::ToSlot(feedback_slot))),
language_mode);
OutputStaNamedProperty(object, name_index, feedback_slot);
return *this;
}
@ -865,15 +855,10 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::StoreNamedProperty(
BytecodeArrayBuilder& BytecodeArrayBuilder::StoreNamedOwnProperty(
Register object, const AstRawString* name, int feedback_slot) {
size_t name_index = GetConstantPoolEntry(name);
#if DEBUG
// Ensure that the store operation is in sync with the IC slot kind if
// the function literal is available (not a unit test case).
if (literal_) {
FeedbackSlot slot = FeedbackVector::ToSlot(feedback_slot);
DCHECK_EQ(FeedbackSlotKind::kStoreOwnNamed,
feedback_vector_spec()->GetKind(slot));
}
#endif
// Ensure that the store operation is in sync with the IC slot kind.
DCHECK_EQ(
FeedbackSlotKind::kStoreOwnNamed,
feedback_vector_spec()->GetKind(FeedbackVector::ToSlot(feedback_slot)));
OutputStaNamedOwnProperty(object, name_index, feedback_slot);
return *this;
}
@ -881,16 +866,10 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::StoreNamedOwnProperty(
BytecodeArrayBuilder& BytecodeArrayBuilder::StoreKeyedProperty(
Register object, Register key, int feedback_slot,
LanguageMode language_mode) {
#if DEBUG
// Ensure that language mode is in sync with the IC slot kind if the function
// literal is available (not a unit test case).
if (literal_) {
FeedbackSlot slot = FeedbackVector::ToSlot(feedback_slot);
DCHECK_EQ(
GetLanguageModeFromSlotKind(feedback_vector_spec()->GetKind(slot)),
language_mode);
}
#endif
// Ensure that language mode is in sync with the IC slot kind.
DCHECK_EQ(GetLanguageModeFromSlotKind(feedback_vector_spec()->GetKind(
FeedbackVector::ToSlot(feedback_slot))),
language_mode);
OutputStaKeyedProperty(object, key, feedback_slot);
return *this;
}

View File

@ -36,7 +36,7 @@ class V8_EXPORT_PRIVATE BytecodeArrayBuilder final
public:
BytecodeArrayBuilder(
Isolate* isolate, Zone* zone, int parameter_count, int locals_count,
FunctionLiteral* literal = nullptr,
FeedbackVectorSpec* feedback_vector_spec = nullptr,
SourcePositionTableBuilder::RecordingMode source_position_mode =
SourcePositionTableBuilder::RECORD_SOURCE_POSITIONS);
@ -510,7 +510,7 @@ class V8_EXPORT_PRIVATE BytecodeArrayBuilder final
friend class BytecodeNodeBuilder;
const FeedbackVectorSpec* feedback_vector_spec() const {
return literal_->feedback_vector_spec();
return feedback_vector_spec_;
}
// Returns the current source position for the given |bytecode|.
@ -567,7 +567,7 @@ class V8_EXPORT_PRIVATE BytecodeArrayBuilder final
}
Zone* zone_;
FunctionLiteral* literal_;
FeedbackVectorSpec* feedback_vector_spec_;
bool bytecode_generated_;
ConstantArrayBuilder constant_array_builder_;
HandlerTableBuilder handler_table_builder_;

View File

@ -770,24 +770,63 @@ class BytecodeGenerator::CurrentScope final {
Scope* outer_scope_;
};
class BytecodeGenerator::FeedbackSlotCache : public ZoneObject {
public:
typedef std::pair<TypeofMode, void*> Key;
explicit FeedbackSlotCache(Zone* zone) : map_(zone) {}
void Put(TypeofMode typeof_mode, Variable* variable, FeedbackSlot slot) {
Key key = std::make_pair(typeof_mode, variable);
auto entry = std::make_pair(key, slot);
map_.insert(entry);
}
void Put(AstNode* node, FeedbackSlot slot) {
Key key = std::make_pair(NOT_INSIDE_TYPEOF, node);
auto entry = std::make_pair(key, slot);
map_.insert(entry);
}
FeedbackSlot Get(TypeofMode typeof_mode, Variable* variable) const {
Key key = std::make_pair(typeof_mode, variable);
auto iter = map_.find(key);
if (iter != map_.end()) {
return iter->second;
}
return FeedbackSlot();
}
FeedbackSlot Get(AstNode* node) const {
Key key = std::make_pair(NOT_INSIDE_TYPEOF, node);
auto iter = map_.find(key);
if (iter != map_.end()) {
return iter->second;
}
return FeedbackSlot();
}
private:
ZoneMap<Key, FeedbackSlot> map_;
};
BytecodeGenerator::BytecodeGenerator(CompilationInfo* info)
: zone_(info->zone()),
builder_(new (zone()) BytecodeArrayBuilder(
info->isolate(), info->zone(), info->num_parameters_including_this(),
info->scope()->num_stack_slots(), info->literal(),
info->scope()->num_stack_slots(), info->feedback_vector_spec(),
info->SourcePositionRecordingMode())),
info_(info),
ast_string_constants_(info->isolate()->ast_string_constants()),
closure_scope_(info->scope()),
current_scope_(info->scope()),
globals_builder_(new (zone()) GlobalDeclarationsBuilder(info->zone())),
feedback_slot_cache_(new (zone()) FeedbackSlotCache(zone())),
globals_builder_(new (zone()) GlobalDeclarationsBuilder(zone())),
block_coverage_builder_(nullptr),
global_declarations_(0, info->zone()),
function_literals_(0, info->zone()),
native_function_literals_(0, info->zone()),
object_literals_(0, info->zone()),
array_literals_(0, info->zone()),
template_objects_(0, info->zone()),
global_declarations_(0, zone()),
function_literals_(0, zone()),
native_function_literals_(0, zone()),
object_literals_(0, zone()),
array_literals_(0, zone()),
template_objects_(0, zone()),
execution_control_(nullptr),
execution_context_(nullptr),
execution_result_(nullptr),
@ -949,7 +988,8 @@ void BytecodeGenerator::GenerateBytecodeBody() {
if (FLAG_trace) builder()->CallRuntime(Runtime::kTraceEnter);
// Emit type profile call.
if (info()->literal()->feedback_vector_spec()->HasTypeProfileSlot()) {
if (info()->collect_type_profile()) {
feedback_spec()->AddTypeProfileSlot();
int num_parameters = closure_scope()->num_parameters();
for (int i = 0; i < num_parameters; i++) {
Register parameter(builder()->Parameter(i));
@ -1107,7 +1147,8 @@ void BytecodeGenerator::VisitVariableDeclaration(VariableDeclaration* decl) {
switch (variable->location()) {
case VariableLocation::UNALLOCATED: {
DCHECK(!variable->binding_needs_init());
FeedbackSlot slot = decl->proxy()->VariableFeedbackSlot();
FeedbackSlot slot =
GetCachedLoadGlobalICSlot(NOT_INSIDE_TYPEOF, variable);
globals_builder()->AddUndefinedDeclaration(variable->raw_name(), slot);
break;
}
@ -1145,8 +1186,7 @@ void BytecodeGenerator::VisitVariableDeclaration(VariableDeclaration* decl) {
case VariableLocation::MODULE:
if (variable->IsExport() && variable->binding_needs_init()) {
builder()->LoadTheHole();
BuildVariableAssignment(variable, Token::INIT, FeedbackSlot::Invalid(),
HoleCheckMode::kElided);
BuildVariableAssignment(variable, Token::INIT, HoleCheckMode::kElided);
}
// Nothing to do for imports.
break;
@ -1158,17 +1198,17 @@ void BytecodeGenerator::VisitFunctionDeclaration(FunctionDeclaration* decl) {
DCHECK(variable->mode() == LET || variable->mode() == VAR);
switch (variable->location()) {
case VariableLocation::UNALLOCATED: {
FeedbackSlot slot = decl->proxy()->VariableFeedbackSlot();
globals_builder()->AddFunctionDeclaration(
variable->raw_name(), slot, decl->fun()->LiteralFeedbackSlot(),
decl->fun());
FeedbackSlot slot =
GetCachedLoadGlobalICSlot(NOT_INSIDE_TYPEOF, variable);
FeedbackSlot literal_slot = GetCachedCreateClosureSlot(decl->fun());
globals_builder()->AddFunctionDeclaration(variable->raw_name(), slot,
literal_slot, decl->fun());
break;
}
case VariableLocation::PARAMETER:
case VariableLocation::LOCAL: {
VisitForAccumulatorValue(decl->fun());
BuildVariableAssignment(variable, Token::INIT, FeedbackSlot::Invalid(),
HoleCheckMode::kElided);
BuildVariableAssignment(variable, Token::INIT, HoleCheckMode::kElided);
break;
}
case VariableLocation::CONTEXT: {
@ -1192,8 +1232,7 @@ void BytecodeGenerator::VisitFunctionDeclaration(FunctionDeclaration* decl) {
DCHECK_EQ(variable->mode(), LET);
DCHECK(variable->IsExport());
VisitForAccumulatorValue(decl->fun());
BuildVariableAssignment(variable, Token::INIT, FeedbackSlot::Invalid(),
HoleCheckMode::kElided);
BuildVariableAssignment(variable, Token::INIT, HoleCheckMode::kElided);
break;
}
}
@ -1212,8 +1251,7 @@ void BytecodeGenerator::VisitModuleNamespaceImports() {
.CallRuntime(Runtime::kGetModuleNamespace, module_request);
Variable* var = closure_scope()->LookupLocal(entry->local_name);
DCHECK_NOT_NULL(var);
BuildVariableAssignment(var, Token::INIT, FeedbackSlot::Invalid(),
HoleCheckMode::kElided);
BuildVariableAssignment(var, Token::INIT, HoleCheckMode::kElided);
}
}
@ -1359,7 +1397,7 @@ void BytecodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
VisitForAccumulatorValue(clause->label());
builder()->CompareOperation(
Token::Value::EQ_STRICT, tag,
feedback_index(clause->CompareOperationFeedbackSlot()));
feedback_index(feedback_spec()->AddCompareICSlot()));
switch_builder.Case(ToBooleanMode::kAlreadyBoolean, i);
}
@ -1457,8 +1495,7 @@ void BytecodeGenerator::VisitForStatement(ForStatement* stmt) {
loop_builder.JumpToHeader(loop_depth_);
}
void BytecodeGenerator::VisitForInAssignment(Expression* expr,
FeedbackSlot slot) {
void BytecodeGenerator::VisitForInAssignment(Expression* expr) {
DCHECK(expr->IsValidReferenceExpression());
// Evaluate assignment starting with the value to be stored in the
@ -1468,7 +1505,7 @@ void BytecodeGenerator::VisitForInAssignment(Expression* expr,
switch (assign_type) {
case VARIABLE: {
VariableProxy* proxy = expr->AsVariableProxy();
BuildVariableAssignment(proxy->var(), Token::ASSIGN, slot,
BuildVariableAssignment(proxy->var(), Token::ASSIGN,
proxy->hole_check_mode());
break;
}
@ -1480,6 +1517,7 @@ void BytecodeGenerator::VisitForInAssignment(Expression* expr,
const AstRawString* name =
property->key()->AsLiteral()->AsRawPropertyName();
builder()->LoadAccumulatorWithRegister(value);
FeedbackSlot slot = feedback_spec()->AddStoreICSlot(language_mode());
builder()->StoreNamedProperty(object, name, feedback_index(slot),
language_mode());
break;
@ -1491,6 +1529,7 @@ void BytecodeGenerator::VisitForInAssignment(Expression* expr,
Register object = VisitForRegisterValue(property->obj());
Register key = VisitForRegisterValue(property->key());
builder()->LoadAccumulatorWithRegister(value);
FeedbackSlot slot = feedback_spec()->AddKeyedStoreICSlot(language_mode());
builder()->StoreKeyedProperty(object, key, feedback_index(slot),
language_mode());
break;
@ -1532,7 +1571,7 @@ void BytecodeGenerator::VisitForInStatement(ForInStatement* stmt) {
}
BytecodeLabel subject_null_label, subject_undefined_label;
FeedbackSlot slot = stmt->ForInFeedbackSlot();
FeedbackSlot slot = feedback_spec()->AddForInSlot();
// Prepare the state for executing ForIn.
builder()->SetExpressionAsStatementPosition(stmt->subject());
@ -1563,7 +1602,7 @@ void BytecodeGenerator::VisitForInStatement(ForInStatement* stmt) {
builder()->ForInNext(receiver, index, triple.Truncate(2),
feedback_index(slot));
loop_builder.ContinueIfUndefined();
VisitForInAssignment(stmt->each(), stmt->EachFeedbackSlot());
VisitForInAssignment(stmt->each());
VisitIterationBody(stmt, &loop_builder);
builder()->ForInStep(index);
builder()->StoreAccumulatorInRegister(index);
@ -1712,8 +1751,8 @@ void BytecodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) {
uint8_t flags = CreateClosureFlags::Encode(
expr->pretenure(), closure_scope()->is_function_scope());
size_t entry = builder()->AllocateDeferredConstantPoolEntry();
int slot_index = feedback_index(expr->LiteralFeedbackSlot());
builder()->CreateClosure(entry, slot_index, flags);
FeedbackSlot slot = GetCachedCreateClosureSlot(expr);
builder()->CreateClosure(entry, feedback_index(slot), flags);
function_literals_.push_back(std::make_pair(expr, entry));
}
@ -1738,8 +1777,9 @@ void BytecodeGenerator::BuildClassLiteral(ClassLiteral* expr) {
if (FunctionLiteral::NeedsHomeObject(expr->constructor())) {
// Prototype is already in the accumulator.
builder()->StoreHomeObjectProperty(
constructor, feedback_index(expr->HomeObjectSlot()), language_mode());
FeedbackSlot slot = feedback_spec()->AddStoreICSlot(language_mode());
builder()->StoreHomeObjectProperty(constructor, feedback_index(slot),
language_mode());
}
VisitClassLiteralProperties(expr, constructor, prototype);
@ -1750,7 +1790,7 @@ void BytecodeGenerator::BuildClassLiteral(ClassLiteral* expr) {
DCHECK(expr->class_variable()->IsStackLocal() ||
expr->class_variable()->IsContextSlot());
BuildVariableAssignment(expr->class_variable(), Token::INIT,
FeedbackSlot::Invalid(), HoleCheckMode::kElided);
HoleCheckMode::kElided);
}
}
@ -1819,9 +1859,8 @@ void BytecodeGenerator::VisitClassLiteralProperties(ClassLiteral* expr,
flags |= DataPropertyInLiteralFlag::kSetFunctionName;
}
FeedbackSlot slot = property->GetStoreDataPropertySlot();
DCHECK(!slot.IsInvalid());
FeedbackSlot slot =
feedback_spec()->AddStoreDataPropertyInLiteralICSlot();
builder()
->LoadAccumulatorWithRegister(value)
.StoreDataPropertyInLiteral(receiver, key, flags,
@ -1859,8 +1898,8 @@ void BytecodeGenerator::BuildClassLiteralNameProperty(ClassLiteral* expr,
void BytecodeGenerator::VisitNativeFunctionLiteral(
NativeFunctionLiteral* expr) {
size_t entry = builder()->AllocateDeferredConstantPoolEntry();
int slot_index = feedback_index(expr->LiteralFeedbackSlot());
builder()->CreateClosure(entry, slot_index, NOT_TENURED);
FeedbackSlot slot = feedback_spec()->AddCreateClosureSlot();
builder()->CreateClosure(entry, feedback_index(slot), NOT_TENURED);
native_function_literals_.push_back(std::make_pair(expr, entry));
}
@ -1907,7 +1946,8 @@ void BytecodeGenerator::VisitLiteral(Literal* expr) {
void BytecodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
// Materialize a regular expression literal.
builder()->CreateRegExpLiteral(
expr->raw_pattern(), feedback_index(expr->literal_slot()), expr->flags());
expr->raw_pattern(), feedback_index(feedback_spec()->AddLiteralSlot()),
expr->flags());
}
void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
@ -1919,7 +1959,7 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
return;
}
int literal_index = feedback_index(expr->literal_slot());
int literal_index = feedback_index(feedback_spec()->AddLiteralSlot());
// Deep-copy the literal boilerplate.
uint8_t flags = CreateObjectLiteralFlags::Encode(
expr->ComputeFlags(), expr->IsFastCloningSupported());
@ -1963,18 +2003,17 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
DCHECK(key->IsPropertyName());
if (property->emit_store()) {
VisitForAccumulatorValue(property->value());
FeedbackSlot slot = feedback_spec()->AddStoreOwnICSlot();
if (FunctionLiteral::NeedsHomeObject(property->value())) {
RegisterAllocationScope register_scope(this);
Register value = register_allocator()->NewRegister();
builder()->StoreAccumulatorInRegister(value);
builder()->StoreNamedOwnProperty(
literal, key->AsRawPropertyName(),
feedback_index(property->GetSlot(0)));
VisitSetHomeObject(value, literal, property, 1);
literal, key->AsRawPropertyName(), feedback_index(slot));
VisitSetHomeObject(value, literal, property);
} else {
builder()->StoreNamedOwnProperty(
literal, key->AsRawPropertyName(),
feedback_index(property->GetSlot(0)));
literal, key->AsRawPropertyName(), feedback_index(slot));
}
} else {
VisitForEffect(property->value());
@ -2076,9 +2115,8 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
data_property_flags |= DataPropertyInLiteralFlag::kSetFunctionName;
}
FeedbackSlot slot = property->GetStoreDataPropertySlot();
DCHECK(!slot.IsInvalid());
FeedbackSlot slot =
feedback_spec()->AddStoreDataPropertyInLiteralICSlot();
builder()
->LoadAccumulatorWithRegister(value)
.StoreDataPropertyInLiteral(literal, key, data_property_flags,
@ -2120,7 +2158,7 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
void BytecodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
// Deep-copy the literal boilerplate.
int literal_index = feedback_index(expr->literal_slot());
int literal_index = feedback_index(feedback_spec()->AddLiteralSlot());
if (expr->is_empty()) {
// Empty array literal fast-path.
DCHECK(expr->IsFastCloningSupported());
@ -2136,9 +2174,13 @@ void BytecodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
Register index, literal;
// We'll reuse the same literal slot for all of the non-constant
// subexpressions that use a keyed store IC.
// Evaluate all the non-constant subexpressions and store them into the
// newly cloned array.
bool literal_in_accumulator = true;
FeedbackSlot slot;
for (int array_index = 0; array_index < expr->values()->length();
array_index++) {
Expression* subexpr = expr->values()->at(array_index);
@ -2151,8 +2193,10 @@ void BytecodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
builder()->StoreAccumulatorInRegister(literal);
literal_in_accumulator = false;
}
if (slot.IsInvalid()) {
slot = feedback_spec()->AddKeyedStoreICSlot(language_mode());
}
FeedbackSlot slot = expr->LiteralFeedbackSlot();
builder()
->LoadLiteral(Smi::FromInt(array_index))
.StoreAccumulatorInRegister(index);
@ -2169,11 +2213,10 @@ void BytecodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
void BytecodeGenerator::VisitVariableProxy(VariableProxy* proxy) {
builder()->SetExpressionPosition(proxy);
BuildVariableLoad(proxy->var(), proxy->VariableFeedbackSlot(),
proxy->hole_check_mode());
BuildVariableLoad(proxy->var(), proxy->hole_check_mode());
}
void BytecodeGenerator::BuildVariableLoad(Variable* variable, FeedbackSlot slot,
void BytecodeGenerator::BuildVariableLoad(Variable* variable,
HoleCheckMode hole_check_mode,
TypeofMode typeof_mode) {
switch (variable->location()) {
@ -2211,6 +2254,7 @@ void BytecodeGenerator::BuildVariableLoad(Variable* variable, FeedbackSlot slot,
if (variable->raw_name() == ast_string_constants()->undefined_string()) {
builder()->LoadUndefined();
} else {
FeedbackSlot slot = GetCachedLoadGlobalICSlot(typeof_mode, variable);
builder()->LoadGlobal(variable->raw_name(), feedback_index(slot),
typeof_mode);
}
@ -2255,6 +2299,7 @@ void BytecodeGenerator::BuildVariableLoad(Variable* variable, FeedbackSlot slot,
case DYNAMIC_GLOBAL: {
int depth =
closure_scope()->ContextChainLengthUntilOutermostSloppyEval();
FeedbackSlot slot = GetCachedLoadGlobalICSlot(typeof_mode, variable);
builder()->LoadLookupGlobalSlot(variable->raw_name(), typeof_mode,
feedback_index(slot), depth);
break;
@ -2276,10 +2321,9 @@ void BytecodeGenerator::BuildVariableLoad(Variable* variable, FeedbackSlot slot,
}
void BytecodeGenerator::BuildVariableLoadForAccumulatorValue(
Variable* variable, FeedbackSlot slot, HoleCheckMode hole_check_mode,
TypeofMode typeof_mode) {
Variable* variable, HoleCheckMode hole_check_mode, TypeofMode typeof_mode) {
ValueResultScope accumulator_result(this);
BuildVariableLoad(variable, slot, hole_check_mode, typeof_mode);
BuildVariableLoad(variable, hole_check_mode, typeof_mode);
}
void BytecodeGenerator::BuildReturn(int source_position) {
@ -2290,7 +2334,7 @@ void BytecodeGenerator::BuildReturn(int source_position) {
builder()->StoreAccumulatorInRegister(result).CallRuntime(
Runtime::kTraceExit, result);
}
if (info()->literal()->feedback_vector_spec()->HasTypeProfileSlot()) {
if (info()->collect_type_profile()) {
builder()->CollectTypeProfile(info()->literal()->return_position());
}
builder()->SetReturnPosition(source_position, info()->literal());
@ -2317,8 +2361,7 @@ void BytecodeGenerator::BuildAsyncReturn(int source_position) {
Variable* var_promise = closure_scope()->promise_var();
DCHECK_NOT_NULL(var_promise);
BuildVariableLoad(var_promise, FeedbackSlot::Invalid(),
HoleCheckMode::kElided);
BuildVariableLoad(var_promise, HoleCheckMode::kElided);
builder()
->StoreAccumulatorInRegister(promise)
.CallJSRuntime(Context::PROMISE_RESOLVE_INDEX, args)
@ -2355,8 +2398,8 @@ void BytecodeGenerator::BuildHoleCheckForVariableAssignment(Variable* variable,
}
void BytecodeGenerator::BuildVariableAssignment(
Variable* variable, Token::Value op, FeedbackSlot slot,
HoleCheckMode hole_check_mode, LookupHoistingMode lookup_hoisting_mode) {
Variable* variable, Token::Value op, HoleCheckMode hole_check_mode,
LookupHoistingMode lookup_hoisting_mode) {
VariableMode mode = variable->mode();
RegisterAllocationScope assignment_register_scope(this);
BytecodeLabel end_label;
@ -2393,6 +2436,9 @@ void BytecodeGenerator::BuildVariableAssignment(
break;
}
case VariableLocation::UNALLOCATED: {
// TODO(ishell): consider using FeedbackSlotCache for variables here.
FeedbackSlot slot =
feedback_spec()->AddStoreGlobalICSlot(language_mode());
builder()->StoreGlobal(variable->raw_name(), feedback_index(slot),
language_mode());
break;
@ -2518,19 +2564,18 @@ void BytecodeGenerator::VisitAssignment(Assignment* expr) {
switch (assign_type) {
case VARIABLE: {
VariableProxy* proxy = expr->target()->AsVariableProxy();
BuildVariableLoad(proxy->var(), proxy->VariableFeedbackSlot(),
proxy->hole_check_mode());
BuildVariableLoad(proxy->var(), proxy->hole_check_mode());
break;
}
case NAMED_PROPERTY: {
FeedbackSlot slot = property->PropertyFeedbackSlot();
FeedbackSlot slot = feedback_spec()->AddLoadICSlot();
builder()->LoadNamedProperty(object, name, feedback_index(slot));
break;
}
case KEYED_PROPERTY: {
// Key is already in accumulator at this point due to evaluating the
// LHS above.
FeedbackSlot slot = property->PropertyFeedbackSlot();
FeedbackSlot slot = feedback_spec()->AddKeyedLoadICSlot();
builder()->LoadKeyedProperty(object, feedback_index(slot));
break;
}
@ -2546,7 +2591,7 @@ void BytecodeGenerator::VisitAssignment(Assignment* expr) {
}
}
BinaryOperation* binop = expr->AsCompoundAssignment()->binary_operation();
FeedbackSlot slot = binop->BinaryOperationFeedbackSlot();
FeedbackSlot slot = feedback_spec()->AddBinaryOpICSlot();
if (expr->value()->IsSmiLiteral()) {
builder()->BinaryOperationSmiLiteral(
binop->op(), expr->value()->AsLiteral()->AsSmiLiteral(),
@ -2563,25 +2608,28 @@ void BytecodeGenerator::VisitAssignment(Assignment* expr) {
// Store the value.
builder()->SetExpressionPosition(expr);
FeedbackSlot slot = expr->AssignmentSlot();
switch (assign_type) {
case VARIABLE: {
// TODO(oth): The BuildVariableAssignment() call is hard to reason about.
// Is the value in the accumulator safe? Yes, but scary.
VariableProxy* proxy = expr->target()->AsVariableProxy();
BuildVariableAssignment(proxy->var(), expr->op(), slot,
BuildVariableAssignment(proxy->var(), expr->op(),
proxy->hole_check_mode(),
expr->lookup_hoisting_mode());
break;
}
case NAMED_PROPERTY:
case NAMED_PROPERTY: {
FeedbackSlot slot = feedback_spec()->AddStoreICSlot(language_mode());
builder()->StoreNamedProperty(object, name, feedback_index(slot),
language_mode());
break;
case KEYED_PROPERTY:
}
case KEYED_PROPERTY: {
FeedbackSlot slot = feedback_spec()->AddKeyedStoreICSlot(language_mode());
builder()->StoreKeyedProperty(object, key, feedback_index(slot),
language_mode());
break;
}
case NAMED_SUPER_PROPERTY: {
builder()
->StoreAccumulatorInRegister(super_property_args[3])
@ -2786,11 +2834,7 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) {
Register iterator = iterator_and_input[0];
BuildGetIterator(expr->expression(), iterator_type,
expr->load_iterable_iterator_slot(),
expr->call_iterable_iterator_slot(),
expr->load_iterable_async_iterator_slot(),
expr->call_iterable_async_iterator_slot());
BuildGetIterator(expr->expression(), iterator_type);
builder()->StoreAccumulatorInRegister(iterator);
Register input = iterator_and_input[1];
builder()->LoadUndefined().StoreAccumulatorInRegister(input);
@ -2825,13 +2869,15 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) {
RegisterAllocationScope register_scope(this);
// output = iterator.next(input);
Register iterator_next = register_allocator()->NewRegister();
FeedbackSlot load_slot = feedback_spec()->AddLoadICSlot();
FeedbackSlot call_slot = feedback_spec()->AddCallICSlot();
builder()
->LoadNamedProperty(
iterator, ast_string_constants()->next_string(),
feedback_index(expr->load_iterator_next_slot()))
->LoadNamedProperty(iterator,
ast_string_constants()->next_string(),
feedback_index(load_slot))
.StoreAccumulatorInRegister(iterator_next)
.CallProperty(iterator_next, iterator_and_input,
feedback_index(expr->call_iterator_next_slot()))
feedback_index(call_slot))
.Jump(after_switch.New());
}
@ -2842,15 +2888,17 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) {
BytecodeLabels return_input(zone());
// Trigger return from within the inner iterator.
Register iterator_return = register_allocator()->NewRegister();
FeedbackSlot load_slot = feedback_spec()->AddLoadICSlot();
FeedbackSlot call_slot = feedback_spec()->AddCallICSlot();
builder()
->LoadNamedProperty(
iterator, ast_string_constants()->return_string(),
feedback_index(expr->load_iterator_return_slot()))
->LoadNamedProperty(iterator,
ast_string_constants()->return_string(),
feedback_index(load_slot))
.JumpIfUndefined(return_input.New())
.JumpIfNull(return_input.New())
.StoreAccumulatorInRegister(iterator_return)
.CallProperty(iterator_return, iterator_and_input,
feedback_index(expr->call_iterator_return_slot1()))
feedback_index(call_slot))
.Jump(after_switch.New());
return_input.Bind(builder());
@ -2873,16 +2921,18 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) {
// If the inner iterator has a throw method, use it to trigger an
// exception inside.
Register iterator_throw = register_allocator()->NewRegister();
FeedbackSlot load_slot = feedback_spec()->AddLoadICSlot();
FeedbackSlot call_slot = feedback_spec()->AddCallICSlot();
builder()
->LoadNamedProperty(
iterator, ast_string_constants()->throw_string(),
feedback_index(expr->load_iterator_throw_slot()))
->LoadNamedProperty(iterator,
ast_string_constants()->throw_string(),
feedback_index(load_slot))
.JumpIfUndefined(iterator_throw_is_undefined.New())
.JumpIfNull(iterator_throw_is_undefined.New())
.StoreAccumulatorInRegister(iterator_throw);
builder()
->CallProperty(iterator_throw, iterator_and_input,
feedback_index(expr->call_iterator_throw_slot()))
feedback_index(call_slot))
.Jump(after_switch.New());
}
@ -2893,17 +2943,18 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) {
Register iterator_return = register_allocator()->NewRegister();
// If iterator.throw does not exist, try to use iterator.return to
// inform the iterator that it should stop.
FeedbackSlot load_slot = feedback_spec()->AddLoadICSlot();
FeedbackSlot call_slot = feedback_spec()->AddCallICSlot();
builder()
->LoadNamedProperty(
iterator, ast_string_constants()->return_string(),
feedback_index(expr->load_iterator_return_slot()))
->LoadNamedProperty(iterator,
ast_string_constants()->return_string(),
feedback_index(load_slot))
.StoreAccumulatorInRegister(iterator_return);
builder()
->JumpIfUndefined(throw_throw_method_missing.New())
.JumpIfNull(throw_throw_method_missing.New())
.CallProperty(
iterator_return, RegisterList(iterator),
feedback_index(expr->call_iterator_return_slot2()));
.CallProperty(iterator_return, RegisterList(iterator),
feedback_index(call_slot));
if (iterator_type == IteratorType::kAsync) {
// For async generators, await the result of the .return() call.
@ -2939,7 +2990,7 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) {
// Break once output.done is true.
builder()->LoadNamedProperty(
output, ast_string_constants()->done_string(),
feedback_index(expr->load_output_done_slot()));
feedback_index(feedback_spec()->AddLoadICSlot()));
loop.BreakIfTrue(ToBooleanMode::kConvertToBoolean);
@ -2954,7 +3005,7 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) {
// AsyncGeneratorRequest's promise.
builder()->LoadNamedProperty(
output, ast_string_constants()->value_string(),
feedback_index(expr->load_output_value_slot()));
feedback_index(feedback_spec()->AddLoadICSlot()));
RegisterList args = register_allocator()->NewRegisterList(3);
builder()
@ -2983,7 +3034,7 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) {
Register output_value = register_allocator()->NewRegister();
builder()
->LoadNamedProperty(output, ast_string_constants()->value_string(),
feedback_index(expr->load_output_value_slot()))
feedback_index(feedback_spec()->AddLoadICSlot()))
.StoreAccumulatorInRegister(output_value)
.LoadLiteral(Smi::FromInt(JSGeneratorObject::kReturn))
.CompareOperation(Token::EQ_STRICT, resume_mode)
@ -3038,8 +3089,7 @@ void BytecodeGenerator::BuildAwait(int suspend_id) {
// AsyncFunction Await builtins require a 3rd parameter to hold the outer
// promise.
Variable* var_promise = closure_scope()->promise_var();
BuildVariableLoadForAccumulatorValue(var_promise, FeedbackSlot::Invalid(),
HoleCheckMode::kElided);
BuildVariableLoadForAccumulatorValue(var_promise, HoleCheckMode::kElided);
builder()->StoreAccumulatorInRegister(args[2]);
}
@ -3088,7 +3138,6 @@ void BytecodeGenerator::VisitThrow(Throw* expr) {
void BytecodeGenerator::VisitPropertyLoad(Register obj, Property* property) {
LhsKind property_kind = Property::GetAssignType(property);
FeedbackSlot slot = property->PropertyFeedbackSlot();
switch (property_kind) {
case VARIABLE:
UNREACHABLE();
@ -3096,13 +3145,14 @@ void BytecodeGenerator::VisitPropertyLoad(Register obj, Property* property) {
builder()->SetExpressionPosition(property);
builder()->LoadNamedProperty(
obj, property->key()->AsLiteral()->AsRawPropertyName(),
feedback_index(slot));
feedback_index(feedback_spec()->AddLoadICSlot()));
break;
}
case KEYED_PROPERTY: {
VisitForAccumulatorValue(property->key());
builder()->SetExpressionPosition(property);
builder()->LoadKeyedProperty(obj, feedback_index(slot));
builder()->LoadKeyedProperty(
obj, feedback_index(feedback_spec()->AddKeyedLoadICSlot()));
break;
}
case NAMED_SUPER_PROPERTY:
@ -3225,7 +3275,6 @@ void BytecodeGenerator::VisitCall(Call* expr) {
// Load callee as a global variable.
VariableProxy* proxy = callee_expr->AsVariableProxy();
BuildVariableLoadForAccumulatorValue(proxy->var(),
proxy->VariableFeedbackSlot(),
proxy->hole_check_mode());
builder()->StoreAccumulatorInRegister(callee);
break;
@ -3317,7 +3366,7 @@ void BytecodeGenerator::VisitCall(Call* expr) {
builder()->SetExpressionPosition(expr);
int const feedback_slot_index = feedback_index(expr->CallFeedbackICSlot());
int feedback_slot_index = feedback_index(feedback_spec()->AddCallICSlot());
if (is_spread_call) {
DCHECK(!implicit_undefined_receiver);
@ -3350,9 +3399,10 @@ void BytecodeGenerator::VisitCallSuper(Call* expr) {
VisitForAccumulatorValue(super->new_target_var());
builder()->SetExpressionPosition(expr);
int feedback_slot_index = feedback_index(feedback_spec()->AddCallICSlot());
// When a super call contains a spread, a CallSuper AST node is only created
// if there is exactly one spread, and it is the last argument.
int const feedback_slot_index = feedback_index(expr->CallFeedbackICSlot());
if (expr->only_last_arg_is_spread()) {
builder()->ConstructWithSpread(constructor, args_regs, feedback_slot_index);
} else {
@ -3377,7 +3427,7 @@ void BytecodeGenerator::VisitCallNew(CallNew* expr) {
builder()->SetExpressionPosition(expr);
builder()->LoadAccumulatorWithRegister(constructor);
int const feedback_slot_index = feedback_index(expr->CallNewFeedbackSlot());
int feedback_slot_index = feedback_index(feedback_spec()->AddCallICSlot());
if (expr->only_last_arg_is_spread()) {
builder()->ConstructWithSpread(constructor, args, feedback_slot_index);
} else {
@ -3409,9 +3459,8 @@ void BytecodeGenerator::VisitForTypeOfValue(Expression* expr) {
// Typeof does not throw a reference error on global variables, hence we
// perform a non-contextual load in case the operand is a variable proxy.
VariableProxy* proxy = expr->AsVariableProxy();
BuildVariableLoadForAccumulatorValue(
proxy->var(), proxy->VariableFeedbackSlot(), proxy->hole_check_mode(),
INSIDE_TYPEOF);
BuildVariableLoadForAccumulatorValue(proxy->var(), proxy->hole_check_mode(),
INSIDE_TYPEOF);
} else {
VisitForAccumulatorValue(expr);
}
@ -3460,7 +3509,7 @@ void BytecodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
VisitForAccumulatorValue(expr->expression());
builder()->SetExpressionPosition(expr);
builder()->UnaryOperation(
expr->op(), feedback_index(expr->UnaryOperationFeedbackSlot()));
expr->op(), feedback_index(feedback_spec()->AddBinaryOpICSlot()));
break;
default:
UNREACHABLE();
@ -3538,26 +3587,24 @@ void BytecodeGenerator::VisitCountOperation(CountOperation* expr) {
case VARIABLE: {
VariableProxy* proxy = expr->expression()->AsVariableProxy();
BuildVariableLoadForAccumulatorValue(proxy->var(),
proxy->VariableFeedbackSlot(),
proxy->hole_check_mode());
break;
}
case NAMED_PROPERTY: {
FeedbackSlot slot = property->PropertyFeedbackSlot();
object = VisitForRegisterValue(property->obj());
name = property->key()->AsLiteral()->AsRawPropertyName();
builder()->LoadNamedProperty(object, name, feedback_index(slot));
builder()->LoadNamedProperty(
object, name, feedback_index(feedback_spec()->AddLoadICSlot()));
break;
}
case KEYED_PROPERTY: {
FeedbackSlot slot = property->PropertyFeedbackSlot();
object = VisitForRegisterValue(property->obj());
// Use visit for accumulator here since we need the key in the accumulator
// for the LoadKeyedProperty.
key = register_allocator()->NewRegister();
VisitForAccumulatorValue(property->key());
builder()->StoreAccumulatorInRegister(key).LoadKeyedProperty(
object, feedback_index(slot));
object, feedback_index(feedback_spec()->AddKeyedLoadICSlot()));
break;
}
case NAMED_SUPER_PROPERTY: {
@ -3587,7 +3634,7 @@ void BytecodeGenerator::VisitCountOperation(CountOperation* expr) {
}
// Save result for postfix expressions.
FeedbackSlot count_slot = expr->CountBinaryOpFeedbackSlot();
FeedbackSlot count_slot = feedback_spec()->AddBinaryOpICSlot();
if (is_postfix) {
old_value = register_allocator()->NewRegister();
// Convert old value into a number before saving it.
@ -3603,21 +3650,22 @@ void BytecodeGenerator::VisitCountOperation(CountOperation* expr) {
// Store the value.
builder()->SetExpressionPosition(expr);
FeedbackSlot feedback_slot = expr->CountSlot();
switch (assign_type) {
case VARIABLE: {
VariableProxy* proxy = expr->expression()->AsVariableProxy();
BuildVariableAssignment(proxy->var(), expr->op(), feedback_slot,
BuildVariableAssignment(proxy->var(), expr->op(),
proxy->hole_check_mode());
break;
}
case NAMED_PROPERTY: {
builder()->StoreNamedProperty(object, name, feedback_index(feedback_slot),
FeedbackSlot slot = feedback_spec()->AddStoreICSlot(language_mode());
builder()->StoreNamedProperty(object, name, feedback_index(slot),
language_mode());
break;
}
case KEYED_PROPERTY: {
builder()->StoreKeyedProperty(object, key, feedback_index(feedback_slot),
FeedbackSlot slot = feedback_spec()->AddKeyedStoreICSlot(language_mode());
builder()->StoreKeyedProperty(object, key, feedback_index(slot),
language_mode());
break;
}
@ -3706,10 +3754,10 @@ void BytecodeGenerator::VisitCompareOperation(CompareOperation* expr) {
Register lhs = VisitForRegisterValue(expr->left());
VisitForAccumulatorValue(expr->right());
builder()->SetExpressionPosition(expr);
FeedbackSlot slot = expr->CompareOperationFeedbackSlot();
if (slot.IsInvalid()) {
if (expr->op() == Token::INSTANCEOF || expr->op() == Token::IN) {
builder()->CompareOperation(expr->op(), lhs);
} else {
FeedbackSlot slot = feedback_spec()->AddCompareICSlot();
builder()->CompareOperation(expr->op(), lhs, feedback_index(slot));
}
}
@ -3718,7 +3766,7 @@ void BytecodeGenerator::VisitCompareOperation(CompareOperation* expr) {
}
void BytecodeGenerator::VisitArithmeticExpression(BinaryOperation* expr) {
FeedbackSlot slot = expr->BinaryOperationFeedbackSlot();
FeedbackSlot slot = feedback_spec()->AddBinaryOpICSlot();
Expression* subexpr;
Smi* literal;
if (expr->IsSmiLiteralOperation(&subexpr, &literal)) {
@ -3749,11 +3797,7 @@ void BytecodeGenerator::VisitImportCallExpression(ImportCallExpression* expr) {
}
void BytecodeGenerator::BuildGetIterator(Expression* iterable,
IteratorType hint,
FeedbackSlot load_slot,
FeedbackSlot call_slot,
FeedbackSlot async_load_slot,
FeedbackSlot async_call_slot) {
IteratorType hint) {
RegisterList args = register_allocator()->NewRegisterList(1);
Register method = register_allocator()->NewRegister();
Register obj = args[0];
@ -3763,7 +3807,7 @@ void BytecodeGenerator::BuildGetIterator(Expression* iterable,
if (hint == IteratorType::kAsync) {
// Set method to GetMethod(obj, @@asyncIterator)
builder()->StoreAccumulatorInRegister(obj).LoadAsyncIteratorProperty(
obj, feedback_index(async_load_slot));
obj, feedback_index(feedback_spec()->AddLoadICSlot()));
BytecodeLabel async_iterator_undefined, async_iterator_null, done;
// TODO(ignition): Add a single opcode for JumpIfNullOrUndefined
@ -3772,7 +3816,7 @@ void BytecodeGenerator::BuildGetIterator(Expression* iterable,
// Let iterator be Call(method, obj)
builder()->StoreAccumulatorInRegister(method).CallProperty(
method, args, feedback_index(async_call_slot));
method, args, feedback_index(feedback_spec()->AddCallICSlot()));
// If Type(iterator) is not Object, throw a TypeError exception.
builder()->JumpIfJSReceiver(&done);
@ -3783,11 +3827,13 @@ void BytecodeGenerator::BuildGetIterator(Expression* iterable,
// If method is undefined,
// Let syncMethod be GetMethod(obj, @@iterator)
builder()
->LoadIteratorProperty(obj, feedback_index(load_slot))
->LoadIteratorProperty(obj,
feedback_index(feedback_spec()->AddLoadICSlot()))
.StoreAccumulatorInRegister(method);
// Let syncIterator be Call(syncMethod, obj)
builder()->CallProperty(method, args, feedback_index(call_slot));
builder()->CallProperty(method, args,
feedback_index(feedback_spec()->AddCallICSlot()));
// Return CreateAsyncFromSyncIterator(syncIterator)
// alias `method` register as it's no longer used
@ -3800,11 +3846,13 @@ void BytecodeGenerator::BuildGetIterator(Expression* iterable,
// Let method be GetMethod(obj, @@iterator).
builder()
->StoreAccumulatorInRegister(obj)
.LoadIteratorProperty(obj, feedback_index(load_slot))
.LoadIteratorProperty(obj,
feedback_index(feedback_spec()->AddLoadICSlot()))
.StoreAccumulatorInRegister(method);
// Let iterator be Call(method, obj).
builder()->CallProperty(method, args, feedback_index(call_slot));
builder()->CallProperty(method, args,
feedback_index(feedback_spec()->AddCallICSlot()));
// If Type(iterator) is not Object, throw a TypeError exception.
BytecodeLabel no_type_error;
@ -3816,11 +3864,7 @@ void BytecodeGenerator::BuildGetIterator(Expression* iterable,
void BytecodeGenerator::VisitGetIterator(GetIterator* expr) {
builder()->SetExpressionPosition(expr);
BuildGetIterator(expr->iterable(), expr->hint(),
expr->IteratorPropertyFeedbackSlot(),
expr->IteratorCallFeedbackSlot(),
expr->AsyncIteratorPropertyFeedbackSlot(),
expr->AsyncIteratorCallFeedbackSlot());
BuildGetIterator(expr->iterable(), expr->hint());
}
void BytecodeGenerator::VisitGetTemplateObject(GetTemplateObject* expr) {
@ -4054,11 +4098,10 @@ void BytecodeGenerator::VisitObjectLiteralAccessor(
}
void BytecodeGenerator::VisitSetHomeObject(Register value, Register home_object,
LiteralProperty* property,
int slot_number) {
LiteralProperty* property) {
Expression* expr = property->value();
if (FunctionLiteral::NeedsHomeObject(expr)) {
FeedbackSlot slot = property->GetSlot(slot_number);
FeedbackSlot slot = feedback_spec()->AddStoreICSlot(language_mode());
builder()
->LoadAccumulatorWithRegister(home_object)
.StoreHomeObjectProperty(value, feedback_index(slot), language_mode());
@ -4077,8 +4120,7 @@ void BytecodeGenerator::VisitArgumentsObject(Variable* variable) {
? CreateArgumentsType::kUnmappedArguments
: CreateArgumentsType::kMappedArguments;
builder()->CreateArguments(type);
BuildVariableAssignment(variable, Token::ASSIGN, FeedbackSlot::Invalid(),
HoleCheckMode::kElided);
BuildVariableAssignment(variable, Token::ASSIGN, HoleCheckMode::kElided);
}
void BytecodeGenerator::VisitRestArgumentsArray(Variable* rest) {
@ -4088,8 +4130,7 @@ void BytecodeGenerator::VisitRestArgumentsArray(Variable* rest) {
// variable.
builder()->CreateArguments(CreateArgumentsType::kRestParameter);
DCHECK(rest->IsContextSlot() || rest->IsStackAllocated());
BuildVariableAssignment(rest, Token::ASSIGN, FeedbackSlot::Invalid(),
HoleCheckMode::kElided);
BuildVariableAssignment(rest, Token::ASSIGN, HoleCheckMode::kElided);
}
void BytecodeGenerator::VisitThisFunctionVariable(Variable* variable) {
@ -4097,8 +4138,7 @@ void BytecodeGenerator::VisitThisFunctionVariable(Variable* variable) {
// Store the closure we were called with in the given variable.
builder()->LoadAccumulatorWithRegister(Register::function_closure());
BuildVariableAssignment(variable, Token::INIT, FeedbackSlot::Invalid(),
HoleCheckMode::kElided);
BuildVariableAssignment(variable, Token::INIT, HoleCheckMode::kElided);
}
void BytecodeGenerator::VisitNewTargetVariable(Variable* variable) {
@ -4119,8 +4159,7 @@ void BytecodeGenerator::VisitNewTargetVariable(Variable* variable) {
// Store the new target we were called with in the given variable.
builder()->LoadAccumulatorWithRegister(incoming_new_target_or_generator_);
BuildVariableAssignment(variable, Token::INIT, FeedbackSlot::Invalid(),
HoleCheckMode::kElided);
BuildVariableAssignment(variable, Token::INIT, HoleCheckMode::kElided);
}
void BytecodeGenerator::BuildGeneratorObjectVariableInitialization() {
@ -4142,7 +4181,7 @@ void BytecodeGenerator::BuildGeneratorObjectVariableInitialization() {
GetRegisterForLocalVariable(generator_object_var).index());
} else {
BuildVariableAssignment(generator_object_var, Token::INIT,
FeedbackSlot::Invalid(), HoleCheckMode::kElided);
HoleCheckMode::kElided);
}
}
@ -4351,11 +4390,37 @@ Register BytecodeGenerator::generator_object() const {
return incoming_new_target_or_generator_;
}
FeedbackVectorSpec* BytecodeGenerator::feedback_spec() {
return info()->feedback_vector_spec();
}
int BytecodeGenerator::feedback_index(FeedbackSlot slot) const {
DCHECK(!slot.IsInvalid());
return FeedbackVector::GetIndex(slot);
}
FeedbackSlot BytecodeGenerator::GetCachedLoadGlobalICSlot(
TypeofMode typeof_mode, Variable* variable) {
FeedbackSlot slot = feedback_slot_cache()->Get(typeof_mode, variable);
if (!slot.IsInvalid()) {
return slot;
}
slot = feedback_spec()->AddLoadGlobalICSlot(typeof_mode);
feedback_slot_cache()->Put(typeof_mode, variable, slot);
return slot;
}
FeedbackSlot BytecodeGenerator::GetCachedCreateClosureSlot(
FunctionLiteral* literal) {
FeedbackSlot slot = feedback_slot_cache()->Get(literal);
if (!slot.IsInvalid()) {
return slot;
}
slot = feedback_spec()->AddCreateClosureSlot();
feedback_slot_cache()->Put(literal, slot);
return slot;
}
Runtime::FunctionId BytecodeGenerator::StoreToSuperRuntimeId() {
return is_strict(language_mode()) ? Runtime::kStoreToSuper_Strict
: Runtime::kStoreToSuper_Sloppy;

View File

@ -53,6 +53,7 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
class CurrentScope;
class ExpressionResultScope;
class EffectResultScope;
class FeedbackSlotCache;
class GlobalDeclarationsBuilder;
class RegisterAllocationScope;
class TestResultScope;
@ -108,15 +109,13 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
void VisitPropertyLoadForRegister(Register obj, Property* expr,
Register destination);
void BuildVariableLoad(Variable* variable, FeedbackSlot slot,
HoleCheckMode hole_check_mode,
void BuildVariableLoad(Variable* variable, HoleCheckMode hole_check_mode,
TypeofMode typeof_mode = NOT_INSIDE_TYPEOF);
void BuildVariableLoadForAccumulatorValue(
Variable* variable, FeedbackSlot slot, HoleCheckMode hole_check_mode,
Variable* variable, HoleCheckMode hole_check_mode,
TypeofMode typeof_mode = NOT_INSIDE_TYPEOF);
void BuildVariableAssignment(
Variable* variable, Token::Value op, FeedbackSlot slot,
HoleCheckMode hole_check_mode,
Variable* variable, Token::Value op, HoleCheckMode hole_check_mode,
LookupHoistingMode lookup_hoisting_mode = LookupHoistingMode::kNormal);
void BuildLiteralCompareNil(Token::Value compare_op, NilValue nil);
void BuildReturn(int source_position = kNoSourcePosition);
@ -142,10 +141,7 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
void BuildAwait(int suspend_id);
void BuildGetIterator(Expression* iterable, IteratorType hint,
FeedbackSlot load_slot, FeedbackSlot call_slot,
FeedbackSlot async_load_slot,
FeedbackSlot async_call_slot);
void BuildGetIterator(Expression* iterable, IteratorType hint);
void AllocateTopLevelRegisters();
void VisitArgumentsObject(Variable* variable);
@ -161,11 +157,11 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
void VisitBlockDeclarationsAndStatements(Block* stmt);
void VisitFunctionClosureForContext();
void VisitSetHomeObject(Register value, Register home_object,
LiteralProperty* property, int slot_number = 0);
LiteralProperty* property);
void VisitObjectLiteralAccessor(Register home_object,
ObjectLiteralProperty* property,
Register value_out);
void VisitForInAssignment(Expression* expr, FeedbackSlot slot);
void VisitForInAssignment(Expression* expr);
void VisitModuleNamespaceImports();
// Builds a logical OR/AND within a test context by rewiring the jumps based
@ -216,6 +212,12 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
inline Runtime::FunctionId StoreToSuperRuntimeId();
inline Runtime::FunctionId StoreKeyedToSuperRuntimeId();
// Returns a cached slot, or create and cache a new slot if one doesn't
// already exists.
FeedbackSlot GetCachedLoadGlobalICSlot(TypeofMode typeof_mode,
Variable* variable);
FeedbackSlot GetCachedCreateClosureSlot(FunctionLiteral* literal);
static constexpr ToBooleanMode ToBooleanModeFromTypeHint(TypeHint type_hint) {
return type_hint == TypeHint::kBoolean ? ToBooleanMode::kAlreadyBoolean
: ToBooleanMode::kConvertToBoolean;
@ -256,7 +258,12 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
}
inline LanguageMode language_mode() const;
inline FunctionKind function_kind() const;
int feedback_index(FeedbackSlot slot) const;
inline FeedbackVectorSpec* feedback_spec();
inline int feedback_index(FeedbackSlot slot) const;
inline FeedbackSlotCache* feedback_slot_cache() {
return feedback_slot_cache_;
}
inline HandlerTable::CatchPrediction catch_prediction() const {
return catch_prediction_;
@ -272,6 +279,8 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
DeclarationScope* closure_scope_;
Scope* current_scope_;
FeedbackSlotCache* feedback_slot_cache_;
GlobalDeclarationsBuilder* globals_builder_;
BlockCoverageBuilder* block_coverage_builder_;
ZoneVector<GlobalDeclarationsBuilder*> global_declarations_;

View File

@ -34,17 +34,17 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), I8(1),
B(Star), R(0),
/* 45 S> */ B(CreateArrayLiteral), U8(0), U8(1), U8(37),
/* 45 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
B(Star), R(2),
B(LdaZero),
B(Star), R(1),
B(Ldar), R(0),
/* 54 E> */ B(StaKeyedProperty), R(2), R(1), U8(2),
/* 54 E> */ B(StaKeyedProperty), R(2), R(1), U8(1),
B(LdaSmi), I8(1),
B(Star), R(1),
B(Ldar), R(0),
/* 59 E> */ B(AddSmi), I8(1), U8(0),
B(StaKeyedProperty), R(2), R(1), U8(2),
/* 59 E> */ B(AddSmi), I8(1), U8(3),
B(StaKeyedProperty), R(2), R(1), U8(1),
B(Ldar), R(2),
/* 65 S> */ B(Return),
]
@ -63,7 +63,7 @@ parameter count: 1
bytecode array length: 6
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateArrayLiteral), U8(0), U8(2), U8(4),
/* 34 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(4),
/* 61 S> */ B(Return),
]
constant pool: [
@ -83,29 +83,29 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), I8(1),
B(Star), R(0),
/* 45 S> */ B(CreateArrayLiteral), U8(0), U8(7), U8(4),
/* 45 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(4),
B(Star), R(2),
B(LdaZero),
B(Star), R(1),
B(CreateArrayLiteral), U8(1), U8(0), U8(37),
B(CreateArrayLiteral), U8(1), U8(3), U8(37),
B(Star), R(4),
B(LdaZero),
B(Star), R(3),
B(Ldar), R(0),
/* 56 E> */ B(StaKeyedProperty), R(4), R(3), U8(1),
/* 56 E> */ B(StaKeyedProperty), R(4), R(3), U8(4),
B(Ldar), R(4),
B(StaKeyedProperty), R(2), R(1), U8(8),
B(StaKeyedProperty), R(2), R(1), U8(1),
B(LdaSmi), I8(1),
B(Star), R(1),
B(CreateArrayLiteral), U8(2), U8(4), U8(37),
B(CreateArrayLiteral), U8(2), U8(6), U8(37),
B(Star), R(4),
B(LdaZero),
B(Star), R(3),
B(Ldar), R(0),
/* 68 E> */ B(AddSmi), I8(2), U8(3),
B(StaKeyedProperty), R(4), R(3), U8(5),
/* 68 E> */ B(AddSmi), I8(2), U8(9),
B(StaKeyedProperty), R(4), R(3), U8(7),
B(Ldar), R(4),
B(StaKeyedProperty), R(2), R(1), U8(8),
B(StaKeyedProperty), R(2), R(1), U8(1),
B(Ldar), R(2),
/* 76 S> */ B(Return),
]

View File

@ -73,11 +73,11 @@ bytecodes: [
/* 46 S> */ B(LdaSmi), I8(100),
B(Mov), R(0), R(1),
B(Star), R(0),
/* 52 E> */ B(Add), R(1), U8(0),
/* 52 E> */ B(Add), R(1), U8(1),
B(Star), R(1),
B(LdaSmi), I8(101),
B(Star), R(0),
/* 64 E> */ B(Add), R(1), U8(1),
/* 64 E> */ B(Add), R(1), U8(0),
B(Star), R(0),
/* 86 S> */ B(Return),
]
@ -102,11 +102,11 @@ bytecodes: [
B(Star), R(0),
/* 46 S> */ B(LdaSmi), I8(56),
B(Star), R(0),
/* 59 E> */ B(Sub), R(0), U8(0),
/* 59 E> */ B(Sub), R(0), U8(1),
B(Star), R(1),
B(LdaSmi), I8(57),
B(Star), R(0),
/* 63 E> */ B(Add), R(1), U8(1),
/* 63 E> */ B(Add), R(1), U8(0),
B(Star), R(0),
/* 75 S> */ B(Inc), U8(2),
B(Star), R(0),
@ -133,7 +133,7 @@ bytecodes: [
/* 54 S> */ B(LdaSmi), I8(1),
B(Mov), R(0), R(2),
B(Star), R(0),
/* 56 E> */ B(Add), R(2), U8(0),
/* 56 E> */ B(Add), R(2), U8(2),
B(Star), R(2),
B(LdaSmi), I8(2),
B(Star), R(0),
@ -141,7 +141,7 @@ bytecodes: [
B(Star), R(2),
B(LdaSmi), I8(3),
B(Star), R(0),
/* 76 E> */ B(Add), R(2), U8(2),
/* 76 E> */ B(Add), R(2), U8(0),
B(Star), R(1),
/* 96 S> */ B(Return),
]
@ -166,7 +166,7 @@ bytecodes: [
/* 54 S> */ B(LdaSmi), I8(1),
B(Mov), R(0), R(1),
B(Star), R(0),
/* 56 E> */ B(Add), R(1), U8(0),
/* 56 E> */ B(Add), R(1), U8(2),
B(Star), R(1),
B(LdaSmi), I8(2),
B(Star), R(0),
@ -174,7 +174,7 @@ bytecodes: [
B(Star), R(1),
B(LdaSmi), I8(3),
B(Star), R(0),
/* 76 E> */ B(Add), R(1), U8(2),
/* 76 E> */ B(Add), R(1), U8(0),
B(Star), R(0),
/* 96 S> */ B(Return),
]
@ -200,30 +200,30 @@ bytecodes: [
/* 54 S> */ B(LdaSmi), I8(1),
B(Mov), R(0), R(2),
B(Star), R(0),
/* 63 E> */ B(Add), R(2), U8(0),
/* 63 E> */ B(Add), R(2), U8(5),
B(Star), R(2),
B(Ldar), R(0),
/* 78 E> */ B(AddSmi), I8(1), U8(1),
/* 78 E> */ B(AddSmi), I8(1), U8(7),
B(Star), R(3),
B(LdaSmi), I8(2),
B(Star), R(1),
/* 83 E> */ B(Mul), R(3), U8(2),
/* 73 E> */ B(Add), R(2), U8(3),
/* 83 E> */ B(Mul), R(3), U8(6),
/* 73 E> */ B(Add), R(2), U8(4),
B(Star), R(2),
B(LdaSmi), I8(3),
B(Star), R(1),
/* 93 E> */ B(Add), R(2), U8(4),
/* 93 E> */ B(Add), R(2), U8(3),
B(Star), R(2),
B(LdaSmi), I8(4),
B(Star), R(0),
/* 103 E> */ B(Add), R(2), U8(5),
/* 103 E> */ B(Add), R(2), U8(2),
B(Star), R(2),
B(LdaSmi), I8(5),
B(Star), R(1),
/* 113 E> */ B(Add), R(2), U8(6),
/* 113 E> */ B(Add), R(2), U8(1),
B(Star), R(2),
B(Ldar), R(1),
/* 123 E> */ B(Add), R(2), U8(7),
/* 123 E> */ B(Add), R(2), U8(0),
/* 127 S> */ B(Return),
]
constant pool: [
@ -246,20 +246,20 @@ bytecodes: [
/* 46 S> */ B(LdaSmi), I8(1),
B(Star), R(1),
B(Ldar), R(0),
/* 55 E> */ B(Add), R(1), U8(0),
/* 55 E> */ B(Add), R(1), U8(2),
B(Star), R(1),
B(Ldar), R(0),
B(ToNumeric), U8(1),
B(ToNumeric), U8(3),
B(Star), R(2),
B(Inc), U8(1),
B(Star), R(0),
B(Ldar), R(2),
/* 59 E> */ B(Add), R(1), U8(2),
B(Star), R(1),
B(Ldar), R(0),
B(Inc), U8(3),
B(Star), R(0),
/* 67 E> */ B(Add), R(1), U8(4),
B(Ldar), R(2),
/* 59 E> */ B(Add), R(1), U8(1),
B(Star), R(1),
B(Ldar), R(0),
B(Inc), U8(4),
B(Star), R(0),
/* 67 E> */ B(Add), R(1), U8(0),
/* 75 S> */ B(Return),
]
constant pool: [

View File

@ -345,9 +345,9 @@ bytecodes: [
/* 36 E> */ B(TestEqualStrictNoFeedback), R(10),
B(JumpIfTrue), U8(4),
B(Abort), U8(42),
/* 31 S> */ B(LdaNamedProperty), R(4), U8(8), U8(7),
/* 31 S> */ B(LdaNamedProperty), R(4), U8(8), U8(5),
B(Star), R(19),
B(CallProperty0), R(19), R(4), U8(5),
B(CallProperty0), R(19), R(4), U8(7),
B(Star), R(5),
/* 31 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(5), U8(1),
B(ToBooleanLogicalNot),
@ -422,7 +422,7 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(93),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(6), U8(18),
B(TestEqualStrict), R(6), U8(17),
B(JumpIfFalse), U8(61),
B(Ldar), R(8),
B(TestTypeOf), U8(5),
@ -615,20 +615,20 @@ bytecodes: [
B(Star), R(2),
B(Mov), R(6), R(3),
B(JumpConstant), U8(22),
/* 49 S> */ B(LdaGlobal), U8(7), U8(2),
/* 49 S> */ B(LdaGlobal), U8(7), U8(0),
B(Star), R(12),
/* 56 E> */ B(CallUndefinedReceiver0), R(12), U8(0),
/* 56 E> */ B(CallUndefinedReceiver0), R(12), U8(2),
B(Star), R(10),
B(LdaNamedProperty), R(10), U8(8), U8(26),
B(LdaNamedProperty), R(10), U8(8), U8(4),
B(JumpIfUndefined), U8(17),
B(JumpIfNull), U8(15),
B(Star), R(11),
B(CallProperty0), R(11), R(10), U8(28),
B(CallProperty0), R(11), R(10), U8(6),
B(JumpIfJSReceiver), U8(23),
B(CallRuntime), U16(Runtime::kThrowSymbolAsyncIteratorInvalid), R(0), U8(0),
B(LdaNamedProperty), R(10), U8(9), U8(4),
B(LdaNamedProperty), R(10), U8(9), U8(8),
B(Star), R(11),
B(CallProperty0), R(11), R(10), U8(16),
B(CallProperty0), R(11), R(10), U8(10),
B(Star), R(11),
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(11), U8(1),
B(Star), R(8),
@ -644,11 +644,11 @@ bytecodes: [
B(Abort), U8(42),
B(Ldar), R(7),
B(SwitchOnSmiNoFeedback), U8(13), U8(2), I8(1),
B(LdaNamedProperty), R(8), U8(15), U8(8),
B(LdaNamedProperty), R(8), U8(15), U8(12),
B(Star), R(12),
B(CallProperty1), R(12), R(8), R(9), U8(22),
B(CallProperty1), R(12), R(8), R(9), U8(14),
B(Jump), U8(118),
B(LdaNamedProperty), R(8), U8(16), U8(6),
B(LdaNamedProperty), R(8), U8(16), U8(16),
B(JumpIfUndefined), U8(13),
B(JumpIfNull), U8(11),
B(Star), R(12),
@ -658,17 +658,17 @@ bytecodes: [
B(Star), R(2),
B(Mov), R(9), R(3),
B(JumpConstant), U8(23),
B(LdaNamedProperty), R(8), U8(17), U8(10),
B(LdaNamedProperty), R(8), U8(17), U8(20),
B(JumpIfUndefined), U8(13),
B(JumpIfNull), U8(11),
B(Star), R(12),
B(CallProperty1), R(12), R(8), R(9), U8(24),
B(CallProperty1), R(12), R(8), R(9), U8(22),
B(Jump), U8(76),
B(LdaNamedProperty), R(8), U8(16), U8(6),
B(LdaNamedProperty), R(8), U8(16), U8(24),
B(Star), R(12),
B(JumpIfUndefined), U8(63),
B(JumpIfNull), U8(61),
B(CallProperty0), R(12), R(8), U8(20),
B(CallProperty0), R(12), R(8), U8(26),
B(Star), R(14),
B(Mov), R(0), R(13),
B(CallJSRuntime), U8(%async_generator_await_uncaught), R(13), U8(2),
@ -712,9 +712,9 @@ bytecodes: [
B(Mov), R(12), R(6),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(LdaNamedProperty), R(6), U8(18), U8(12),
B(LdaNamedProperty), R(6), U8(18), U8(28),
B(JumpIfToBooleanTrue), U8(47),
B(LdaNamedProperty), R(6), U8(19), U8(14),
B(LdaNamedProperty), R(6), U8(19), U8(30),
B(Star), R(15),
B(LdaFalse),
B(Star), R(16),
@ -730,7 +730,7 @@ bytecodes: [
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star), R(7),
B(JumpLoop), U8(252), I8(0),
B(LdaNamedProperty), R(6), U8(19), U8(14),
B(LdaNamedProperty), R(6), U8(19), U8(32),
B(Star), R(8),
B(LdaSmi), I8(1),
B(TestEqualStrictNoFeedback), R(7),

View File

@ -489,15 +489,15 @@ bytecodes: [
B(Star), R(0),
/* 45 E> */ B(StackCheck),
/* 68 S> */ B(LdaSmi), I8(1),
/* 74 E> */ B(TestEqual), R(0), U8(1),
/* 74 E> */ B(TestEqual), R(0), U8(0),
B(JumpIfFalse), U8(4),
/* 80 S> */ B(Jump), U8(21),
/* 89 S> */ B(LdaSmi), I8(2),
/* 95 E> */ B(TestEqual), R(0), U8(2),
/* 95 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 101 S> */ B(Jump), U8(2),
/* 55 S> */ B(Ldar), R(0),
/* 59 E> */ B(AddSmi), I8(1), U8(0),
/* 59 E> */ B(AddSmi), I8(1), U8(2),
B(Star), R(0),
B(JumpLoop), U8(26), I8(0),
B(LdaUndefined),
@ -524,15 +524,15 @@ bytecodes: [
B(Star), R(0),
/* 34 E> */ B(StackCheck),
/* 66 S> */ B(LdaSmi), I8(1),
/* 72 E> */ B(TestEqual), R(0), U8(1),
/* 72 E> */ B(TestEqual), R(0), U8(0),
B(JumpIfFalse), U8(4),
/* 78 S> */ B(Jump), U8(21),
/* 87 S> */ B(LdaSmi), I8(2),
/* 93 E> */ B(TestEqual), R(0), U8(2),
/* 93 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 99 S> */ B(Jump), U8(2),
/* 53 S> */ B(Ldar), R(0),
/* 57 E> */ B(AddSmi), I8(1), U8(0),
/* 57 E> */ B(AddSmi), I8(1), U8(2),
B(Star), R(0),
B(JumpLoop), U8(26), I8(0),
B(LdaUndefined),
@ -565,11 +565,11 @@ bytecodes: [
B(JumpIfFalse), U8(22),
/* 45 E> */ B(StackCheck),
/* 85 S> */ B(Ldar), R(0),
/* 91 E> */ B(AddSmi), I8(1), U8(2),
/* 91 E> */ B(AddSmi), I8(1), U8(1),
B(Star), R(0),
/* 98 S> */ B(Jump), U8(2),
/* 72 S> */ B(Ldar), R(1),
/* 76 E> */ B(AddSmi), I8(1), U8(1),
/* 76 E> */ B(AddSmi), I8(1), U8(2),
B(Star), R(1),
B(JumpLoop), U8(24), I8(0),
B(LdaUndefined),
@ -601,10 +601,10 @@ bytecodes: [
B(JumpIfToBooleanFalse), U8(19),
/* 45 E> */ B(StackCheck),
/* 74 S> */ B(Ldar), R(0),
/* 80 E> */ B(MulSmi), I8(12), U8(1),
/* 80 E> */ B(MulSmi), I8(12), U8(0),
B(Star), R(0),
/* 67 S> */ B(Ldar), R(1),
B(Dec), U8(0),
B(Dec), U8(1),
B(Star), R(1),
B(JumpLoop), U8(18), I8(0),
/* 88 S> */ B(Ldar), R(0),
@ -660,14 +660,14 @@ bytecodes: [
B(Star), R(1),
/* 45 E> */ B(StackCheck),
/* 76 S> */ B(Ldar), R(0),
/* 82 E> */ B(AddSmi), I8(1), U8(1),
/* 82 E> */ B(AddSmi), I8(1), U8(0),
B(Star), R(0),
/* 89 S> */ B(LdaSmi), I8(20),
/* 95 E> */ B(TestEqual), R(0), U8(2),
/* 95 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 102 S> */ B(Jump), U8(11),
/* 69 S> */ B(Ldar), R(1),
B(Inc), U8(0),
B(Inc), U8(2),
B(Star), R(1),
B(JumpLoop), U8(23), I8(0),
/* 112 S> */ B(Ldar), R(0),

View File

@ -62,25 +62,25 @@ bytecodes: [
/* 106 S> */ B(LdaZero),
B(Star), R(2),
/* 111 S> */ B(LdaSmi), I8(3),
/* 111 E> */ B(TestLessThan), R(2), U8(2),
/* 111 E> */ B(TestLessThan), R(2), U8(1),
B(JumpIfFalse), U8(34),
/* 93 E> */ B(StackCheck),
/* 129 S> */ B(Ldar), R(0),
B(Inc), U8(4),
B(Inc), U8(2),
B(Star), R(0),
/* 142 S> */ B(Ldar), R(2),
/* 148 E> */ B(Add), R(1), U8(5),
/* 148 E> */ B(Add), R(1), U8(3),
B(Star), R(3),
B(LdaSmi), I8(12),
/* 152 E> */ B(TestEqual), R(3), U8(6),
/* 152 E> */ B(TestEqual), R(3), U8(4),
B(JumpIfFalse), U8(4),
/* 161 S> */ B(Jump), U8(20),
/* 118 S> */ B(Ldar), R(2),
B(Inc), U8(3),
B(Inc), U8(5),
B(Star), R(2),
B(JumpLoop), U8(36), I8(1),
/* 84 S> */ B(Ldar), R(1),
B(Inc), U8(1),
B(Inc), U8(6),
B(Star), R(1),
B(JumpLoop), U8(56), I8(0),
/* 188 S> */ B(Ldar), R(0),

View File

@ -14,13 +14,13 @@ parameter count: 1
bytecode array length: 25
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(LdaGlobal), U8(0), U8(2),
/* 34 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star), R(1),
/* 39 E> */ B(LdaNamedProperty), R(1), U8(1), U8(4),
/* 39 E> */ B(LdaNamedProperty), R(1), U8(1), U8(2),
B(Star), R(0),
B(CreateArrayLiteral), U8(2), U8(6), U8(37),
B(CreateArrayLiteral), U8(2), U8(4), U8(37),
B(Star), R(2),
/* 39 E> */ B(CallWithSpread), R(0), R(1), U8(2), U8(0),
/* 39 E> */ B(CallWithSpread), R(0), R(1), U8(2), U8(5),
B(LdaUndefined),
/* 58 S> */ B(Return),
]
@ -41,15 +41,15 @@ parameter count: 1
bytecode array length: 28
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(LdaGlobal), U8(0), U8(2),
/* 34 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star), R(1),
/* 39 E> */ B(LdaNamedProperty), R(1), U8(1), U8(4),
/* 39 E> */ B(LdaNamedProperty), R(1), U8(1), U8(2),
B(Star), R(0),
B(LdaZero),
B(Star), R(2),
B(CreateArrayLiteral), U8(2), U8(6), U8(37),
B(CreateArrayLiteral), U8(2), U8(4), U8(37),
B(Star), R(3),
/* 39 E> */ B(CallWithSpread), R(0), R(1), U8(3), U8(0),
/* 39 E> */ B(CallWithSpread), R(0), R(1), U8(3), U8(5),
B(LdaUndefined),
/* 61 S> */ B(Return),
]

View File

@ -17,9 +17,9 @@ parameter count: 1
bytecode array length: 10
bytecodes: [
/* 27 E> */ B(StackCheck),
/* 32 S> */ B(LdaGlobal), U8(0), U8(2),
/* 32 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star), R(0),
/* 39 E> */ B(CallUndefinedReceiver0), R(0), U8(0),
/* 39 E> */ B(CallUndefinedReceiver0), R(0), U8(2),
/* 43 S> */ B(Return),
]
constant pool: [
@ -39,7 +39,7 @@ parameter count: 1
bytecode array length: 24
bytecodes: [
/* 34 E> */ B(StackCheck),
/* 39 S> */ B(LdaGlobal), U8(0), U8(2),
/* 39 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star), R(0),
B(LdaSmi), I8(1),
B(Star), R(1),
@ -47,7 +47,7 @@ bytecodes: [
B(Star), R(2),
B(LdaSmi), I8(3),
B(Star), R(3),
/* 46 E> */ B(CallUndefinedReceiver), R(0), R(1), U8(3), U8(0),
/* 46 E> */ B(CallUndefinedReceiver), R(0), R(1), U8(3), U8(2),
/* 57 S> */ B(Return),
]
constant pool: [

View File

@ -24,7 +24,7 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateClosure), U8(0), U8(0), U8(2),
/* 36 E> */ B(StaLookupSlot), U8(1), U8(0),
/* 52 S> */ B(LdaLookupGlobalSlot), U8(2), U8(3), U8(1),
/* 52 S> */ B(LdaLookupGlobalSlot), U8(2), U8(1), U8(1),
B(Star), R(2),
B(LdaConstant), U8(3),
B(Star), R(3),
@ -39,10 +39,10 @@ bytecodes: [
B(Mov), R(closure), R(6),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(4), U8(6),
B(Star), R(2),
/* 52 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(1),
/* 62 S> */ B(LdaLookupGlobalSlot), U8(1), U8(7), U8(1),
/* 52 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(3),
/* 62 S> */ B(LdaLookupGlobalSlot), U8(1), U8(5), U8(1),
B(Star), R(2),
/* 69 E> */ B(CallUndefinedReceiver0), R(2), U8(5),
/* 69 E> */ B(CallUndefinedReceiver0), R(2), U8(7),
/* 73 S> */ B(Return),
]
constant pool: [

View File

@ -17,9 +17,9 @@ parameter count: 1
bytecode array length: 12
bytecodes: [
/* 45 E> */ B(StackCheck),
/* 50 S> */ B(LdaGlobal), U8(0), U8(2),
/* 50 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star), R(0),
/* 57 E> */ B(Construct), R(0), R(0), U8(0), U8(0),
/* 57 E> */ B(Construct), R(0), R(0), U8(0), U8(2),
/* 67 S> */ B(Return),
]
constant pool: [
@ -39,12 +39,12 @@ parameter count: 1
bytecode array length: 18
bytecodes: [
/* 58 E> */ B(StackCheck),
/* 63 S> */ B(LdaGlobal), U8(0), U8(2),
/* 63 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star), R(0),
B(LdaSmi), I8(3),
B(Star), R(1),
B(Ldar), R(0),
/* 70 E> */ B(Construct), R(0), R(1), U8(1), U8(0),
/* 70 E> */ B(Construct), R(0), R(1), U8(1), U8(2),
/* 81 S> */ B(Return),
]
constant pool: [
@ -69,7 +69,7 @@ parameter count: 1
bytecode array length: 26
bytecodes: [
/* 100 E> */ B(StackCheck),
/* 105 S> */ B(LdaGlobal), U8(0), U8(2),
/* 105 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star), R(0),
B(LdaSmi), I8(3),
B(Star), R(1),
@ -78,7 +78,7 @@ bytecodes: [
B(LdaSmi), I8(5),
B(Star), R(3),
B(Ldar), R(0),
/* 112 E> */ B(Construct), R(0), R(1), U8(3), U8(0),
/* 112 E> */ B(Construct), R(0), R(1), U8(3), U8(2),
/* 129 S> */ B(Return),
]
constant pool: [

View File

@ -27,15 +27,15 @@ bytecodes: [
B(Mov), R(closure), R(0),
/* 99 E> */ B(StackCheck),
/* 104 S> */ B(LdaConstant), U8(0),
/* 111 E> */ B(LdaKeyedProperty), R(closure), U8(2),
/* 111 E> */ B(LdaKeyedProperty), R(closure), U8(1),
B(Star), R(4),
B(LdaConstant), U8(1),
B(Star), R(5),
B(Mov), R(this), R(3),
/* 117 E> */ B(CallRuntime), U16(Runtime::kLoadFromSuper), R(3), U8(3),
B(Star), R(1),
/* 117 E> */ B(CallAnyReceiver), R(1), R(this), U8(1), U8(0),
/* 126 E> */ B(AddSmi), I8(1), U8(6),
/* 117 E> */ B(CallAnyReceiver), R(1), R(this), U8(1), U8(3),
/* 126 E> */ B(AddSmi), I8(1), U8(0),
/* 130 S> */ B(Return),
]
constant pool: [

View File

@ -135,7 +135,7 @@ bytecodes: [
B(LdaSmi), I8(2),
B(Star), R(8),
B(Ldar), R(7),
B(StaDataPropertyInLiteral), R(4), R(6), U8(3), U8(3),
B(StaDataPropertyInLiteral), R(4), R(6), U8(3), U8(2),
B(LdaImmutableCurrentContextSlot), U8(5),
/* 106 E> */ B(ToName), R(6),
B(LdaConstant), U8(4),
@ -143,7 +143,7 @@ bytecodes: [
B(Mov), R(3), R(5),
B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0),
B(CreateClosure), U8(5), U8(2), U8(2),
B(CreateClosure), U8(5), U8(4), U8(2),
B(StaDataPropertyInLiteral), R(5), R(6), U8(3), U8(5),
B(CallRuntime), U16(Runtime::kInstallClassNameAccessorWithCheck), R(3), U8(1),
B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1),

View File

@ -276,7 +276,7 @@ bytecodes: [
B(JumpIfUndefined), U8(12),
/* 64 E> */ B(StackCheck),
/* 92 S> */ B(Ldar), R(1),
B(Inc), U8(3),
B(Inc), U8(0),
B(Star), R(1),
B(JumpLoop), U8(11), I8(0),
B(LdaUndefined),

View File

@ -82,9 +82,9 @@ bytecodes: [
B(CreateFunctionContext), U8(1),
B(PushContext), R(0),
/* 30 E> */ B(StackCheck),
/* 41 S> */ B(CreateClosure), U8(0), U8(2), U8(2),
/* 41 S> */ B(CreateClosure), U8(0), U8(0), U8(2),
B(Star), R(1),
/* 64 E> */ B(CallUndefinedReceiver0), R(1), U8(0),
/* 64 E> */ B(CallUndefinedReceiver0), R(1), U8(1),
/* 68 S> */ B(LdaCurrentContextSlot), U8(4),
/* 77 S> */ B(Return),
]
@ -898,9 +898,9 @@ bytecodes: [
/* 3421 E> */ B(StaCurrentContextSlot), U8(254),
/* 3435 S> */ B(LdaZero),
/* 3435 E> */ B(StaCurrentContextSlot), U8(255),
/* 3438 S> */ B(LdaGlobal), U8(0), U8(2),
/* 3438 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star), R(2),
/* 3438 E> */ B(CallUndefinedReceiver0), R(2), U8(0),
/* 3438 E> */ B(CallUndefinedReceiver0), R(2), U8(2),
/* 3454 S> */ B(LdaSmi), I8(100),
/* 3454 E> */ B(Wide), B(StaCurrentContextSlot), U16(256),
/* 3459 S> */ B(Wide), B(LdaCurrentContextSlot), U16(256),

View File

@ -103,10 +103,10 @@ bytecodes: [
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41), R(1),
B(Mov), R(1), R(0),
/* 54 S> */ B(LdaNamedProperty), R(1), U8(1), U8(1),
B(ToNumeric), U8(5),
B(ToNumeric), U8(3),
B(Star), R(2),
B(Inc), U8(5),
/* 66 E> */ B(StaNamedProperty), R(1), U8(1), U8(3),
B(Inc), U8(3),
/* 66 E> */ B(StaNamedProperty), R(1), U8(1), U8(4),
B(Ldar), R(2),
/* 69 S> */ B(Return),
]
@ -129,8 +129,8 @@ bytecodes: [
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41), R(1),
B(Mov), R(1), R(0),
/* 54 S> */ B(LdaNamedProperty), R(1), U8(1), U8(1),
B(Dec), U8(5),
/* 65 E> */ B(StaNamedProperty), R(1), U8(1), U8(3),
B(Dec), U8(3),
/* 65 E> */ B(StaNamedProperty), R(1), U8(1), U8(4),
/* 69 S> */ B(Return),
]
constant pool: [
@ -155,10 +155,10 @@ bytecodes: [
B(Mov), R(2), R(1),
/* 72 S> */ B(Ldar), R(0),
/* 81 E> */ B(LdaKeyedProperty), R(2), U8(1),
B(ToNumeric), U8(5),
B(ToNumeric), U8(3),
B(Star), R(4),
B(Dec), U8(5),
/* 86 E> */ B(StaKeyedProperty), R(2), R(0), U8(3),
B(Dec), U8(3),
/* 86 E> */ B(StaKeyedProperty), R(2), R(0), U8(4),
B(Ldar), R(4),
/* 89 S> */ B(Return),
]
@ -184,8 +184,8 @@ bytecodes: [
B(Mov), R(2), R(1),
/* 72 S> */ B(Ldar), R(0),
/* 83 E> */ B(LdaKeyedProperty), R(2), U8(1),
B(Inc), U8(5),
/* 87 E> */ B(StaKeyedProperty), R(2), R(0), U8(3),
B(Inc), U8(3),
/* 87 E> */ B(StaKeyedProperty), R(2), R(0), U8(4),
/* 89 S> */ B(Return),
]
constant pool: [

View File

@ -88,11 +88,11 @@ bytecodes: [
B(Mov), R(arg0), R(1),
B(Mov), R(0), R(2),
/* 29 S> */ B(LdaZero),
/* 44 E> */ B(LdaKeyedProperty), R(2), U8(0),
/* 44 E> */ B(LdaKeyedProperty), R(2), U8(1),
B(Star), R(4),
B(LdaZero),
/* 59 E> */ B(LdaKeyedProperty), R(3), U8(2),
/* 48 E> */ B(Add), R(4), U8(4),
/* 59 E> */ B(LdaKeyedProperty), R(3), U8(3),
/* 48 E> */ B(Add), R(4), U8(0),
/* 63 S> */ B(Return),
]
constant pool: [

View File

@ -22,7 +22,7 @@ bytecodes: [
B(Ldar), R(0),
B(StaCurrentContextSlot), U8(5),
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(LdaLookupGlobalSlot), U8(0), U8(2), U8(1),
/* 34 S> */ B(LdaLookupGlobalSlot), U8(0), U8(0), U8(1),
B(Star), R(2),
B(LdaConstant), U8(1),
B(Star), R(3),
@ -37,7 +37,7 @@ bytecodes: [
B(Mov), R(closure), R(6),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(4), U8(6),
B(Star), R(2),
/* 41 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(0),
/* 41 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(2),
/* 52 S> */ B(Return),
]
constant pool: [

View File

@ -43,16 +43,16 @@ bytecodes: [
B(Mov), R(context), R(19),
/* 43 S> */ B(CreateArrayLiteral), U8(3), U8(0), U8(37),
B(Star), R(20),
B(LdaNamedProperty), R(20), U8(4), U8(5),
B(LdaNamedProperty), R(20), U8(4), U8(1),
B(JumpIfUndefined), U8(17),
B(JumpIfNull), U8(15),
B(Star), R(21),
B(CallProperty0), R(21), R(20), U8(7),
B(CallProperty0), R(21), R(20), U8(3),
B(JumpIfJSReceiver), U8(23),
B(CallRuntime), U16(Runtime::kThrowSymbolAsyncIteratorInvalid), R(0), U8(0),
B(LdaNamedProperty), R(20), U8(5), U8(1),
B(LdaNamedProperty), R(20), U8(5), U8(5),
B(Star), R(21),
B(CallProperty0), R(21), R(20), U8(3),
B(CallProperty0), R(21), R(20), U8(7),
B(Star), R(21),
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(21), U8(1),
B(Star), R(4),
@ -62,9 +62,9 @@ bytecodes: [
/* 43 E> */ B(TestEqualStrictNoFeedback), R(11),
B(JumpIfTrue), U8(4),
B(Abort), U8(42),
/* 40 S> */ B(LdaNamedProperty), R(4), U8(7), U8(11),
/* 40 S> */ B(LdaNamedProperty), R(4), U8(7), U8(9),
B(Star), R(20),
B(CallProperty0), R(20), R(4), U8(9),
B(CallProperty0), R(20), R(4), U8(11),
B(Star), R(21),
B(Mov), R(2), R(20),
B(Mov), R(10), R(22),
@ -137,7 +137,7 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(188),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(6), U8(22),
B(TestEqualStrict), R(6), U8(21),
B(JumpIfFalse), U8(109),
B(Ldar), R(8),
B(TestTypeOf), U8(5),
@ -331,16 +331,16 @@ bytecodes: [
B(Mov), R(context), R(19),
/* 43 S> */ B(CreateArrayLiteral), U8(3), U8(0), U8(37),
B(Star), R(20),
B(LdaNamedProperty), R(20), U8(4), U8(5),
B(LdaNamedProperty), R(20), U8(4), U8(1),
B(JumpIfUndefined), U8(17),
B(JumpIfNull), U8(15),
B(Star), R(21),
B(CallProperty0), R(21), R(20), U8(7),
B(CallProperty0), R(21), R(20), U8(3),
B(JumpIfJSReceiver), U8(23),
B(CallRuntime), U16(Runtime::kThrowSymbolAsyncIteratorInvalid), R(0), U8(0),
B(LdaNamedProperty), R(20), U8(5), U8(1),
B(LdaNamedProperty), R(20), U8(5), U8(5),
B(Star), R(21),
B(CallProperty0), R(21), R(20), U8(3),
B(CallProperty0), R(21), R(20), U8(7),
B(Star), R(21),
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(21), U8(1),
B(Star), R(4),
@ -350,9 +350,9 @@ bytecodes: [
/* 43 E> */ B(TestEqualStrictNoFeedback), R(11),
B(JumpIfTrue), U8(4),
B(Abort), U8(42),
/* 40 S> */ B(LdaNamedProperty), R(4), U8(7), U8(11),
/* 40 S> */ B(LdaNamedProperty), R(4), U8(7), U8(9),
B(Star), R(20),
B(CallProperty0), R(20), R(4), U8(9),
B(CallProperty0), R(20), R(4), U8(11),
B(Star), R(21),
B(Mov), R(2), R(20),
B(Mov), R(10), R(22),
@ -426,7 +426,7 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(188),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(6), U8(22),
B(TestEqualStrict), R(6), U8(21),
B(JumpIfFalse), U8(109),
B(Ldar), R(8),
B(TestTypeOf), U8(5),
@ -635,16 +635,16 @@ bytecodes: [
B(Mov), R(context), R(19),
/* 43 S> */ B(CreateArrayLiteral), U8(3), U8(0), U8(37),
B(Star), R(20),
B(LdaNamedProperty), R(20), U8(4), U8(5),
B(LdaNamedProperty), R(20), U8(4), U8(1),
B(JumpIfUndefined), U8(17),
B(JumpIfNull), U8(15),
B(Star), R(21),
B(CallProperty0), R(21), R(20), U8(7),
B(CallProperty0), R(21), R(20), U8(3),
B(JumpIfJSReceiver), U8(23),
B(CallRuntime), U16(Runtime::kThrowSymbolAsyncIteratorInvalid), R(0), U8(0),
B(LdaNamedProperty), R(20), U8(5), U8(1),
B(LdaNamedProperty), R(20), U8(5), U8(5),
B(Star), R(21),
B(CallProperty0), R(21), R(20), U8(3),
B(CallProperty0), R(21), R(20), U8(7),
B(Star), R(21),
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(21), U8(1),
B(Star), R(4),
@ -654,9 +654,9 @@ bytecodes: [
/* 43 E> */ B(TestEqualStrictNoFeedback), R(11),
B(JumpIfTrue), U8(4),
B(Abort), U8(42),
/* 40 S> */ B(LdaNamedProperty), R(4), U8(7), U8(11),
/* 40 S> */ B(LdaNamedProperty), R(4), U8(7), U8(9),
B(Star), R(20),
B(CallProperty0), R(20), R(4), U8(9),
B(CallProperty0), R(20), R(4), U8(11),
B(Star), R(21),
B(Mov), R(2), R(20),
B(Mov), R(10), R(22),
@ -737,7 +737,7 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(188),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(6), U8(24),
B(TestEqualStrict), R(6), U8(23),
B(JumpIfFalse), U8(109),
B(Ldar), R(8),
B(TestTypeOf), U8(5),
@ -926,9 +926,9 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
B(Star), R(2),
/* 59 S> */ B(LdaNamedProperty), R(2), U8(3), U8(8),
/* 59 S> */ B(LdaNamedProperty), R(2), U8(3), U8(6),
B(Star), R(17),
B(CallProperty0), R(17), R(2), U8(6),
B(CallProperty0), R(17), R(2), U8(8),
B(Star), R(3),
/* 59 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(3), U8(1),
B(ToBooleanLogicalNot),
@ -985,7 +985,7 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(93),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(4), U8(23),
B(TestEqualStrict), R(4), U8(22),
B(JumpIfFalse), U8(61),
B(Ldar), R(6),
B(TestTypeOf), U8(5),

View File

@ -107,23 +107,23 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
B(Star), R(0),
/* 59 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
/* 59 S> */ B(CreateArrayLiteral), U8(0), U8(1), U8(37),
B(JumpIfUndefined), U8(48),
B(JumpIfNull), U8(46),
B(ToObject), R(3),
B(ForInEnumerate), R(3),
B(ForInPrepare), R(4), U8(2),
B(ForInPrepare), R(4), U8(0),
B(LdaZero),
B(Star), R(7),
/* 54 S> */ B(ForInContinue), R(7), R(6),
B(JumpIfFalse), U8(31),
B(ForInNext), R(3), R(7), R(4), U8(2),
B(ForInNext), R(3), R(7), R(4), U8(0),
B(JumpIfUndefined), U8(17),
B(Star), R(1),
/* 45 E> */ B(StackCheck),
B(Star), R(2),
/* 70 S> */ B(Ldar), R(1),
/* 75 E> */ B(Add), R(0), U8(1),
/* 75 E> */ B(Add), R(0), U8(2),
B(Mov), R(0), R(8),
B(Star), R(0),
/* 72 E> */ B(ForInStep), R(7),
@ -153,32 +153,32 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41), R(1),
B(Mov), R(1), R(0),
/* 77 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(37),
/* 77 S> */ B(CreateArrayLiteral), U8(1), U8(2), U8(37),
B(JumpIfUndefined), U8(72),
B(JumpIfNull), U8(70),
B(ToObject), R(1),
B(ForInEnumerate), R(1),
B(ForInPrepare), R(2), U8(12),
B(ForInPrepare), R(2), U8(1),
B(LdaZero),
B(Star), R(5),
/* 68 S> */ B(ForInContinue), R(5), R(4),
B(JumpIfFalse), U8(55),
B(ForInNext), R(1), R(5), R(2), U8(12),
B(ForInNext), R(1), R(5), R(2), U8(1),
B(JumpIfUndefined), U8(41),
B(Star), R(6),
B(Ldar), R(6),
/* 67 E> */ B(StaNamedProperty), R(0), U8(2), U8(10),
/* 67 E> */ B(StaNamedProperty), R(0), U8(2), U8(3),
/* 62 E> */ B(StackCheck),
/* 100 S> */ B(LdaNamedProperty), R(0), U8(2), U8(4),
/* 100 S> */ B(LdaNamedProperty), R(0), U8(2), U8(5),
B(Star), R(6),
B(LdaSmi), I8(10),
/* 106 E> */ B(TestEqual), R(6), U8(6),
/* 106 E> */ B(TestEqual), R(6), U8(7),
B(JumpIfFalse), U8(4),
/* 113 S> */ B(Jump), U8(17),
/* 130 S> */ B(LdaNamedProperty), R(0), U8(2), U8(7),
/* 130 S> */ B(LdaNamedProperty), R(0), U8(2), U8(8),
B(Star), R(6),
B(LdaSmi), I8(20),
/* 136 E> */ B(TestEqual), R(6), U8(9),
/* 136 E> */ B(TestEqual), R(6), U8(10),
B(JumpIfFalse), U8(4),
/* 143 S> */ B(Jump), U8(9),
B(ForInStep), R(5),
@ -207,26 +207,26 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
B(Star), R(0),
/* 72 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(37),
/* 72 S> */ B(CreateArrayLiteral), U8(1), U8(2), U8(37),
B(JumpIfUndefined), U8(51),
B(JumpIfNull), U8(49),
B(ToObject), R(1),
B(ForInEnumerate), R(1),
B(ForInPrepare), R(2), U8(8),
B(ForInPrepare), R(2), U8(1),
B(LdaZero),
B(Star), R(5),
/* 65 S> */ B(ForInContinue), R(5), R(4),
B(JumpIfFalse), U8(34),
B(ForInNext), R(1), R(5), R(2), U8(8),
B(ForInNext), R(1), R(5), R(2), U8(1),
B(JumpIfUndefined), U8(20),
B(Star), R(6),
B(LdaZero),
B(Star), R(8),
B(Ldar), R(6),
/* 64 E> */ B(StaKeyedProperty), R(0), R(8), U8(6),
/* 64 E> */ B(StaKeyedProperty), R(0), R(8), U8(3),
/* 59 E> */ B(StackCheck),
/* 83 S> */ B(LdaSmi), I8(3),
/* 91 E> */ B(LdaKeyedProperty), R(0), U8(4),
/* 91 E> */ B(LdaKeyedProperty), R(0), U8(5),
/* 95 S> */ B(Return),
B(ForInStep), R(5),
B(Star), R(5),

View File

@ -26,9 +26,9 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
B(Star), R(2),
/* 43 S> */ B(LdaNamedProperty), R(2), U8(2), U8(7),
/* 43 S> */ B(LdaNamedProperty), R(2), U8(2), U8(5),
B(Star), R(12),
B(CallProperty0), R(12), R(2), U8(5),
B(CallProperty0), R(12), R(2), U8(7),
B(Star), R(3),
/* 43 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(3), U8(1),
B(ToBooleanLogicalNot),
@ -80,7 +80,7 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(93),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(4), U8(18),
B(TestEqualStrict), R(4), U8(17),
B(JumpIfFalse), U8(61),
B(Ldar), R(6),
B(TestTypeOf), U8(5),
@ -166,9 +166,9 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
B(Star), R(3),
/* 63 S> */ B(LdaNamedProperty), R(3), U8(2), U8(6),
/* 63 S> */ B(LdaNamedProperty), R(3), U8(2), U8(4),
B(Star), R(13),
B(CallProperty0), R(13), R(3), U8(4),
B(CallProperty0), R(13), R(3), U8(6),
B(Star), R(4),
/* 63 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(4), U8(1),
B(ToBooleanLogicalNot),
@ -221,7 +221,7 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(93),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(5), U8(17),
B(TestEqualStrict), R(5), U8(16),
B(JumpIfFalse), U8(61),
B(Ldar), R(7),
B(TestTypeOf), U8(5),
@ -312,9 +312,9 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
B(Star), R(2),
/* 43 S> */ B(LdaNamedProperty), R(2), U8(2), U8(7),
/* 43 S> */ B(LdaNamedProperty), R(2), U8(2), U8(5),
B(Star), R(12),
B(CallProperty0), R(12), R(2), U8(5),
B(CallProperty0), R(12), R(2), U8(7),
B(Star), R(3),
/* 43 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(3), U8(1),
B(ToBooleanLogicalNot),
@ -374,7 +374,7 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(93),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(4), U8(20),
B(TestEqualStrict), R(4), U8(19),
B(JumpIfFalse), U8(61),
B(Ldar), R(6),
B(TestTypeOf), U8(5),
@ -461,9 +461,9 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
B(Star), R(1),
/* 68 S> */ B(LdaNamedProperty), R(1), U8(3), U8(8),
/* 68 S> */ B(LdaNamedProperty), R(1), U8(3), U8(6),
B(Star), R(11),
B(CallProperty0), R(11), R(1), U8(6),
B(CallProperty0), R(11), R(1), U8(8),
B(Star), R(2),
/* 68 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(2), U8(1),
B(ToBooleanLogicalNot),
@ -517,7 +517,7 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(93),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(3), U8(23),
B(TestEqualStrict), R(3), U8(22),
B(JumpIfFalse), U8(61),
B(Ldar), R(5),
B(TestTypeOf), U8(5),

View File

@ -29,9 +29,9 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
B(Star), R(4),
/* 29 S> */ B(LdaNamedProperty), R(4), U8(1), U8(6),
/* 29 S> */ B(LdaNamedProperty), R(4), U8(1), U8(4),
B(Star), R(14),
B(CallProperty0), R(14), R(4), U8(4),
B(CallProperty0), R(14), R(4), U8(6),
B(Star), R(5),
/* 29 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(5), U8(1),
B(ToBooleanLogicalNot),
@ -84,7 +84,7 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(93),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(6), U8(17),
B(TestEqualStrict), R(6), U8(16),
B(JumpIfFalse), U8(61),
B(Ldar), R(8),
B(TestTypeOf), U8(5),
@ -185,9 +185,9 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
B(Star), R(1),
/* 29 S> */ B(LdaNamedProperty), R(1), U8(2), U8(6),
/* 29 S> */ B(LdaNamedProperty), R(1), U8(2), U8(4),
B(Star), R(14),
B(CallProperty0), R(14), R(1), U8(4),
B(CallProperty0), R(14), R(1), U8(6),
B(Star), R(2),
/* 29 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(2), U8(1),
B(ToBooleanLogicalNot),
@ -208,7 +208,7 @@ bytecodes: [
B(StaCurrentContextSlot), U8(4),
B(Ldar), R(4),
B(StaCurrentContextSlot), U8(4),
/* 41 S> */ B(LdaLookupGlobalSlot), U8(6), U8(14), U8(1),
/* 41 S> */ B(LdaLookupGlobalSlot), U8(6), U8(12), U8(1),
B(Star), R(15),
B(LdaConstant), U8(7),
B(Star), R(16),
@ -223,7 +223,7 @@ bytecodes: [
B(Mov), R(closure), R(19),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(17), U8(6),
B(Star), R(15),
/* 41 E> */ B(CallUndefinedReceiver1), R(15), R(16), U8(12),
/* 41 E> */ B(CallUndefinedReceiver1), R(15), R(16), U8(14),
B(PopContext), R(14),
B(LdaZero),
B(Star), R(3),
@ -262,7 +262,7 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(93),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(3), U8(21),
B(TestEqualStrict), R(3), U8(20),
B(JumpIfFalse), U8(61),
B(Ldar), R(5),
B(TestTypeOf), U8(5),
@ -352,9 +352,9 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
B(Star), R(2),
/* 29 S> */ B(LdaNamedProperty), R(2), U8(1), U8(6),
/* 29 S> */ B(LdaNamedProperty), R(2), U8(1), U8(4),
B(Star), R(12),
B(CallProperty0), R(12), R(2), U8(4),
B(CallProperty0), R(12), R(2), U8(6),
B(Star), R(3),
/* 29 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(3), U8(1),
B(ToBooleanLogicalNot),
@ -375,9 +375,9 @@ bytecodes: [
B(StaCurrentContextSlot), U8(4),
B(Ldar), R(5),
B(StaCurrentContextSlot), U8(4),
/* 41 S> */ B(CreateClosure), U8(5), U8(14), U8(2),
/* 41 S> */ B(CreateClosure), U8(5), U8(12), U8(2),
B(Star), R(13),
/* 67 E> */ B(CallUndefinedReceiver0), R(13), U8(12),
/* 67 E> */ B(CallUndefinedReceiver0), R(13), U8(13),
B(PopContext), R(12),
B(LdaZero),
B(Star), R(4),
@ -416,7 +416,7 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(93),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(4), U8(20),
B(TestEqualStrict), R(4), U8(19),
B(JumpIfFalse), U8(61),
B(Ldar), R(6),
B(TestTypeOf), U8(5),
@ -503,9 +503,9 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
B(Star), R(7),
/* 36 S> */ B(LdaNamedProperty), R(7), U8(1), U8(6),
/* 36 S> */ B(LdaNamedProperty), R(7), U8(1), U8(4),
B(Star), R(17),
B(CallProperty0), R(17), R(7), U8(4),
B(CallProperty0), R(17), R(7), U8(6),
B(Star), R(8),
/* 36 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(8), U8(1),
B(ToBooleanLogicalNot),
@ -530,12 +530,12 @@ bytecodes: [
B(Star), R(18),
B(CallRuntime), U16(Runtime::kNewTypeError), R(17), U8(2),
/* 31 E> */ B(Throw),
/* 31 S> */ B(LdaNamedProperty), R(6), U8(4), U8(14),
/* 31 S> */ B(LdaNamedProperty), R(6), U8(4), U8(12),
B(Star), R(1),
/* 34 S> */ B(LdaNamedProperty), R(6), U8(5), U8(16),
/* 34 S> */ B(LdaNamedProperty), R(6), U8(5), U8(14),
B(Star), R(2),
/* 56 S> */ B(Ldar), R(2),
/* 58 E> */ B(Add), R(1), U8(18),
/* 58 E> */ B(Add), R(1), U8(16),
B(Star), R(0),
B(LdaZero),
B(Star), R(9),
@ -547,7 +547,7 @@ bytecodes: [
B(PushContext), R(17),
B(Star), R(16),
B(LdaSmi), I8(2),
B(TestEqualStrict), R(9), U8(19),
B(TestEqualStrict), R(9), U8(17),
B(JumpIfFalse), U8(6),
B(LdaSmi), I8(1),
B(Star), R(9),
@ -566,15 +566,15 @@ bytecodes: [
B(SetPendingMessage),
B(Star), R(15),
B(LdaZero),
B(TestEqualStrict), R(9), U8(20),
B(TestEqualStrict), R(9), U8(18),
B(JumpIfTrue), U8(104),
B(LdaNamedProperty), R(7), U8(8), U8(21),
B(LdaNamedProperty), R(7), U8(8), U8(19),
B(Star), R(11),
B(TestUndetectable),
B(JumpIfFalse), U8(4),
B(Jump), U8(93),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(9), U8(24),
B(TestEqualStrict), R(9), U8(21),
B(JumpIfFalse), U8(61),
B(Ldar), R(11),
B(TestTypeOf), U8(5),
@ -693,9 +693,9 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
B(Star), R(5),
/* 30 S> */ B(LdaNamedProperty), R(5), U8(4), U8(6),
/* 30 S> */ B(LdaNamedProperty), R(5), U8(4), U8(4),
B(Star), R(17),
B(CallProperty0), R(17), R(5), U8(4),
B(CallProperty0), R(17), R(5), U8(6),
B(Star), R(6),
/* 30 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(6), U8(1),
B(ToBooleanLogicalNot),
@ -748,7 +748,7 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(93),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(7), U8(17),
B(TestEqualStrict), R(7), U8(16),
B(JumpIfFalse), U8(61),
B(Ldar), R(9),
B(TestTypeOf), U8(5),
@ -874,9 +874,9 @@ bytecodes: [
/* 35 E> */ B(TestEqualStrictNoFeedback), R(10),
B(JumpIfTrue), U8(4),
B(Abort), U8(42),
/* 30 S> */ B(LdaNamedProperty), R(4), U8(6), U8(6),
/* 30 S> */ B(LdaNamedProperty), R(4), U8(6), U8(4),
B(Star), R(16),
B(CallProperty0), R(16), R(4), U8(4),
B(CallProperty0), R(16), R(4), U8(6),
B(Star), R(5),
/* 30 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(5), U8(1),
B(ToBooleanLogicalNot),
@ -947,7 +947,7 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(93),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(6), U8(17),
B(TestEqualStrict), R(6), U8(16),
B(JumpIfFalse), U8(61),
B(Ldar), R(8),
B(TestTypeOf), U8(5),
@ -1052,9 +1052,9 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
B(Star), R(5),
/* 35 S> */ B(LdaNamedProperty), R(5), U8(1), U8(6),
/* 35 S> */ B(LdaNamedProperty), R(5), U8(1), U8(4),
B(Star), R(21),
B(CallProperty0), R(21), R(5), U8(4),
B(CallProperty0), R(21), R(5), U8(6),
B(Star), R(6),
/* 35 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(6), U8(1),
B(ToBooleanLogicalNot),
@ -1110,7 +1110,7 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(93),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(7), U8(17),
B(TestEqualStrict), R(7), U8(16),
B(JumpIfFalse), U8(61),
B(Ldar), R(9),
B(TestTypeOf), U8(5),
@ -1277,9 +1277,9 @@ bytecodes: [
/* 40 E> */ B(TestEqualStrictNoFeedback), R(11),
B(JumpIfTrue), U8(4),
B(Abort), U8(42),
/* 35 S> */ B(LdaNamedProperty), R(4), U8(3), U8(6),
/* 35 S> */ B(LdaNamedProperty), R(4), U8(3), U8(4),
B(Star), R(21),
B(CallProperty0), R(21), R(4), U8(4),
B(CallProperty0), R(21), R(4), U8(6),
B(Star), R(5),
/* 35 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(5), U8(1),
B(ToBooleanLogicalNot),
@ -1352,7 +1352,7 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(93),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(6), U8(17),
B(TestEqualStrict), R(6), U8(16),
B(JumpIfFalse), U8(61),
B(Ldar), R(8),
B(TestTypeOf), U8(5),

View File

@ -32,9 +32,9 @@ parameter count: 1
bytecode array length: 11
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateClosure), U8(0), U8(2), U8(2),
/* 34 S> */ B(CreateClosure), U8(0), U8(0), U8(2),
B(Star), R(0),
/* 56 E> */ B(CallUndefinedReceiver0), R(0), U8(0),
/* 56 E> */ B(CallUndefinedReceiver0), R(0), U8(1),
/* 58 S> */ B(Return),
]
constant pool: [
@ -52,11 +52,11 @@ parameter count: 1
bytecode array length: 16
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateClosure), U8(0), U8(2), U8(2),
/* 34 S> */ B(CreateClosure), U8(0), U8(0), U8(2),
B(Star), R(0),
B(LdaSmi), I8(1),
B(Star), R(1),
/* 67 E> */ B(CallUndefinedReceiver1), R(0), R(1), U8(0),
/* 67 E> */ B(CallUndefinedReceiver1), R(0), R(1), U8(1),
/* 70 S> */ B(Return),
]
constant pool: [

View File

@ -178,9 +178,9 @@ bytecodes: [
/* 30 E> */ B(TestEqualStrictNoFeedback), R(10),
B(JumpIfTrue), U8(4),
B(Abort), U8(42),
/* 25 S> */ B(LdaNamedProperty), R(4), U8(7), U8(7),
/* 25 S> */ B(LdaNamedProperty), R(4), U8(7), U8(5),
B(Star), R(15),
B(CallProperty0), R(15), R(4), U8(5),
B(CallProperty0), R(15), R(4), U8(7),
B(Star), R(5),
/* 25 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(5), U8(1),
B(ToBooleanLogicalNot),
@ -251,7 +251,7 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(93),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(6), U8(18),
B(TestEqualStrict), R(6), U8(17),
B(JumpIfFalse), U8(61),
B(Ldar), R(8),
B(TestTypeOf), U8(5),
@ -363,13 +363,13 @@ bytecodes: [
/* 38 E> */ B(Throw),
B(Ldar), R(2),
/* 54 S> */ B(Return),
/* 43 S> */ B(LdaGlobal), U8(4), U8(2),
/* 43 S> */ B(LdaGlobal), U8(4), U8(0),
B(Star), R(8),
/* 50 E> */ B(CallUndefinedReceiver0), R(8), U8(0),
/* 50 E> */ B(CallUndefinedReceiver0), R(8), U8(2),
B(Star), R(6),
B(LdaNamedProperty), R(6), U8(5), U8(4),
B(Star), R(7),
B(CallProperty0), R(7), R(6), U8(16),
B(CallProperty0), R(7), R(6), U8(6),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
B(Star), R(4),
@ -387,34 +387,34 @@ bytecodes: [
B(SwitchOnSmiNoFeedback), U8(7), U8(2), I8(1),
B(LdaNamedProperty), R(4), U8(9), U8(8),
B(Star), R(8),
B(CallProperty1), R(8), R(4), R(5), U8(22),
B(CallProperty1), R(8), R(4), R(5), U8(10),
B(Jump), U8(65),
B(LdaNamedProperty), R(4), U8(10), U8(6),
B(LdaNamedProperty), R(4), U8(10), U8(12),
B(JumpIfUndefined), U8(13),
B(JumpIfNull), U8(11),
B(Star), R(8),
B(CallProperty1), R(8), R(4), R(5), U8(14),
B(Jump), U8(48),
B(Ldar), R(5),
/* 54 S> */ B(Return),
B(LdaNamedProperty), R(4), U8(11), U8(16),
B(JumpIfUndefined), U8(13),
B(JumpIfNull), U8(11),
B(Star), R(8),
B(CallProperty1), R(8), R(4), R(5), U8(18),
B(Jump), U8(48),
B(Ldar), R(5),
/* 54 S> */ B(Return),
B(LdaNamedProperty), R(4), U8(11), U8(10),
B(JumpIfUndefined), U8(13),
B(JumpIfNull), U8(11),
B(Star), R(8),
B(CallProperty1), R(8), R(4), R(5), U8(24),
B(Jump), U8(28),
B(LdaNamedProperty), R(4), U8(10), U8(6),
B(LdaNamedProperty), R(4), U8(10), U8(20),
B(Star), R(8),
B(JumpIfUndefined), U8(15),
B(JumpIfNull), U8(13),
B(CallProperty0), R(8), R(4), U8(20),
B(CallProperty0), R(8), R(4), U8(22),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(2), U8(1),
B(CallRuntime), U16(Runtime::kThrowThrowMethodMissing), R(0), U8(0),
B(Star), R(2),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(2), U8(1),
B(LdaNamedProperty), R(2), U8(12), U8(12),
B(LdaNamedProperty), R(2), U8(12), U8(24),
B(JumpIfToBooleanTrue), U8(33),
B(Ldar), R(2),
B(SuspendGenerator), R(0), R(0), U8(8), U8(1),
@ -427,7 +427,7 @@ bytecodes: [
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star), R(3),
B(JumpLoop), U8(139), I8(0),
B(LdaNamedProperty), R(2), U8(13), U8(14),
B(LdaNamedProperty), R(2), U8(13), U8(26),
B(Star), R(4),
B(LdaSmi), I8(1),
B(TestEqualStrictNoFeedback), R(3),

View File

@ -18,8 +18,8 @@ bytecode array length: 10
bytecodes: [
/* 26 E> */ B(StackCheck),
/* 31 S> */ B(LdaGlobal), U8(0), U8(0),
B(Inc), U8(4),
/* 40 E> */ B(StaGlobalSloppy), U8(0), U8(2),
B(Inc), U8(2),
/* 40 E> */ B(StaGlobalSloppy), U8(0), U8(3),
/* 47 S> */ B(Return),
]
constant pool: [
@ -40,10 +40,10 @@ bytecode array length: 16
bytecodes: [
/* 26 E> */ B(StackCheck),
/* 31 S> */ B(LdaGlobal), U8(0), U8(0),
B(ToNumeric), U8(4),
B(ToNumeric), U8(2),
B(Star), R(0),
B(Dec), U8(4),
/* 44 E> */ B(StaGlobalSloppy), U8(0), U8(2),
B(Dec), U8(2),
/* 44 E> */ B(StaGlobalSloppy), U8(0), U8(3),
B(Ldar), R(0),
/* 47 S> */ B(Return),
]
@ -65,8 +65,8 @@ bytecode array length: 10
bytecodes: [
/* 27 E> */ B(StackCheck),
/* 46 S> */ B(LdaGlobal), U8(0), U8(0),
B(Dec), U8(4),
/* 55 E> */ B(StaGlobalStrict), U8(0), U8(2),
B(Dec), U8(2),
/* 55 E> */ B(StaGlobalStrict), U8(0), U8(3),
/* 67 S> */ B(Return),
]
constant pool: [
@ -87,10 +87,10 @@ bytecode array length: 16
bytecodes: [
/* 27 E> */ B(StackCheck),
/* 32 S> */ B(LdaGlobal), U8(0), U8(0),
B(ToNumeric), U8(4),
B(ToNumeric), U8(2),
B(Star), R(0),
B(Inc), U8(4),
/* 50 E> */ B(StaGlobalSloppy), U8(0), U8(2),
B(Inc), U8(2),
/* 50 E> */ B(StaGlobalSloppy), U8(0), U8(3),
B(Ldar), R(0),
/* 53 S> */ B(Return),
]

View File

@ -961,15 +961,15 @@ bytecodes: [
B(Wide), B(JumpIfFalse), U16(39),
/* 4090 E> */ B(StackCheck),
/* 4122 S> */ B(LdaSmi), I8(1),
/* 4128 E> */ B(TestEqual), R(1), U8(2),
/* 4128 E> */ B(TestEqual), R(1), U8(1),
B(Wide), B(JumpIfFalse), U16(7),
/* 4134 S> */ B(Wide), B(Jump), U16(16),
/* 4146 S> */ B(LdaSmi), I8(2),
/* 4152 E> */ B(TestEqual), R(1), U8(3),
/* 4152 E> */ B(TestEqual), R(1), U8(2),
B(Wide), B(JumpIfFalse), U16(7),
/* 4158 S> */ B(Wide), B(Jump), U16(12),
/* 4114 S> */ B(Ldar), R(1),
B(Inc), U8(1),
B(Inc), U8(3),
B(Star), R(1),
B(JumpLoop), U8(42), I8(0),
/* 4167 S> */ B(LdaSmi), I8(3),

View File

@ -23,7 +23,7 @@ bytecodes: [
B(Ldar), R(0),
B(StaCurrentContextSlot), U8(5),
/* 10 E> */ B(StackCheck),
/* 14 S> */ B(LdaLookupGlobalSlot), U8(0), U8(2), U8(1),
/* 14 S> */ B(LdaLookupGlobalSlot), U8(0), U8(0), U8(1),
B(Star), R(2),
B(LdaConstant), U8(1),
B(Star), R(3),
@ -38,7 +38,7 @@ bytecodes: [
B(Mov), R(closure), R(6),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(4), U8(6),
B(Star), R(2),
/* 14 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(0),
/* 14 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(2),
/* 35 S> */ B(LdaLookupGlobalSlot), U8(2), U8(4), U8(1),
/* 44 S> */ B(Return),
]
@ -67,7 +67,7 @@ bytecodes: [
B(Ldar), R(0),
B(StaCurrentContextSlot), U8(5),
/* 10 E> */ B(StackCheck),
/* 14 S> */ B(LdaLookupGlobalSlot), U8(0), U8(2), U8(1),
/* 14 S> */ B(LdaLookupGlobalSlot), U8(0), U8(0), U8(1),
B(Star), R(2),
B(LdaConstant), U8(1),
B(Star), R(3),
@ -82,7 +82,7 @@ bytecodes: [
B(Mov), R(closure), R(6),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(4), U8(6),
B(Star), R(2),
/* 14 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(0),
/* 14 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(2),
/* 35 S> */ B(LdaLookupGlobalSlotInsideTypeof), U8(2), U8(4), U8(1),
B(TypeOf),
/* 51 S> */ B(Return),
@ -114,7 +114,7 @@ bytecodes: [
/* 10 E> */ B(StackCheck),
/* 14 S> */ B(LdaSmi), I8(20),
/* 16 E> */ B(StaLookupSlot), U8(0), U8(0),
/* 22 S> */ B(LdaLookupGlobalSlot), U8(1), U8(2), U8(1),
/* 22 S> */ B(LdaLookupGlobalSlot), U8(1), U8(0), U8(1),
B(Star), R(2),
B(LdaConstant), U8(2),
B(Star), R(3),
@ -129,7 +129,7 @@ bytecodes: [
B(Mov), R(closure), R(6),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(4), U8(6),
B(Star), R(2),
/* 29 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(0),
/* 29 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(2),
/* 38 S> */ B(Return),
]
constant pool: [
@ -162,7 +162,7 @@ bytecodes: [
B(Ldar), R(0),
B(StaCurrentContextSlot), U8(5),
/* 38 E> */ B(StackCheck),
/* 44 S> */ B(LdaLookupGlobalSlot), U8(0), U8(2), U8(1),
/* 44 S> */ B(LdaLookupGlobalSlot), U8(0), U8(0), U8(1),
B(Star), R(2),
B(LdaConstant), U8(1),
B(Star), R(3),
@ -177,7 +177,7 @@ bytecodes: [
B(Mov), R(closure), R(6),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(4), U8(6),
B(Star), R(2),
/* 44 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(0),
/* 44 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(2),
/* 66 S> */ B(LdaLookupContextSlot), U8(2), U8(6), U8(1),
/* 75 S> */ B(Return),
]
@ -211,7 +211,7 @@ bytecodes: [
B(Ldar), R(0),
B(StaCurrentContextSlot), U8(5),
/* 34 E> */ B(StackCheck),
/* 40 S> */ B(LdaLookupGlobalSlot), U8(0), U8(2), U8(1),
/* 40 S> */ B(LdaLookupGlobalSlot), U8(0), U8(0), U8(1),
B(Star), R(2),
B(LdaConstant), U8(1),
B(Star), R(3),
@ -226,7 +226,7 @@ bytecodes: [
B(Mov), R(closure), R(6),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(4), U8(6),
B(Star), R(2),
/* 40 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(0),
/* 40 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(2),
/* 62 S> */ B(LdaLookupGlobalSlot), U8(2), U8(4), U8(1),
/* 71 S> */ B(Return),
]

View File

@ -739,15 +739,15 @@ bytecodes: [
/* 45 S> */ B(Return),
/* 27 S> */ B(LdaImmutableCurrentContextSlot), U8(5),
B(Star), R(4),
/* 31 E> */ B(LdaNamedProperty), R(4), U8(4), U8(2),
/* 31 E> */ B(LdaNamedProperty), R(4), U8(4), U8(0),
B(Star), R(3),
B(LdaImmutableCurrentContextSlot), U8(5),
B(Star), R(5),
B(LdaImmutableCurrentContextSlot), U8(5),
B(Star), R(6),
/* 42 E> */ B(LdaNamedProperty), R(6), U8(5), U8(4),
/* 42 E> */ B(LdaNamedProperty), R(6), U8(5), U8(2),
B(Star), R(6),
/* 31 E> */ B(CallProperty2), R(3), R(4), R(5), R(6), U8(0),
/* 31 E> */ B(CallProperty2), R(3), R(4), R(5), R(6), U8(4),
B(StaCurrentContextSlot), U8(6),
B(LdaCurrentContextSlot), U8(6),
/* 45 S> */ B(Return),

View File

@ -30,10 +30,10 @@ bytecodes: [
B(CallRuntime), U16(Runtime::kToFastProperties), R(2), U8(1),
B(Star), R(0),
B(Star), R(1),
/* 89 S> */ B(CreateArrayLiteral), U8(1), U8(3), U8(37),
/* 89 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(37),
B(Star), R(3),
B(Ldar), R(1),
/* 89 E> */ B(ConstructWithSpread), R(1), R(3), U8(1), U8(1),
/* 89 E> */ B(ConstructWithSpread), R(1), R(3), U8(1), U8(2),
B(LdaUndefined),
/* 110 S> */ B(Return),
]
@ -71,10 +71,10 @@ bytecodes: [
B(Star), R(1),
/* 89 S> */ B(LdaZero),
B(Star), R(3),
B(CreateArrayLiteral), U8(1), U8(3), U8(37),
B(CreateArrayLiteral), U8(1), U8(1), U8(37),
B(Star), R(4),
B(Ldar), R(1),
/* 89 E> */ B(ConstructWithSpread), R(1), R(3), U8(2), U8(1),
/* 89 E> */ B(ConstructWithSpread), R(1), R(3), U8(2), U8(2),
B(LdaUndefined),
/* 113 S> */ B(Return),
]

View File

@ -75,8 +75,8 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), I8(1),
B(Star), R(0),
/* 45 S> */ B(CreateObjectLiteral), U8(0), U8(1), U8(41), R(1),
/* 69 E> */ B(AddSmi), I8(1), U8(0),
/* 45 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41), R(1),
/* 69 E> */ B(AddSmi), I8(1), U8(1),
B(StaNamedOwnProperty), R(1), U8(1), U8(2),
B(Ldar), R(1),
/* 75 S> */ B(Return),
@ -97,8 +97,8 @@ parameter count: 1
bytecode array length: 17
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(1), U8(41), R(0),
B(CreateClosure), U8(1), U8(0), U8(2),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41), R(0),
B(CreateClosure), U8(1), U8(1), U8(2),
B(StaNamedOwnProperty), R(0), U8(2), U8(2),
B(Ldar), R(0),
/* 66 S> */ B(Return),
@ -120,8 +120,8 @@ parameter count: 1
bytecode array length: 17
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(1), U8(41), R(0),
B(CreateClosure), U8(1), U8(0), U8(2),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41), R(0),
B(CreateClosure), U8(1), U8(1), U8(2),
B(StaNamedOwnProperty), R(0), U8(2), U8(2),
B(Ldar), R(0),
/* 67 S> */ B(Return),
@ -143,10 +143,10 @@ parameter count: 1
bytecode array length: 33
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(1), U8(41), R(0),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41), R(0),
B(LdaConstant), U8(1),
B(Star), R(2),
B(CreateClosure), U8(2), U8(0), U8(2),
B(CreateClosure), U8(2), U8(1), U8(2),
B(Star), R(3),
B(LdaNull),
B(Star), R(4),
@ -174,12 +174,12 @@ parameter count: 1
bytecode array length: 36
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(2), U8(41), R(0),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41), R(0),
B(LdaConstant), U8(1),
B(Star), R(2),
B(CreateClosure), U8(2), U8(0), U8(2),
B(CreateClosure), U8(2), U8(1), U8(2),
B(Star), R(3),
B(CreateClosure), U8(3), U8(1), U8(2),
B(CreateClosure), U8(3), U8(2), U8(2),
B(Star), R(4),
B(LdaZero),
B(Star), R(5),
@ -206,12 +206,12 @@ parameter count: 1
bytecode array length: 33
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(1), U8(41), R(0),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41), R(0),
B(LdaConstant), U8(1),
B(Star), R(2),
B(LdaNull),
B(Star), R(3),
B(CreateClosure), U8(2), U8(0), U8(2),
B(CreateClosure), U8(2), U8(1), U8(2),
B(Star), R(4),
B(LdaZero),
B(Star), R(5),
@ -367,13 +367,13 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaConstant), U8(0),
B(Star), R(0),
/* 50 S> */ B(CreateObjectLiteral), U8(1), U8(2), U8(41), R(1),
/* 50 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(41), R(1),
/* 60 E> */ B(ToName), R(2),
B(LdaConstant), U8(2),
B(StaDataPropertyInLiteral), R(1), R(2), U8(0), U8(3),
B(StaDataPropertyInLiteral), R(1), R(2), U8(0), U8(1),
B(LdaConstant), U8(3),
B(Star), R(3),
B(CreateClosure), U8(4), U8(0), U8(2),
B(CreateClosure), U8(4), U8(3), U8(2),
B(Star), R(4),
B(LdaZero),
B(Star), R(5),
@ -381,7 +381,7 @@ bytecodes: [
B(CallRuntime), U16(Runtime::kDefineGetterPropertyUnchecked), R(2), U8(4),
B(LdaConstant), U8(3),
B(Star), R(3),
B(CreateClosure), U8(5), U8(1), U8(2),
B(CreateClosure), U8(5), U8(4), U8(2),
B(Star), R(4),
B(LdaZero),
B(Star), R(5),

View File

@ -16,9 +16,9 @@ parameter count: 2
bytecode array length: 12
bytecodes: [
/* 10 E> */ B(StackCheck),
/* 25 S> */ B(LdaNamedProperty), R(arg0), U8(0), U8(2),
/* 25 S> */ B(LdaNamedProperty), R(arg0), U8(0), U8(0),
B(Star), R(0),
/* 25 E> */ B(CallProperty0), R(0), R(arg0), U8(0),
/* 25 E> */ B(CallProperty0), R(0), R(arg0), U8(2),
/* 32 S> */ B(Return),
]
constant pool: [
@ -37,9 +37,9 @@ parameter count: 4
bytecode array length: 14
bytecodes: [
/* 10 E> */ B(StackCheck),
/* 31 S> */ B(LdaNamedProperty), R(arg0), U8(0), U8(2),
/* 31 S> */ B(LdaNamedProperty), R(arg0), U8(0), U8(0),
B(Star), R(0),
/* 31 E> */ B(CallProperty2), R(0), R(arg0), R(arg1), R(arg2), U8(0),
/* 31 E> */ B(CallProperty2), R(0), R(arg0), R(arg1), R(arg2), U8(2),
/* 42 S> */ B(Return),
]
constant pool: [
@ -58,12 +58,12 @@ parameter count: 3
bytecode array length: 21
bytecodes: [
/* 10 E> */ B(StackCheck),
/* 28 S> */ B(LdaNamedProperty), R(arg0), U8(0), U8(2),
/* 28 S> */ B(LdaNamedProperty), R(arg0), U8(0), U8(0),
B(Star), R(0),
B(Ldar), R(arg1),
/* 35 E> */ B(Add), R(arg1), U8(4),
/* 35 E> */ B(Add), R(arg1), U8(2),
B(Star), R(2),
/* 28 E> */ B(CallProperty2), R(0), R(arg0), R(2), R(arg1), U8(0),
/* 28 E> */ B(CallProperty2), R(0), R(arg0), R(2), R(arg1), U8(3),
/* 43 S> */ B(Return),
]
constant pool: [
@ -339,9 +339,9 @@ bytecodes: [
/* 1144 S> */ B(LdaNamedProperty), R(arg0), U8(0), U8(250),
/* 1153 S> */ B(LdaNamedProperty), R(arg0), U8(0), U8(252),
/* 1162 S> */ B(LdaNamedProperty), R(arg0), U8(0), U8(254),
/* 1178 S> */ B(Wide), B(LdaNamedProperty), R16(arg0), U16(0), U16(258),
/* 1178 S> */ B(Wide), B(LdaNamedProperty), R16(arg0), U16(0), U16(256),
B(Star), R(0),
/* 1178 E> */ B(Wide), B(CallProperty0), R16(0), R16(arg0), U16(256),
/* 1178 E> */ B(Wide), B(CallProperty0), R16(0), R16(arg0), U16(258),
/* 1185 S> */ B(Return),
]
constant pool: [
@ -360,23 +360,23 @@ parameter count: 2
bytecode array length: 51
bytecodes: [
/* 10 E> */ B(StackCheck),
/* 25 S> */ B(LdaNamedProperty), R(arg0), U8(0), U8(6),
/* 25 S> */ B(LdaNamedProperty), R(arg0), U8(0), U8(0),
B(Star), R(2),
B(LdaSmi), I8(1),
B(Star), R(4),
/* 25 E> */ B(CallProperty1), R(2), R(arg0), R(4), U8(4),
/* 25 E> */ B(CallProperty1), R(2), R(arg0), R(4), U8(2),
B(Star), R(2),
/* 32 E> */ B(LdaNamedProperty), R(2), U8(0), U8(8),
/* 32 E> */ B(LdaNamedProperty), R(2), U8(0), U8(4),
B(Star), R(1),
B(LdaSmi), I8(2),
B(Star), R(3),
/* 33 E> */ B(CallProperty1), R(1), R(2), R(3), U8(2),
/* 33 E> */ B(CallProperty1), R(1), R(2), R(3), U8(6),
B(Star), R(1),
/* 40 E> */ B(LdaNamedProperty), R(1), U8(0), U8(10),
/* 40 E> */ B(LdaNamedProperty), R(1), U8(0), U8(8),
B(Star), R(0),
B(LdaSmi), I8(3),
B(Star), R(2),
/* 41 E> */ B(CallProperty1), R(0), R(1), R(2), U8(0),
/* 41 E> */ B(CallProperty1), R(0), R(1), R(2), U8(10),
/* 49 S> */ B(Return),
]
constant pool: [

View File

@ -50,13 +50,13 @@ parameter count: 1
bytecode array length: 23
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateRegExpLiteral), U8(0), U8(2), U8(0),
/* 34 S> */ B(CreateRegExpLiteral), U8(0), U8(0), U8(0),
B(Star), R(1),
/* 48 E> */ B(LdaNamedProperty), R(1), U8(1), U8(3),
/* 48 E> */ B(LdaNamedProperty), R(1), U8(1), U8(1),
B(Star), R(0),
B(LdaConstant), U8(2),
B(Star), R(2),
/* 48 E> */ B(CallProperty1), R(0), R(1), R(2), U8(0),
/* 48 E> */ B(CallProperty1), R(0), R(1), R(2), U8(3),
/* 61 S> */ B(Return),
]
constant pool: [

View File

@ -99,7 +99,7 @@ bytecodes: [
B(TestEqual), R(2), U8(3),
B(JumpIfFalse), U8(54),
/* 17 E> */ B(StackCheck),
/* 48 S> */ B(LdaLookupGlobalSlot), U8(2), U8(6), U8(1),
/* 48 S> */ B(LdaLookupGlobalSlot), U8(2), U8(4), U8(1),
B(Star), R(7),
B(LdaConstant), U8(3),
B(Star), R(8),
@ -114,7 +114,7 @@ bytecodes: [
B(Mov), R(closure), R(11),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(9), U8(6),
B(Star), R(7),
/* 48 E> */ B(CallUndefinedReceiver1), R(7), R(8), U8(4),
/* 48 E> */ B(CallUndefinedReceiver1), R(7), R(8), U8(6),
B(LdaZero),
B(Star), R(2),
B(LdaCurrentContextSlot), U8(4),
@ -188,9 +188,9 @@ bytecodes: [
B(TestEqual), R(3), U8(3),
B(JumpIfFalse), U8(22),
/* 17 E> */ B(StackCheck),
/* 48 S> */ B(CreateClosure), U8(1), U8(6), U8(2),
/* 48 S> */ B(CreateClosure), U8(1), U8(4), U8(2),
B(Star), R(5),
/* 74 E> */ B(CallUndefinedReceiver0), R(5), U8(4),
/* 74 E> */ B(CallUndefinedReceiver0), R(5), U8(5),
B(LdaZero),
B(Star), R(3),
B(LdaCurrentContextSlot), U8(4),
@ -237,19 +237,19 @@ bytecodes: [
B(Star), R(5),
B(CallRuntime), U16(Runtime::kNewTypeError), R(4), U8(2),
/* 28 E> */ B(Throw),
/* 37 S> */ B(LdaNamedProperty), R(3), U8(1), U8(3),
/* 37 S> */ B(LdaNamedProperty), R(3), U8(1), U8(1),
B(Star), R(1),
/* 37 S> */ B(LdaNamedProperty), R(3), U8(2), U8(5),
/* 37 S> */ B(LdaNamedProperty), R(3), U8(2), U8(3),
B(Star), R(2),
/* 55 S> */ B(LdaZero),
/* 55 E> */ B(TestGreaterThan), R(2), U8(7),
/* 55 E> */ B(TestGreaterThan), R(2), U8(5),
B(JumpIfFalse), U8(19),
/* 17 E> */ B(StackCheck),
/* 75 S> */ B(Ldar), R(2),
/* 77 E> */ B(Add), R(1), U8(9),
/* 77 E> */ B(Add), R(1), U8(6),
B(Star), R(0),
/* 62 S> */ B(Ldar), R(2),
B(Dec), U8(8),
B(Dec), U8(7),
B(Star), R(2),
B(JumpLoop), U8(20), I8(0),
B(LdaUndefined),

View File

@ -21,10 +21,10 @@ bytecodes: [
/* 53 S> */ B(LdaSmi), I8(2),
B(Star), R(1),
/* 56 S> */ B(Ldar), R(1),
/* 65 E> */ B(Add), R(0), U8(0),
/* 65 E> */ B(Add), R(0), U8(1),
B(Star), R(2),
B(LdaConstant), U8(0),
/* 69 E> */ B(Add), R(2), U8(1),
/* 69 E> */ B(Add), R(2), U8(0),
/* 80 S> */ B(Return),
]
constant pool: [
@ -51,10 +51,10 @@ bytecodes: [
/* 56 S> */ B(LdaConstant), U8(0),
B(Star), R(2),
B(Ldar), R(0),
/* 72 E> */ B(Add), R(2), U8(0),
/* 72 E> */ B(Add), R(2), U8(1),
B(Star), R(2),
B(Ldar), R(1),
/* 76 E> */ B(Add), R(2), U8(1),
/* 76 E> */ B(Add), R(2), U8(0),
/* 80 S> */ B(Return),
]
constant pool: [
@ -79,10 +79,10 @@ bytecodes: [
/* 53 S> */ B(LdaSmi), I8(2),
B(Star), R(1),
/* 56 S> */ B(LdaConstant), U8(0),
/* 65 E> */ B(Add), R(0), U8(0),
/* 65 E> */ B(Add), R(0), U8(1),
B(Star), R(2),
B(Ldar), R(1),
/* 76 E> */ B(Add), R(2), U8(1),
/* 76 E> */ B(Add), R(2), U8(0),
/* 80 S> */ B(Return),
]
constant pool: [
@ -109,17 +109,17 @@ bytecodes: [
/* 56 S> */ B(LdaConstant), U8(0),
B(Star), R(2),
B(Ldar), R(0),
/* 69 E> */ B(Add), R(2), U8(0),
/* 69 E> */ B(Add), R(2), U8(4),
B(Star), R(2),
B(LdaConstant), U8(1),
/* 73 E> */ B(Add), R(2), U8(1),
/* 73 E> */ B(Add), R(2), U8(3),
B(Star), R(2),
B(Ldar), R(1),
/* 81 E> */ B(Add), R(2), U8(2),
B(Star), R(2),
B(LdaConstant), U8(2),
/* 85 E> */ B(Add), R(2), U8(3),
/* 93 E> */ B(AddSmi), I8(1), U8(4),
/* 85 E> */ B(Add), R(2), U8(1),
/* 93 E> */ B(AddSmi), I8(1), U8(0),
/* 97 S> */ B(Return),
]
constant pool: [
@ -146,13 +146,13 @@ bytecodes: [
/* 53 S> */ B(LdaSmi), I8(2),
B(Star), R(1),
/* 56 S> */ B(LdaConstant), U8(0),
/* 66 E> */ B(Add), R(0), U8(0),
/* 66 E> */ B(Add), R(0), U8(1),
B(Star), R(2),
B(LdaConstant), U8(0),
B(Star), R(3),
B(Ldar), R(1),
/* 90 E> */ B(Add), R(3), U8(1),
/* 78 E> */ B(Add), R(2), U8(2),
/* 90 E> */ B(Add), R(3), U8(2),
/* 78 E> */ B(Add), R(2), U8(0),
/* 95 S> */ B(Return),
]
constant pool: [
@ -181,14 +181,14 @@ bytecodes: [
B(Star), R(1),
/* 80 S> */ B(LdaConstant), U8(1),
B(Star), R(3),
/* 98 E> */ B(CallUndefinedReceiver2), R(2), R(0), R(1), U8(1),
/* 98 E> */ B(CallUndefinedReceiver2), R(2), R(0), R(1), U8(4),
/* 96 E> */ B(Add), R(3), U8(3),
B(Star), R(3),
B(Ldar), R(0),
/* 108 E> */ B(Add), R(3), U8(4),
/* 108 E> */ B(Add), R(3), U8(2),
B(Star), R(3),
B(Ldar), R(1),
/* 112 E> */ B(Add), R(3), U8(5),
/* 112 E> */ B(Add), R(3), U8(1),
/* 116 S> */ B(Return),
]
constant pool: [

View File

@ -478,18 +478,18 @@ bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star), R(0),
/* 45 S> */ B(LdaSmi), I8(1),
B(TestEqualStrict), R(0), U8(3),
B(TestEqualStrict), R(0), U8(0),
B(Mov), R(0), R(1),
B(JumpIfTrue), U8(11),
B(LdaSmi), I8(2),
B(TestEqualStrict), R(1), U8(4),
B(TestEqualStrict), R(1), U8(1),
B(JumpIfTrue), U8(32),
B(Jump), U8(34),
/* 70 S> */ B(Ldar), R(0),
/* 79 E> */ B(AddSmi), I8(1), U8(0),
/* 79 E> */ B(AddSmi), I8(1), U8(2),
B(Star), R(2),
B(LdaSmi), I8(2),
B(TestEqualStrict), R(2), U8(1),
B(TestEqualStrict), R(2), U8(3),
B(JumpIfTrue), U8(4),
B(Jump), U8(8),
/* 101 S> */ B(LdaSmi), I8(1),

View File

@ -21,8 +21,8 @@ bytecodes: [
B(Mov), R(closure), R(3),
B(CallRuntime), U16(Runtime::kDeclareGlobalsForInterpreter), R(1), U8(3),
/* 0 E> */ B(StackCheck),
/* 8 S> */ B(CreateObjectLiteral), U8(1), U8(3), U8(41), R(1),
B(CreateClosure), U8(2), U8(2), U8(0),
/* 8 S> */ B(CreateObjectLiteral), U8(1), U8(2), U8(41), R(1),
B(CreateClosure), U8(2), U8(3), U8(0),
B(StaNamedOwnProperty), R(1), U8(3), U8(4),
B(Ldar), R(1),
/* 8 E> */ B(StaGlobalSloppy), U8(4), U8(6),

View File

@ -101,8 +101,8 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(Wide), B(LdaSmi), I16(1234),
B(Star), R(0),
/* 64 S> */ B(Mul), R(0), U8(0),
/* 68 E> */ B(SubSmi), I8(1), U8(1),
/* 64 S> */ B(Mul), R(0), U8(1),
/* 68 E> */ B(SubSmi), I8(1), U8(0),
B(LdaUndefined),
B(Star), R(1),
/* 83 S> */ B(Return),

View File

@ -905,11 +905,11 @@ bytecodes: [
B(JumpIfFalse), U8(31),
/* 1518 E> */ B(StackCheck),
/* 1555 S> */ B(Wide), B(Ldar), R16(128),
/* 1561 E> */ B(Add), R(1), U8(2),
/* 1561 E> */ B(Add), R(1), U8(1),
B(Wide), B(Mov), R16(1), R16(157),
B(Star), R(1),
/* 1548 S> */ B(Wide), B(Ldar), R16(128),
B(Inc), U8(1),
B(Inc), U8(2),
B(Wide), B(Star), R16(128),
B(JumpLoop), U8(36), I8(0),
/* 1567 S> */ B(Wide), B(Ldar), R16(128),
@ -1097,17 +1097,17 @@ bytecodes: [
B(JumpIfNull), U8(72),
B(Wide), B(ToObject), R16(157),
B(Wide), B(ForInEnumerate), R16(157),
B(Wide), B(ForInPrepare), R16(158), U16(1),
B(Wide), B(ForInPrepare), R16(158), U16(0),
B(LdaZero),
B(Wide), B(Star), R16(161),
/* 1526 S> */ B(Wide), B(ForInContinue), R16(161), R16(160),
B(JumpIfFalse), U8(45),
B(Wide), B(ForInNext), R16(157), R16(161), R16(158), U16(1),
B(Wide), B(ForInNext), R16(157), R16(161), R16(158), U16(0),
B(JumpIfUndefined), U8(22),
B(Wide), B(Star), R16(128),
/* 1521 E> */ B(StackCheck),
/* 1541 S> */ B(Wide), B(Ldar), R16(128),
/* 1547 E> */ B(Add), R(1), U8(0),
/* 1547 E> */ B(Add), R(1), U8(1),
B(Wide), B(Mov), R16(1), R16(162),
B(Star), R(1),
/* 1544 E> */ B(Wide), B(ForInStep), R16(161),

View File

@ -282,10 +282,10 @@ TEST(InterpreterShiftOpsSmi) {
Isolate* isolate = handles.main_isolate();
Zone* zone = handles.main_zone();
Factory* factory = isolate->factory();
BytecodeArrayBuilder builder(isolate, zone, 1, 1);
FeedbackVectorSpec feedback_spec(zone);
FeedbackSlot slot = feedback_spec.AddInterpreterBinaryOpICSlot();
BytecodeArrayBuilder builder(isolate, zone, 1, 1, &feedback_spec);
FeedbackSlot slot = feedback_spec.AddBinaryOpICSlot();
Handle<i::FeedbackMetadata> metadata =
NewFeedbackMetadata(isolate, &feedback_spec);
@ -320,10 +320,10 @@ TEST(InterpreterBinaryOpsSmi) {
Isolate* isolate = handles.main_isolate();
Zone* zone = handles.main_zone();
Factory* factory = isolate->factory();
BytecodeArrayBuilder builder(isolate, zone, 1, 1);
FeedbackVectorSpec feedback_spec(zone);
FeedbackSlot slot = feedback_spec.AddInterpreterBinaryOpICSlot();
BytecodeArrayBuilder builder(isolate, zone, 1, 1, &feedback_spec);
FeedbackSlot slot = feedback_spec.AddBinaryOpICSlot();
Handle<i::FeedbackMetadata> metadata =
NewFeedbackMetadata(isolate, &feedback_spec);
@ -361,10 +361,10 @@ TEST(InterpreterBinaryOpsHeapNumber) {
Factory* factory = isolate->factory();
AstValueFactory ast_factory(zone, isolate->ast_string_constants(),
isolate->heap()->HashSeed());
BytecodeArrayBuilder builder(isolate, zone, 1, 1);
FeedbackVectorSpec feedback_spec(zone);
FeedbackSlot slot = feedback_spec.AddInterpreterBinaryOpICSlot();
BytecodeArrayBuilder builder(isolate, zone, 1, 1, &feedback_spec);
FeedbackSlot slot = feedback_spec.AddBinaryOpICSlot();
Handle<i::FeedbackMetadata> metadata =
NewFeedbackMetadata(isolate, &feedback_spec);
@ -435,9 +435,9 @@ TEST(InterpreterStringAdd) {
};
for (size_t i = 0; i < arraysize(test_cases); i++) {
BytecodeArrayBuilder builder(isolate, zone, 1, 1);
FeedbackVectorSpec feedback_spec(zone);
FeedbackSlot slot = feedback_spec.AddInterpreterBinaryOpICSlot();
BytecodeArrayBuilder builder(isolate, zone, 1, 1, &feedback_spec);
FeedbackSlot slot = feedback_spec.AddBinaryOpICSlot();
Handle<i::FeedbackMetadata> metadata =
NewFeedbackMetadata(isolate, &feedback_spec);
@ -491,16 +491,16 @@ TEST(InterpreterParameter8) {
Zone* zone = handles.main_zone();
AstValueFactory ast_factory(zone, isolate->ast_string_constants(),
isolate->heap()->HashSeed());
BytecodeArrayBuilder builder(isolate, zone, 8, 0);
FeedbackVectorSpec feedback_spec(zone);
FeedbackSlot slot = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackSlot slot1 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackSlot slot2 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackSlot slot3 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackSlot slot4 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackSlot slot5 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackSlot slot6 = feedback_spec.AddInterpreterBinaryOpICSlot();
BytecodeArrayBuilder builder(isolate, zone, 8, 0, &feedback_spec);
FeedbackSlot slot = feedback_spec.AddBinaryOpICSlot();
FeedbackSlot slot1 = feedback_spec.AddBinaryOpICSlot();
FeedbackSlot slot2 = feedback_spec.AddBinaryOpICSlot();
FeedbackSlot slot3 = feedback_spec.AddBinaryOpICSlot();
FeedbackSlot slot4 = feedback_spec.AddBinaryOpICSlot();
FeedbackSlot slot5 = feedback_spec.AddBinaryOpICSlot();
FeedbackSlot slot6 = feedback_spec.AddBinaryOpICSlot();
Handle<i::FeedbackMetadata> metadata =
NewFeedbackMetadata(isolate, &feedback_spec);
@ -650,10 +650,10 @@ TEST(InterpreterBinaryOpTypeFeedback) {
Handle<Smi>(Smi::FromInt(1), isolate), BinaryOperationFeedback::kAny}};
for (const BinaryOpExpectation& test_case : kTestCases) {
BytecodeArrayBuilder builder(isolate, zone, 1, 1);
i::FeedbackVectorSpec feedback_spec(zone);
i::FeedbackSlot slot0 = feedback_spec.AddInterpreterBinaryOpICSlot();
BytecodeArrayBuilder builder(isolate, zone, 1, 1, &feedback_spec);
i::FeedbackSlot slot0 = feedback_spec.AddBinaryOpICSlot();
Handle<i::FeedbackMetadata> metadata =
i::NewFeedbackMetadata(isolate, &feedback_spec);
@ -763,10 +763,10 @@ TEST(InterpreterBinaryOpSmiTypeFeedback) {
Handle<Smi>(Smi::FromInt(1), isolate), BinaryOperationFeedback::kAny}};
for (const BinaryOpExpectation& test_case : kTestCases) {
BytecodeArrayBuilder builder(isolate, zone, 1, 1);
i::FeedbackVectorSpec feedback_spec(zone);
i::FeedbackSlot slot0 = feedback_spec.AddInterpreterBinaryOpICSlot();
BytecodeArrayBuilder builder(isolate, zone, 1, 1, &feedback_spec);
i::FeedbackSlot slot0 = feedback_spec.AddBinaryOpICSlot();
Handle<i::FeedbackMetadata> metadata =
i::NewFeedbackMetadata(isolate, &feedback_spec);
@ -814,13 +814,13 @@ TEST(InterpreterUnaryOpFeedback) {
{Token::Value::INC, smi_one, smi_max, number, str},
{Token::Value::DEC, smi_one, smi_min, number, str}};
for (TestCase const& test_case : kTestCases) {
BytecodeArrayBuilder builder(isolate, zone, 4, 0);
i::FeedbackVectorSpec feedback_spec(zone);
i::FeedbackSlot slot0 = feedback_spec.AddInterpreterBinaryOpICSlot();
i::FeedbackSlot slot1 = feedback_spec.AddInterpreterBinaryOpICSlot();
i::FeedbackSlot slot2 = feedback_spec.AddInterpreterBinaryOpICSlot();
i::FeedbackSlot slot3 = feedback_spec.AddInterpreterBinaryOpICSlot();
BytecodeArrayBuilder builder(isolate, zone, 4, 0, &feedback_spec);
i::FeedbackSlot slot0 = feedback_spec.AddBinaryOpICSlot();
i::FeedbackSlot slot1 = feedback_spec.AddBinaryOpICSlot();
i::FeedbackSlot slot2 = feedback_spec.AddBinaryOpICSlot();
i::FeedbackSlot slot3 = feedback_spec.AddBinaryOpICSlot();
Handle<i::FeedbackMetadata> metadata =
i::NewFeedbackMetadata(isolate, &feedback_spec);
@ -878,12 +878,12 @@ TEST(InterpreterBitwiseTypeFeedback) {
Token::Value::SHL, Token::Value::SHR, Token::Value::SAR};
for (Token::Value op : kBitwiseBinaryOperators) {
BytecodeArrayBuilder builder(isolate, zone, 4, 0);
i::FeedbackVectorSpec feedback_spec(zone);
i::FeedbackSlot slot0 = feedback_spec.AddInterpreterBinaryOpICSlot();
i::FeedbackSlot slot1 = feedback_spec.AddInterpreterBinaryOpICSlot();
i::FeedbackSlot slot2 = feedback_spec.AddInterpreterBinaryOpICSlot();
BytecodeArrayBuilder builder(isolate, zone, 4, 0, &feedback_spec);
i::FeedbackSlot slot0 = feedback_spec.AddBinaryOpICSlot();
i::FeedbackSlot slot1 = feedback_spec.AddBinaryOpICSlot();
i::FeedbackSlot slot2 = feedback_spec.AddBinaryOpICSlot();
Handle<i::FeedbackMetadata> metadata =
i::NewFeedbackMetadata(isolate, &feedback_spec);
@ -1054,7 +1054,7 @@ TEST(InterpreterLoadNamedProperty) {
const AstRawString* name = ast_factory.GetOneByteString("val");
BytecodeArrayBuilder builder(isolate, zone, 1, 0);
BytecodeArrayBuilder builder(isolate, zone, 1, 0, &feedback_spec);
builder.LoadNamedProperty(builder.Receiver(), name, GetIndex(slot)).Return();
ast_factory.Internalize(isolate);
@ -1106,7 +1106,7 @@ TEST(InterpreterLoadKeyedProperty) {
const AstRawString* key = ast_factory.GetOneByteString("key");
BytecodeArrayBuilder builder(isolate, zone, 1, 1);
BytecodeArrayBuilder builder(isolate, zone, 1, 1, &feedback_spec);
builder.LoadLiteral(key)
.LoadKeyedProperty(builder.Receiver(), GetIndex(slot))
@ -1141,14 +1141,14 @@ TEST(InterpreterStoreNamedProperty) {
isolate->heap()->HashSeed());
FeedbackVectorSpec feedback_spec(zone);
FeedbackSlot slot = feedback_spec.AddStoreICSlot(LanguageMode::kSloppy);
FeedbackSlot slot = feedback_spec.AddStoreICSlot(LanguageMode::kStrict);
Handle<i::FeedbackMetadata> metadata =
NewFeedbackMetadata(isolate, &feedback_spec);
const AstRawString* name = ast_factory.GetOneByteString("val");
BytecodeArrayBuilder builder(isolate, zone, 1, 0);
BytecodeArrayBuilder builder(isolate, zone, 1, 0, &feedback_spec);
builder.LoadLiteral(Smi::FromInt(999))
.StoreNamedProperty(builder.Receiver(), name, GetIndex(slot),
@ -1211,7 +1211,7 @@ TEST(InterpreterStoreKeyedProperty) {
const AstRawString* name = ast_factory.GetOneByteString("val");
BytecodeArrayBuilder builder(isolate, zone, 1, 1);
BytecodeArrayBuilder builder(isolate, zone, 1, 1, &feedback_spec);
builder.LoadLiteral(name)
.StoreAccumulatorInRegister(Register(0))
@ -1269,7 +1269,7 @@ TEST(InterpreterCall) {
// Check with no args.
{
BytecodeArrayBuilder builder(isolate, zone, 1, 1);
BytecodeArrayBuilder builder(isolate, zone, 1, 1, &feedback_spec);
Register reg = builder.register_allocator()->NewRegister();
RegisterList args = builder.register_allocator()->NewRegisterList(1);
builder.LoadNamedProperty(builder.Receiver(), name, slot_index)
@ -1293,7 +1293,7 @@ TEST(InterpreterCall) {
// Check that receiver is passed properly.
{
BytecodeArrayBuilder builder(isolate, zone, 1, 1);
BytecodeArrayBuilder builder(isolate, zone, 1, 1, &feedback_spec);
Register reg = builder.register_allocator()->NewRegister();
RegisterList args = builder.register_allocator()->NewRegisterList(1);
builder.LoadNamedProperty(builder.Receiver(), name, slot_index)
@ -1318,7 +1318,7 @@ TEST(InterpreterCall) {
// Check with two parameters (+ receiver).
{
BytecodeArrayBuilder builder(isolate, zone, 1, 4);
BytecodeArrayBuilder builder(isolate, zone, 1, 4, &feedback_spec);
Register reg = builder.register_allocator()->NewRegister();
RegisterList args = builder.register_allocator()->NewRegisterList(3);
@ -1351,7 +1351,7 @@ TEST(InterpreterCall) {
// Check with 10 parameters (+ receiver).
{
BytecodeArrayBuilder builder(isolate, zone, 1, 12);
BytecodeArrayBuilder builder(isolate, zone, 1, 12, &feedback_spec);
Register reg = builder.register_allocator()->NewRegister();
RegisterList args = builder.register_allocator()->NewRegisterList(11);
@ -1428,12 +1428,12 @@ TEST(InterpreterJumps) {
HandleAndZoneScope handles;
Isolate* isolate = handles.main_isolate();
Zone* zone = handles.main_zone();
BytecodeArrayBuilder builder(isolate, zone, 1, 2);
FeedbackVectorSpec feedback_spec(zone);
FeedbackSlot slot = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackSlot slot1 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackSlot slot2 = feedback_spec.AddInterpreterBinaryOpICSlot();
BytecodeArrayBuilder builder(isolate, zone, 1, 2, &feedback_spec);
FeedbackSlot slot = feedback_spec.AddBinaryOpICSlot();
FeedbackSlot slot1 = feedback_spec.AddBinaryOpICSlot();
FeedbackSlot slot2 = feedback_spec.AddBinaryOpICSlot();
Handle<i::FeedbackMetadata> metadata =
NewFeedbackMetadata(isolate, &feedback_spec);
@ -1465,14 +1465,14 @@ TEST(InterpreterConditionalJumps) {
HandleAndZoneScope handles;
Isolate* isolate = handles.main_isolate();
Zone* zone = handles.main_zone();
BytecodeArrayBuilder builder(isolate, zone, 1, 2);
FeedbackVectorSpec feedback_spec(zone);
FeedbackSlot slot = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackSlot slot1 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackSlot slot2 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackSlot slot3 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackSlot slot4 = feedback_spec.AddInterpreterBinaryOpICSlot();
BytecodeArrayBuilder builder(isolate, zone, 1, 2, &feedback_spec);
FeedbackSlot slot = feedback_spec.AddBinaryOpICSlot();
FeedbackSlot slot1 = feedback_spec.AddBinaryOpICSlot();
FeedbackSlot slot2 = feedback_spec.AddBinaryOpICSlot();
FeedbackSlot slot3 = feedback_spec.AddBinaryOpICSlot();
FeedbackSlot slot4 = feedback_spec.AddBinaryOpICSlot();
Handle<i::FeedbackMetadata> metadata =
NewFeedbackMetadata(isolate, &feedback_spec);
@ -1515,14 +1515,14 @@ TEST(InterpreterConditionalJumps2) {
HandleAndZoneScope handles;
Isolate* isolate = handles.main_isolate();
Zone* zone = handles.main_zone();
BytecodeArrayBuilder builder(isolate, zone, 1, 2);
FeedbackVectorSpec feedback_spec(zone);
FeedbackSlot slot = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackSlot slot1 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackSlot slot2 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackSlot slot3 = feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackSlot slot4 = feedback_spec.AddInterpreterBinaryOpICSlot();
BytecodeArrayBuilder builder(isolate, zone, 1, 2, &feedback_spec);
FeedbackSlot slot = feedback_spec.AddBinaryOpICSlot();
FeedbackSlot slot1 = feedback_spec.AddBinaryOpICSlot();
FeedbackSlot slot2 = feedback_spec.AddBinaryOpICSlot();
FeedbackSlot slot3 = feedback_spec.AddBinaryOpICSlot();
FeedbackSlot slot4 = feedback_spec.AddBinaryOpICSlot();
Handle<i::FeedbackMetadata> metadata =
NewFeedbackMetadata(isolate, &feedback_spec);
@ -1566,10 +1566,10 @@ TEST(InterpreterJumpConstantWith16BitOperand) {
Zone* zone = handles.main_zone();
AstValueFactory ast_factory(zone, isolate->ast_string_constants(),
isolate->heap()->HashSeed());
BytecodeArrayBuilder builder(isolate, zone, 1, 257);
FeedbackVectorSpec feedback_spec(zone);
FeedbackSlot slot = feedback_spec.AddInterpreterBinaryOpICSlot();
BytecodeArrayBuilder builder(isolate, zone, 1, 257, &feedback_spec);
FeedbackSlot slot = feedback_spec.AddBinaryOpICSlot();
Handle<i::FeedbackMetadata> metadata =
NewFeedbackMetadata(isolate, &feedback_spec);
@ -1717,10 +1717,10 @@ TEST(InterpreterSmiComparisons) {
HandleAndZoneScope handles;
Isolate* isolate = handles.main_isolate();
Zone* zone = handles.main_zone();
BytecodeArrayBuilder builder(isolate, zone, 1, 1);
FeedbackVectorSpec feedback_spec(zone);
FeedbackSlot slot = feedback_spec.AddInterpreterCompareICSlot();
BytecodeArrayBuilder builder(isolate, zone, 1, 1, &feedback_spec);
FeedbackSlot slot = feedback_spec.AddCompareICSlot();
Handle<i::FeedbackMetadata> metadata =
NewFeedbackMetadata(isolate, &feedback_spec);
@ -1765,10 +1765,10 @@ TEST(InterpreterHeapNumberComparisons) {
AstValueFactory ast_factory(zone, isolate->ast_string_constants(),
isolate->heap()->HashSeed());
BytecodeArrayBuilder builder(isolate, zone, 1, 1);
FeedbackVectorSpec feedback_spec(zone);
FeedbackSlot slot = feedback_spec.AddInterpreterCompareICSlot();
BytecodeArrayBuilder builder(isolate, zone, 1, 1, &feedback_spec);
FeedbackSlot slot = feedback_spec.AddCompareICSlot();
Handle<i::FeedbackMetadata> metadata =
NewFeedbackMetadata(isolate, &feedback_spec);
@ -1815,11 +1815,11 @@ TEST(InterpreterStringComparisons) {
const char* rhs = inputs[j].c_str();
FeedbackVectorSpec feedback_spec(zone);
FeedbackSlot slot = feedback_spec.AddInterpreterCompareICSlot();
FeedbackSlot slot = feedback_spec.AddCompareICSlot();
Handle<i::FeedbackMetadata> metadata =
NewFeedbackMetadata(isolate, &feedback_spec);
BytecodeArrayBuilder builder(isolate, zone, 1, 1);
BytecodeArrayBuilder builder(isolate, zone, 1, 1, &feedback_spec);
Register r0(0);
builder.LoadLiteral(ast_factory.GetOneByteString(lhs))
.StoreAccumulatorInRegister(r0)
@ -1894,12 +1894,11 @@ TEST(InterpreterMixedComparisons) {
Zone* zone = handles.main_zone();
AstValueFactory ast_factory(zone, isolate->ast_string_constants(),
isolate->heap()->HashSeed());
BytecodeArrayBuilder builder(isolate, zone, 1, 0);
FeedbackVectorSpec feedback_spec(zone);
FeedbackSlot string_add_slot =
feedback_spec.AddInterpreterBinaryOpICSlot();
FeedbackSlot slot = feedback_spec.AddInterpreterCompareICSlot();
BytecodeArrayBuilder builder(isolate, zone, 1, 0, &feedback_spec);
FeedbackSlot string_add_slot = feedback_spec.AddBinaryOpICSlot();
FeedbackSlot slot = feedback_spec.AddCompareICSlot();
Handle<i::FeedbackMetadata> metadata =
NewFeedbackMetadata(isolate, &feedback_spec);

View File

@ -574,9 +574,9 @@ TEST(ReferenceContextAllocatesNoSlots) {
CHECK_SLOT_KIND(helper, 1, FeedbackSlotKind::kStoreNamedStrict);
CHECK_SLOT_KIND(helper, 2, FeedbackSlotKind::kStoreNamedStrict);
CHECK_SLOT_KIND(helper, 3, FeedbackSlotKind::kStoreNamedStrict);
CHECK_SLOT_KIND(helper, 4, FeedbackSlotKind::kLoadProperty);
CHECK_SLOT_KIND(helper, 4, FeedbackSlotKind::kBinaryOp);
CHECK_SLOT_KIND(helper, 5, FeedbackSlotKind::kLoadProperty);
CHECK_SLOT_KIND(helper, 6, FeedbackSlotKind::kBinaryOp);
CHECK_SLOT_KIND(helper, 6, FeedbackSlotKind::kLoadProperty);
}
}

View File

@ -26,7 +26,8 @@ class BytecodeArrayBuilderTest : public TestWithIsolateAndZone {
using ToBooleanMode = BytecodeArrayBuilder::ToBooleanMode;
TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
BytecodeArrayBuilder builder(isolate(), zone(), 1, 131);
FeedbackVectorSpec feedback_spec(zone());
BytecodeArrayBuilder builder(isolate(), zone(), 1, 131, &feedback_spec);
Factory* factory = isolate()->factory();
AstValueFactory ast_factory(zone(), isolate()->ast_string_constants(),
isolate()->heap()->HashSeed());
@ -81,12 +82,36 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
builder.MoveRegister(reg, other);
builder.MoveRegister(reg, wide);
FeedbackSlot load_global_slot =
feedback_spec.AddLoadGlobalICSlot(NOT_INSIDE_TYPEOF);
FeedbackSlot load_global_typeof_slot =
feedback_spec.AddLoadGlobalICSlot(INSIDE_TYPEOF);
FeedbackSlot sloppy_store_global_slot =
feedback_spec.AddStoreGlobalICSlot(LanguageMode::kSloppy);
FeedbackSlot strict_store_global_slot =
feedback_spec.AddStoreGlobalICSlot(LanguageMode::kStrict);
FeedbackSlot load_slot = feedback_spec.AddLoadICSlot();
FeedbackSlot keyed_load_slot = feedback_spec.AddKeyedLoadICSlot();
FeedbackSlot sloppy_store_slot =
feedback_spec.AddStoreICSlot(LanguageMode::kSloppy);
FeedbackSlot strict_store_slot =
feedback_spec.AddStoreICSlot(LanguageMode::kStrict);
FeedbackSlot sloppy_keyed_store_slot =
feedback_spec.AddKeyedStoreICSlot(LanguageMode::kSloppy);
FeedbackSlot strict_keyed_store_slot =
feedback_spec.AddKeyedStoreICSlot(LanguageMode::kStrict);
FeedbackSlot store_own_slot = feedback_spec.AddStoreOwnICSlot();
// Emit global load / store operations.
const AstRawString* name = ast_factory.GetOneByteString("var_name");
builder.LoadGlobal(name, 1, TypeofMode::NOT_INSIDE_TYPEOF)
.LoadGlobal(name, 1, TypeofMode::INSIDE_TYPEOF)
.StoreGlobal(name, 1, LanguageMode::kSloppy)
.StoreGlobal(name, 1, LanguageMode::kStrict);
builder
.LoadGlobal(name, load_global_slot.ToInt(), TypeofMode::NOT_INSIDE_TYPEOF)
.LoadGlobal(name, load_global_typeof_slot.ToInt(),
TypeofMode::INSIDE_TYPEOF)
.StoreGlobal(name, sloppy_store_global_slot.ToInt(),
LanguageMode::kSloppy)
.StoreGlobal(name, strict_store_global_slot.ToInt(),
LanguageMode::kStrict);
// Emit context operations.
builder.PushContext(reg)
@ -106,13 +131,17 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
.StoreContextSlot(Register::current_context(), 3, 0);
// Emit load / store property operations.
builder.LoadNamedProperty(reg, name, 0)
.LoadKeyedProperty(reg, 0)
.StoreNamedProperty(reg, name, 0, LanguageMode::kSloppy)
.StoreKeyedProperty(reg, reg, 0, LanguageMode::kSloppy)
.StoreNamedProperty(reg, name, 0, LanguageMode::kStrict)
.StoreKeyedProperty(reg, reg, 0, LanguageMode::kStrict)
.StoreNamedOwnProperty(reg, name, 0);
builder.LoadNamedProperty(reg, name, load_slot.ToInt())
.LoadKeyedProperty(reg, keyed_load_slot.ToInt())
.StoreNamedProperty(reg, name, sloppy_store_slot.ToInt(),
LanguageMode::kSloppy)
.StoreKeyedProperty(reg, reg, sloppy_keyed_store_slot.ToInt(),
LanguageMode::kSloppy)
.StoreNamedProperty(reg, name, strict_store_slot.ToInt(),
LanguageMode::kStrict)
.StoreKeyedProperty(reg, reg, strict_keyed_store_slot.ToInt(),
LanguageMode::kStrict)
.StoreNamedOwnProperty(reg, name, store_own_slot.ToInt());
// Emit load / store lookup slots.
builder.LoadLookupSlot(name, TypeofMode::NOT_INSIDE_TYPEOF)
@ -316,25 +345,6 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
builder.LoadLiteral(Smi::FromInt(20000000));
const AstRawString* wide_name = ast_factory.GetOneByteString("var_wide_name");
// Emit wide global load / store operations.
builder.LoadGlobal(name, 1024, TypeofMode::NOT_INSIDE_TYPEOF)
.LoadGlobal(name, 1024, TypeofMode::INSIDE_TYPEOF)
.LoadGlobal(name, 1024, TypeofMode::INSIDE_TYPEOF)
.StoreGlobal(name, 1024, LanguageMode::kSloppy)
.StoreGlobal(wide_name, 1, LanguageMode::kStrict);
// Emit extra wide global load.
builder.LoadGlobal(name, 1024 * 1024, TypeofMode::NOT_INSIDE_TYPEOF);
// Emit wide load / store property operations.
builder.LoadNamedProperty(reg, wide_name, 0)
.LoadKeyedProperty(reg, 2056)
.StoreNamedProperty(reg, wide_name, 0, LanguageMode::kSloppy)
.StoreKeyedProperty(reg, reg, 2056, LanguageMode::kSloppy)
.StoreNamedProperty(reg, wide_name, 0, LanguageMode::kStrict)
.StoreKeyedProperty(reg, reg, 2056, LanguageMode::kStrict)
.StoreNamedOwnProperty(reg, wide_name, 0);
builder.StoreDataPropertyInLiteral(reg, reg,
DataPropertyInLiteralFlag::kNoFlags, 0);

View File

@ -22,7 +22,8 @@ class BytecodeArrayIteratorTest : public TestWithIsolateAndZone {
TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
// Use a builder to create an array with containing multiple bytecodes
// with 0, 1 and 2 operands.
BytecodeArrayBuilder builder(isolate(), zone(), 3, 3, 0);
FeedbackVectorSpec feedback_spec(zone());
BytecodeArrayBuilder builder(isolate(), zone(), 3, 3, &feedback_spec);
AstValueFactory ast_factory(zone(), isolate()->ast_string_constants(),
isolate()->heap()->HashSeed());
const AstValue* heap_num_0 = ast_factory.NewNumber(2.718);
@ -37,7 +38,10 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
Register param = Register::FromParameterIndex(2, builder.parameter_count());
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t name_index = 2;
uint32_t feedback_slot = 97;
uint32_t load_feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
uint32_t forin_feedback_slot = feedback_spec.AddForInSlot().ToInt();
uint32_t load_global_feedback_slot =
feedback_spec.AddLoadGlobalICSlot(TypeofMode::NOT_INSIDE_TYPEOF).ToInt();
builder.LoadLiteral(heap_num_0)
.StoreAccumulatorInRegister(reg_0)
@ -54,14 +58,15 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
.LoadAccumulatorWithRegister(reg_0)
.BinaryOperation(Token::Value::ADD, reg_0, 2)
.StoreAccumulatorInRegister(reg_1)
.LoadNamedProperty(reg_1, name, feedback_slot)
.LoadNamedProperty(reg_1, name, load_feedback_slot)
.BinaryOperation(Token::Value::ADD, reg_0, 3)
.StoreAccumulatorInRegister(param)
.CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, param, pair)
.ForInPrepare(triple, feedback_slot)
.ForInPrepare(triple, forin_feedback_slot)
.CallRuntime(Runtime::kLoadIC_Miss, reg_0)
.Debugger()
.LoadGlobal(name, 0x10000000, TypeofMode::NOT_INSIDE_TYPEOF)
.LoadGlobal(name, load_global_feedback_slot,
TypeofMode::NOT_INSIDE_TYPEOF)
.Return();
// Test iterator sees the expected output from the builder.
@ -204,7 +209,7 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_1.index());
EXPECT_EQ(iterator.GetIndexOperand(1), name_index);
EXPECT_EQ(iterator.GetIndexOperand(2), feedback_slot);
EXPECT_EQ(iterator.GetIndexOperand(2), load_feedback_slot);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kLdaNamedProperty, OperandScale::kSingle);
iterator.Advance();
@ -246,7 +251,7 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 3);
EXPECT_EQ(iterator.GetIndexOperand(1), feedback_slot);
EXPECT_EQ(iterator.GetIndexOperand(1), forin_feedback_slot);
CHECK(!iterator.done());
offset += Bytecodes::Size(Bytecode::kForInPrepare, OperandScale::kSingle);
iterator.Advance();
@ -270,11 +275,10 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaGlobal);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kQuadruple);
EXPECT_EQ(iterator.current_bytecode_size(), 10);
EXPECT_EQ(iterator.GetIndexOperand(1), 0x10000000u);
offset += Bytecodes::Size(Bytecode::kLdaGlobal, OperandScale::kQuadruple) +
kPrefixByteSize;
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode_size(), 3);
EXPECT_EQ(iterator.GetIndexOperand(1), load_global_feedback_slot);
offset += Bytecodes::Size(Bytecode::kLdaGlobal, OperandScale::kSingle);
iterator.Advance();
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kReturn);

View File

@ -22,7 +22,8 @@ class BytecodeArrayRandomIteratorTest : public TestWithIsolateAndZone {
TEST_F(BytecodeArrayRandomIteratorTest, InvalidBeforeStart) {
// Use a builder to create an array with containing multiple bytecodes
// with 0, 1 and 2 operands.
BytecodeArrayBuilder builder(isolate(), zone(), 3, 3, 0);
FeedbackVectorSpec feedback_spec(zone());
BytecodeArrayBuilder builder(isolate(), zone(), 3, 3, &feedback_spec);
AstValueFactory ast_factory(zone(), isolate()->ast_string_constants(),
isolate()->heap()->HashSeed());
const AstValue* heap_num_0 = ast_factory.NewNumber(2.718);
@ -36,7 +37,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, InvalidBeforeStart) {
RegisterList triple(0, 3);
Register param = Register::FromParameterIndex(2, builder.parameter_count());
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t feedback_slot = 97;
uint32_t feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
builder.LoadLiteral(heap_num_0)
.StoreAccumulatorInRegister(reg_0)
@ -60,7 +61,6 @@ TEST_F(BytecodeArrayRandomIteratorTest, InvalidBeforeStart) {
.ForInPrepare(triple, feedback_slot)
.CallRuntime(Runtime::kLoadIC_Miss, reg_0)
.Debugger()
.LoadGlobal(name, 0x10000000, TypeofMode::NOT_INSIDE_TYPEOF)
.Return();
ast_factory.Internalize(isolate());
@ -76,7 +76,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, InvalidBeforeStart) {
TEST_F(BytecodeArrayRandomIteratorTest, InvalidAfterEnd) {
// Use a builder to create an array with containing multiple bytecodes
// with 0, 1 and 2 operands.
BytecodeArrayBuilder builder(isolate(), zone(), 3, 3, 0);
FeedbackVectorSpec feedback_spec(zone());
BytecodeArrayBuilder builder(isolate(), zone(), 3, 3, &feedback_spec);
AstValueFactory ast_factory(zone(), isolate()->ast_string_constants(),
isolate()->heap()->HashSeed());
const AstValue* heap_num_0 = ast_factory.NewNumber(2.718);
@ -90,7 +91,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, InvalidAfterEnd) {
RegisterList triple(0, 3);
Register param = Register::FromParameterIndex(2, builder.parameter_count());
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t feedback_slot = 97;
uint32_t feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
builder.LoadLiteral(heap_num_0)
.StoreAccumulatorInRegister(reg_0)
@ -114,7 +115,6 @@ TEST_F(BytecodeArrayRandomIteratorTest, InvalidAfterEnd) {
.ForInPrepare(triple, feedback_slot)
.CallRuntime(Runtime::kLoadIC_Miss, reg_0)
.Debugger()
.LoadGlobal(name, 0x10000000, TypeofMode::NOT_INSIDE_TYPEOF)
.Return();
ast_factory.Internalize(isolate());
@ -130,7 +130,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, InvalidAfterEnd) {
TEST_F(BytecodeArrayRandomIteratorTest, AccessesFirst) {
// Use a builder to create an array with containing multiple bytecodes
// with 0, 1 and 2 operands.
BytecodeArrayBuilder builder(isolate(), zone(), 3, 3, 0);
FeedbackVectorSpec feedback_spec(zone());
BytecodeArrayBuilder builder(isolate(), zone(), 3, 3, &feedback_spec);
AstValueFactory ast_factory(zone(), isolate()->ast_string_constants(),
isolate()->heap()->HashSeed());
const AstValue* heap_num_0 = ast_factory.NewNumber(2.718);
@ -144,7 +145,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, AccessesFirst) {
RegisterList triple(0, 3);
Register param = Register::FromParameterIndex(2, builder.parameter_count());
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t feedback_slot = 97;
uint32_t feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
builder.LoadLiteral(heap_num_0)
.StoreAccumulatorInRegister(reg_0)
@ -168,7 +169,6 @@ TEST_F(BytecodeArrayRandomIteratorTest, AccessesFirst) {
.ForInPrepare(triple, feedback_slot)
.CallRuntime(Runtime::kLoadIC_Miss, reg_0)
.Debugger()
.LoadGlobal(name, 0x10000000, TypeofMode::NOT_INSIDE_TYPEOF)
.Return();
ast_factory.Internalize(isolate());
@ -189,7 +189,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, AccessesFirst) {
TEST_F(BytecodeArrayRandomIteratorTest, AccessesLast) {
// Use a builder to create an array with containing multiple bytecodes
// with 0, 1 and 2 operands.
BytecodeArrayBuilder builder(isolate(), zone(), 3, 3, 0);
FeedbackVectorSpec feedback_spec(zone());
BytecodeArrayBuilder builder(isolate(), zone(), 3, 3, &feedback_spec);
AstValueFactory ast_factory(zone(), isolate()->ast_string_constants(),
isolate()->heap()->HashSeed());
const AstValue* heap_num_0 = ast_factory.NewNumber(2.718);
@ -203,7 +204,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, AccessesLast) {
RegisterList triple(0, 3);
Register param = Register::FromParameterIndex(2, builder.parameter_count());
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t feedback_slot = 97;
uint32_t feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
builder.LoadLiteral(heap_num_0)
.StoreAccumulatorInRegister(reg_0)
@ -227,7 +228,6 @@ TEST_F(BytecodeArrayRandomIteratorTest, AccessesLast) {
.ForInPrepare(triple, feedback_slot)
.CallRuntime(Runtime::kLoadIC_Miss, reg_0)
.Debugger()
.LoadGlobal(name, 0x10000000, TypeofMode::NOT_INSIDE_TYPEOF)
.Return();
ast_factory.Internalize(isolate());
@ -239,7 +239,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, AccessesLast) {
int offset = bytecodeArray->length() -
Bytecodes::Size(Bytecode::kReturn, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kReturn);
EXPECT_EQ(iterator.current_index(), 23);
EXPECT_EQ(iterator.current_index(), 22);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
@ -248,7 +248,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, AccessesLast) {
TEST_F(BytecodeArrayRandomIteratorTest, RandomAccessValid) {
// Use a builder to create an array with containing multiple bytecodes
// with 0, 1 and 2 operands.
BytecodeArrayBuilder builder(isolate(), zone(), 3, 3, 0);
FeedbackVectorSpec feedback_spec(zone());
BytecodeArrayBuilder builder(isolate(), zone(), 3, 3, &feedback_spec);
AstValueFactory ast_factory(zone(), isolate()->ast_string_constants(),
isolate()->heap()->HashSeed());
const AstValue* heap_num_0 = ast_factory.NewNumber(2.718);
@ -263,7 +264,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, RandomAccessValid) {
Register param = Register::FromParameterIndex(2, builder.parameter_count());
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t name_index = 2;
uint32_t feedback_slot = 97;
uint32_t feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
builder.LoadLiteral(heap_num_0)
.StoreAccumulatorInRegister(reg_0)
@ -287,7 +288,6 @@ TEST_F(BytecodeArrayRandomIteratorTest, RandomAccessValid) {
.ForInPrepare(triple, feedback_slot)
.CallRuntime(Runtime::kLoadIC_Miss, reg_0)
.Debugger()
.LoadGlobal(name, 0x10000000, TypeofMode::NOT_INSIDE_TYPEOF)
.Return();
// Test iterator sees the expected output from the builder.
@ -392,7 +392,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, RandomAccessValid) {
EXPECT_EQ(iterator.GetRegisterOperandRange(0), 1);
ASSERT_TRUE(iterator.IsValid());
iterator.GoToIndex(23);
iterator.GoToIndex(22);
offset = Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
@ -417,11 +417,9 @@ TEST_F(BytecodeArrayRandomIteratorTest, RandomAccessValid) {
offset += Bytecodes::Size(Bytecode::kForInPrepare, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kCallRuntime, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kDebugger, OperandScale::kSingle);
offset += Bytecodes::Size(Bytecode::kLdaGlobal, OperandScale::kQuadruple) +
kPrefixByteSize;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kReturn);
EXPECT_EQ(iterator.current_index(), 23);
EXPECT_EQ(iterator.current_index(), 22);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
@ -436,7 +434,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, RandomAccessValid) {
TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
// Use a builder to create an array with containing multiple bytecodes
// with 0, 1 and 2 operands.
BytecodeArrayBuilder builder(isolate(), zone(), 3, 3, 0);
FeedbackVectorSpec feedback_spec(zone());
BytecodeArrayBuilder builder(isolate(), zone(), 3, 3, &feedback_spec);
AstValueFactory ast_factory(zone(), isolate()->ast_string_constants(),
isolate()->heap()->HashSeed());
const AstValue* heap_num_0 = ast_factory.NewNumber(2.718);
@ -451,7 +450,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
Register param = Register::FromParameterIndex(2, builder.parameter_count());
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t name_index = 2;
uint32_t feedback_slot = 97;
uint32_t feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
builder.LoadLiteral(heap_num_0)
.StoreAccumulatorInRegister(reg_0)
@ -475,7 +474,6 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
.ForInPrepare(triple, feedback_slot)
.CallRuntime(Runtime::kLoadIC_Miss, reg_0)
.Debugger()
.LoadGlobal(name, 0x10000000, TypeofMode::NOT_INSIDE_TYPEOF)
.Return();
// Test iterator sees the expected output from the builder.
@ -705,18 +703,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
offset += Bytecodes::Size(Bytecode::kDebugger, OperandScale::kSingle);
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaGlobal);
EXPECT_EQ(iterator.current_index(), 22);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kQuadruple);
EXPECT_EQ(iterator.current_bytecode_size(), 10);
EXPECT_EQ(iterator.GetIndexOperand(1), 0x10000000u);
offset += Bytecodes::Size(Bytecode::kLdaGlobal, OperandScale::kQuadruple) +
kPrefixByteSize;
++iterator;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kReturn);
EXPECT_EQ(iterator.current_index(), 23);
EXPECT_EQ(iterator.current_index(), 22);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
@ -727,7 +715,8 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArray) {
TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
// Use a builder to create an array with containing multiple bytecodes
// with 0, 1 and 2 operands.
BytecodeArrayBuilder builder(isolate(), zone(), 3, 3, 0);
FeedbackVectorSpec feedback_spec(zone());
BytecodeArrayBuilder builder(isolate(), zone(), 3, 3, &feedback_spec);
AstValueFactory ast_factory(zone(), isolate()->ast_string_constants(),
isolate()->heap()->HashSeed());
const AstValue* heap_num_0 = ast_factory.NewNumber(2.718);
@ -742,7 +731,7 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
Register param = Register::FromParameterIndex(2, builder.parameter_count());
const AstRawString* name = ast_factory.GetOneByteString("abc");
uint32_t name_index = 2;
uint32_t feedback_slot = 97;
uint32_t feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
builder.LoadLiteral(heap_num_0)
.StoreAccumulatorInRegister(reg_0)
@ -766,7 +755,6 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
.ForInPrepare(triple, feedback_slot)
.CallRuntime(Runtime::kLoadIC_Miss, reg_0)
.Debugger()
.LoadGlobal(name, 0x10000000, TypeofMode::NOT_INSIDE_TYPEOF)
.Return();
// Test iterator sees the expected output from the builder.
@ -780,22 +768,12 @@ TEST_F(BytecodeArrayRandomIteratorTest, IteratesBytecodeArrayBackwards) {
offset -= Bytecodes::Size(Bytecode::kReturn, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kReturn);
EXPECT_EQ(iterator.current_index(), 23);
EXPECT_EQ(iterator.current_index(), 22);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
ASSERT_TRUE(iterator.IsValid());
--iterator;
offset -= Bytecodes::Size(Bytecode::kLdaGlobal, OperandScale::kQuadruple) +
kPrefixByteSize;
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kLdaGlobal);
EXPECT_EQ(iterator.current_index(), 22);
EXPECT_EQ(iterator.current_offset(), offset);
EXPECT_EQ(iterator.current_operand_scale(), OperandScale::kQuadruple);
EXPECT_EQ(iterator.current_bytecode_size(), 10);
EXPECT_EQ(iterator.GetIndexOperand(1), 0x10000000u);
--iterator;
offset -= Bytecodes::Size(Bytecode::kDebugger, OperandScale::kSingle);
EXPECT_EQ(iterator.current_bytecode(), Bytecode::kDebugger);
EXPECT_EQ(iterator.current_index(), 21);