V8 Project
v8::internal::BackgroundParsingTask Class Reference

#include <background-parsing-task.h>

+ Inheritance diagram for v8::internal::BackgroundParsingTask:
+ Collaboration diagram for v8::internal::BackgroundParsingTask:

Public Member Functions

 BackgroundParsingTask (StreamedSource *source, ScriptCompiler::CompileOptions options, int stack_size, Isolate *isolate)
 
virtual void Run ()
 
- Public Member Functions inherited from v8::ScriptCompiler::ScriptStreamingTask
virtual ~ScriptStreamingTask ()
 

Private Attributes

StreamedSourcesource_
 
ScriptCompiler::CompileOptions options_
 
int stack_size_
 

Detailed Description

Definition at line 51 of file background-parsing-task.h.

Constructor & Destructor Documentation

◆ BackgroundParsingTask()

v8::internal::BackgroundParsingTask::BackgroundParsingTask ( StreamedSource source,
ScriptCompiler::CompileOptions  options,
int  stack_size,
Isolate isolate 
)

Definition at line 10 of file background-parsing-task.cc.

13  : source_(source), options_(options), stack_size_(stack_size) {
14  // Prepare the data for the internalization phase and compilation phase, which
15  // will happen in the main thread after parsing.
16  source->info.Reset(new i::CompilationInfoWithZone(source->source_stream.get(),
17  source->encoding, isolate));
18  source->info->MarkAsGlobal();
19 
20  // We don't set the context to the CompilationInfo yet, because the background
21  // thread cannot do anything with it anyway. We set it just before compilation
22  // on the foreground thread.
26  source->allow_lazy =
27  !i::Compiler::DebuggerWantsEagerCompilation(source->info.get());
28  source->hash_seed = isolate->heap()->HashSeed();
29 }
@ kProduceParserCache
Definition: v8.h:1161
@ kProduceCodeCache
Definition: v8.h:1163
@ kNoCompileOptions
Definition: v8.h:1160
ScriptCompiler::CompileOptions options_
static bool DebuggerWantsEagerCompilation(CompilationInfo *info, bool allow_lazy_without_ctx=false)
Definition: compiler.cc:1404
#define DCHECK(condition)
Definition: logging.h:205

References v8::internal::StreamedSource::allow_lazy, DCHECK, v8::internal::Compiler::DebuggerWantsEagerCompilation(), v8::internal::StreamedSource::encoding, v8::internal::StreamedSource::hash_seed, v8::internal::Heap::HashSeed(), v8::internal::Isolate::heap(), v8::internal::StreamedSource::info, v8::ScriptCompiler::kNoCompileOptions, v8::ScriptCompiler::kProduceCodeCache, v8::ScriptCompiler::kProduceParserCache, and v8::internal::StreamedSource::source_stream.

+ Here is the call graph for this function:

Member Function Documentation

◆ Run()

void v8::internal::BackgroundParsingTask::Run ( )
virtual

Implements v8::ScriptCompiler::ScriptStreamingTask.

Definition at line 32 of file background-parsing-task.cc.

32  {
33  DisallowHeapAllocation no_allocation;
34  DisallowHandleAllocation no_handles;
36 
37  ScriptData* script_data = NULL;
40  source_->info->SetCachedData(&script_data, options_);
41  }
42 
43  uintptr_t limit = reinterpret_cast<uintptr_t>(&limit) - stack_size_ * KB;
44  Parser::ParseInfo parse_info = {limit, source_->hash_seed,
46 
47  // Parser needs to stay alive for finalizing the parsing on the main
48  // thread. Passing &parse_info is OK because Parser doesn't store it.
49  source_->parser.Reset(new Parser(source_->info.get(), &parse_info));
50  source_->parser->set_allow_lazy(source_->allow_lazy);
51  source_->parser->ParseOnBackground();
52 
53  if (script_data != NULL) {
54  source_->cached_data.Reset(new ScriptCompiler::CachedData(
55  script_data->data(), script_data->length(),
57  script_data->ReleaseDataOwnership();
58  delete script_data;
59  }
60 }
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
const int KB
Definition: globals.h:106
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
Definition: assert-scope.h:110
PerThreadAssertScopeDebugOnly< HANDLE_DEREFERENCE_ASSERT, false > DisallowHandleDereference
Definition: assert-scope.h:118
PerThreadAssertScopeDebugOnly< HANDLE_ALLOCATION_ASSERT, false > DisallowHandleAllocation
Definition: assert-scope.h:102
SmartPointer< ScriptCompiler::CachedData > cached_data
SmartPointer< CompilationInfo > info

References v8::internal::StreamedSource::allow_lazy, v8::ScriptCompiler::CachedData::BufferOwned, v8::internal::StreamedSource::cached_data, v8::internal::ScriptData::data(), v8::internal::StreamedSource::hash_seed, v8::internal::StreamedSource::info, v8::internal::KB, v8::ScriptCompiler::kProduceCodeCache, v8::ScriptCompiler::kProduceParserCache, v8::internal::ScriptData::length(), NULL, options_, v8::internal::StreamedSource::parser, v8::internal::ScriptData::ReleaseDataOwnership(), source_, stack_size_, and v8::internal::StreamedSource::unicode_cache.

+ Here is the call graph for this function:

Member Data Documentation

◆ options_

ScriptCompiler::CompileOptions v8::internal::BackgroundParsingTask::options_
private

Definition at line 61 of file background-parsing-task.h.

Referenced by Run().

◆ source_

StreamedSource* v8::internal::BackgroundParsingTask::source_
private

Definition at line 60 of file background-parsing-task.h.

Referenced by Run().

◆ stack_size_

int v8::internal::BackgroundParsingTask::stack_size_
private

Definition at line 62 of file background-parsing-task.h.

Referenced by Run().


The documentation for this class was generated from the following files: