• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
5// TODO(nicohartmann): Discuss whether types used by multiple builtins should be
6// in global namespace
7extern class BigIntBase extends PrimitiveHeapObject
8    generates 'TNode<BigInt>' {}
9
10type BigInt extends BigIntBase;
11
12@noVerifier
13@hasSameInstanceTypeAsParent
14@doNotGenerateCast
15extern class MutableBigInt extends BigIntBase generates 'TNode<BigInt>' {
16}
17
18Convert<BigInt, MutableBigInt>(i: MutableBigInt): BigInt {
19  assert(bigint::IsCanonicalized(i));
20  return %RawDownCast<BigInt>(Convert<BigIntBase>(i));
21}
22