Welcome to mirror list, hosted at ThFree Co, Russian Federation.

global-context.cc « torque « src « v8 « deps - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 35ddb1d2e264e17153954e5ee47d97733c3c2ea5 (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
// Copyright 2019 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/torque/global-context.h"

namespace v8 {
namespace internal {
namespace torque {

DEFINE_CONTEXTUAL_VARIABLE(GlobalContext)
DEFINE_CONTEXTUAL_VARIABLE(TargetArchitecture)

GlobalContext::GlobalContext(Ast ast)
    : collect_language_server_data_(false),
      force_assert_statements_(false),
      ast_(std::move(ast)) {
  CurrentScope::Scope current_scope(nullptr);
  CurrentSourcePosition::Scope current_source_position(
      SourcePosition{CurrentSourceFile::Get(), {-1, -1}, {-1, -1}});
  default_namespace_ =
      RegisterDeclarable(std::make_unique<Namespace>(kBaseNamespaceName));
}

TargetArchitecture::TargetArchitecture(bool force_32bit)
    : tagged_size_(force_32bit ? sizeof(int32_t) : kTaggedSize),
      raw_ptr_size_(force_32bit ? sizeof(int32_t) : kSystemPointerSize),
      smi_tag_and_shift_size_(
          kSmiTagSize + (force_32bit ? SmiTagging<kApiInt32Size>::kSmiShiftSize
                                     : kSmiShiftSize)),
      external_ptr_size_(force_32bit ? sizeof(int32_t) : kExternalPointerSize) {
}

}  // namespace torque
}  // namespace internal
}  // namespace v8