2016-11-28 11:40:22 +00:00
|
|
|
// Copyright 2016 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#include "src/ast/ast-function-literal-id-reindexer.h"
|
2019-05-23 08:51:46 +00:00
|
|
|
#include "src/objects/objects-inl.h"
|
2016-11-28 11:40:22 +00:00
|
|
|
|
|
|
|
#include "src/ast/ast.h"
|
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
|
|
|
AstFunctionLiteralIdReindexer::AstFunctionLiteralIdReindexer(size_t stack_limit,
|
|
|
|
int delta)
|
|
|
|
: AstTraversalVisitor(stack_limit), delta_(delta) {}
|
|
|
|
|
2018-09-13 10:03:24 +00:00
|
|
|
AstFunctionLiteralIdReindexer::~AstFunctionLiteralIdReindexer() = default;
|
2016-11-28 11:40:22 +00:00
|
|
|
|
|
|
|
void AstFunctionLiteralIdReindexer::Reindex(Expression* pattern) {
|
|
|
|
Visit(pattern);
|
|
|
|
}
|
|
|
|
|
|
|
|
void AstFunctionLiteralIdReindexer::VisitFunctionLiteral(FunctionLiteral* lit) {
|
|
|
|
AstTraversalVisitor::VisitFunctionLiteral(lit);
|
|
|
|
lit->set_function_literal_id(lit->function_literal_id() + delta_);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|