forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabstract-code.cc
More file actions
33 lines (27 loc) · 990 Bytes
/
abstract-code.cc
File metadata and controls
33 lines (27 loc) · 990 Bytes
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
// Copyright 2023 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/objects/abstract-code.h"
#include "src/objects/abstract-code-inl.h"
namespace v8 {
namespace internal {
int AbstractCode::SourcePosition(Isolate* isolate, int offset) {
PtrComprCageBase cage_base(isolate);
Tagged<Map> map_object = map(cage_base);
if (InstanceTypeChecker::IsCode(map_object)) {
return GetCode()->SourcePosition(offset);
} else {
return GetBytecodeArray()->SourcePosition(offset);
}
}
int AbstractCode::SourceStatementPosition(Isolate* isolate, int offset) {
PtrComprCageBase cage_base(isolate);
Tagged<Map> map_object = map(cage_base);
if (InstanceTypeChecker::IsCode(map_object)) {
return GetCode()->SourceStatementPosition(offset);
} else {
return GetBytecodeArray()->SourceStatementPosition(offset);
}
}
} // namespace internal
} // namespace v8