v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
local-isolate.cc
Go to the documentation of this file.
1// Copyright 2020 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
6
7#include "src/bigint/bigint.h"
13
14namespace v8 {
15namespace internal {
16
18 : HiddenLocalFactory(isolate),
19 heap_(isolate->heap(), kind),
20 isolate_(isolate),
21 logger_(new LocalLogger(isolate)),
22 thread_id_(ThreadId::Current()),
24 ? isolate->stack_guard()->real_climit()
25 : GetCurrentStackPosition() - v8_flags.stack_size * KB)
26#ifdef V8_INTL_SUPPORT
27 ,
28 default_locale_(isolate->DefaultLocale())
29#endif
30{
31#ifdef V8_RUNTIME_CALL_STATS
32 if (kind == ThreadKind::kMain) {
33 runtime_call_stats_ = isolate->counters()->runtime_call_stats();
34 } else {
35 rcs_scope_.emplace(isolate->counters()->worker_thread_runtime_call_stats());
36 runtime_call_stats_ = rcs_scope_->Get();
37 }
38#endif
39}
40
44
54
56
57// Used for lazy initialization, based on an assumption that most
58// LocalIsolates won't be used to parse any BigInt literals.
62
63// static
65 return GetCurrentStackPosition() < local_isolate->stack_limit();
66}
67
68#ifdef V8_INTL_SUPPORT
69// WARNING: This might be out-of-sync with the main-thread.
70const std::string& LocalIsolate::DefaultLocale() {
71 const std::string& res =
72 is_main_thread() ? isolate_->DefaultLocale() : default_locale_;
73 DCHECK(!res.empty());
74 return res;
75}
76#endif
77
78} // namespace internal
79} // namespace v8
Isolate * isolate_
Builtins::Kind kind
Definition builtins.cc:40
static Processor * New(Platform *platform)
void RegisterDeserializerStarted()
Definition isolate.h:925
void RegisterDeserializerFinished()
Definition isolate.h:926
bool has_active_deserializer() const
Definition isolate.h:927
LocalIsolate(Isolate *isolate, ThreadKind kind)
bigint::Processor * bigint_processor_
bool has_active_deserializer() const
uintptr_t GetCurrentStackPosition()
Definition utils.cc:222
V8_EXPORT_PRIVATE FlagValues v8_flags
const uintptr_t stack_limit_
#define DCHECK(condition)
Definition logging.h:482
Heap * heap_