Line data Source code
1 : // Copyright 2016 the V8 project authors. All rights reserved.
2 : // Use of this source code is governed by a BSD-style license that can be
3 : // found in the LICENSE file.
4 :
5 : #include "src/ast/ast-function-literal-id-reindexer.h"
6 : #include "src/objects-inl.h"
7 :
8 : #include "src/ast/ast.h"
9 :
10 : namespace v8 {
11 : namespace internal {
12 :
13 279 : AstFunctionLiteralIdReindexer::AstFunctionLiteralIdReindexer(size_t stack_limit,
14 : int delta)
15 279 : : AstTraversalVisitor(stack_limit), delta_(delta) {}
16 :
17 : AstFunctionLiteralIdReindexer::~AstFunctionLiteralIdReindexer() = default;
18 :
19 623 : void AstFunctionLiteralIdReindexer::Reindex(Expression* pattern) {
20 623 : Visit(pattern);
21 623 : }
22 :
23 315 : void AstFunctionLiteralIdReindexer::VisitFunctionLiteral(FunctionLiteral* lit) {
24 315 : AstTraversalVisitor::VisitFunctionLiteral(lit);
25 315 : lit->set_function_literal_id(lit->function_literal_id() + delta_);
26 315 : }
27 :
28 : } // namespace internal
29 121996 : } // namespace v8
|