blob: c08d51d7b47180c17552992479b956ef331aa3ac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/execution/off-thread-isolate.h"
#include "src/execution/isolate.h"
#include "src/execution/thread-id.h"
#include "src/logging/off-thread-logger.h"
namespace v8 {
namespace internal {
OffThreadIsolate::OffThreadIsolate(Isolate* isolate, Zone* zone)
: HiddenOffThreadFactory(isolate),
isolate_(isolate),
logger_(new OffThreadLogger()),
handle_zone_(zone) {}
OffThreadIsolate::~OffThreadIsolate() { delete logger_; }
int OffThreadIsolate::GetNextScriptId() { return isolate_->GetNextScriptId(); }
#if V8_SFI_HAS_UNIQUE_ID
int OffThreadIsolate::GetNextUniqueSharedFunctionInfoId() {
return isolate_->GetNextUniqueSharedFunctionInfoId();
}
#endif // V8_SFI_HAS_UNIQUE_ID
bool OffThreadIsolate::NeedsSourcePositionsForProfiling() {
// TODO(leszeks): Figure out if it makes sense to check this asynchronously.
return isolate_->NeedsSourcePositionsForProfiling();
}
bool OffThreadIsolate::is_collecting_type_profile() {
// TODO(leszeks): Figure out if it makes sense to check this asynchronously.
return isolate_->is_collecting_type_profile();
}
void OffThreadIsolate::PinToCurrentThread() {
DCHECK(!thread_id_.IsValid());
thread_id_ = ThreadId::Current();
}
} // namespace internal
} // namespace v8
|