v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
platform.cc
Go to the documentation of this file.
1// Copyright 2023 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
7namespace v8 {
8namespace base {
9
10namespace {
11
12// A pointer to current thread's stack beginning.
13thread_local void* thread_stack_start = nullptr;
14
15} // namespace
16
17// static
19 if (!thread_stack_start) {
20 thread_stack_start = ObtainCurrentThreadStackStart();
21 }
22 return thread_stack_start;
23}
24
25// static
27
28// static
30 static thread_local int id = GetCurrentThreadIdInternal();
31 return id;
32}
33
34} // namespace base
35} // namespace v8
static int GetCurrentThreadIdInternal()
static int GetCurrentThreadId()
Definition platform.cc:29
static StackSlot GetStackStartUnchecked()
Definition platform.cc:18
static StackSlot GetStackStart()
static Stack::StackSlot ObtainCurrentThreadStackStart()