v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
parsing.h
Go to the documentation of this file.
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
#ifndef V8_PARSING_PARSING_H_
6
#define V8_PARSING_PARSING_H_
7
8
#include "
src/common/globals.h
"
9
10
namespace
v8
{
11
namespace
internal
{
12
13
class
ParseInfo;
14
class
SharedFunctionInfo;
15
16
namespace
parsing {
17
18
enum class
ReportStatisticsMode
{
kYes
,
kNo
};
19
20
// Parses the top-level source code represented by the parse info and sets its
21
// function literal. Returns false (and deallocates any allocated AST nodes) if
22
// parsing failed.
23
V8_EXPORT_PRIVATE
bool
ParseProgram
(
ParseInfo
* info,
24
DirectHandle<Script>
script,
25
Isolate
* isolate,
26
ReportStatisticsMode
mode);
27
28
// Parses the top-level source code represented by the parse info and sets its
29
// function literal. Allows passing an |outer_scope| for programs that exist in
30
// another scope (e.g. eval). Returns false (and deallocates any allocated AST
31
// nodes) if parsing failed.
32
V8_EXPORT_PRIVATE
bool
ParseProgram
(
ParseInfo
* info,
33
DirectHandle<Script>
script,
34
MaybeDirectHandle<ScopeInfo>
outer_scope,
35
Isolate
* isolate,
36
ReportStatisticsMode
mode);
37
38
// Like ParseProgram but for an individual function which already has a
39
// allocated shared function info.
40
V8_EXPORT_PRIVATE
bool
ParseFunction
(
41
ParseInfo
* info,
DirectHandle<SharedFunctionInfo>
shared_info,
42
Isolate
* isolate,
ReportStatisticsMode
mode);
43
44
// If you don't know whether info->is_toplevel() is true or not, use this method
45
// to dispatch to either of the above functions. Prefer to use the above methods
46
// whenever possible.
47
V8_EXPORT_PRIVATE
bool
ParseAny
(
ParseInfo
* info,
48
DirectHandle<SharedFunctionInfo>
shared_info,
49
Isolate
* isolate,
ReportStatisticsMode
mode);
50
51
}
// namespace parsing
52
}
// namespace internal
53
}
// namespace v8
54
55
#endif
// V8_PARSING_PARSING_H_
v8::internal::DirectHandle
Definition
handles.h:659
v8::internal::Isolate
Definition
isolate.h:586
v8::internal::MaybeDirectHandle
Definition
maybe-handles.h:241
v8::internal::ParseInfo
Definition
parse-info.h:227
globals.h
v8::internal::parsing::ParseAny
bool ParseAny(ParseInfo *info, DirectHandle< SharedFunctionInfo > shared_info, Isolate *isolate, ReportStatisticsMode mode)
Definition
parsing.cc:98
v8::internal::parsing::ReportStatisticsMode
ReportStatisticsMode
Definition
parsing.h:18
v8::internal::parsing::ReportStatisticsMode::kYes
@ kYes
v8::internal::parsing::ReportStatisticsMode::kNo
@ kNo
v8::internal::parsing::ParseFunction
bool ParseFunction(ParseInfo *info, DirectHandle< SharedFunctionInfo > shared_info, Isolate *isolate, ReportStatisticsMode mode)
Definition
parsing.cc:67
v8::internal::parsing::ParseProgram
bool ParseProgram(ParseInfo *info, DirectHandle< Script > script, MaybeDirectHandle< ScopeInfo > maybe_outer_scope_info, Isolate *isolate, ReportStatisticsMode mode)
Definition
parsing.cc:39
v8::internal::internal
internal
Definition
wasm-objects-inl.h:458
v8
Definition
api-arguments-inl.h:19
V8_EXPORT_PRIVATE
#define V8_EXPORT_PRIVATE
Definition
macros.h:460
src
parsing
parsing.h
Generated on Sun Apr 6 2025 21:08:56 for v8 by
1.12.0