• 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@hasSameInstanceTypeAsParent
13@doNotGenerateCast
14extern class MutableBigInt extends BigIntBase generates 'TNode<BigInt>';
15
16Convert<BigInt, MutableBigInt>(i: MutableBigInt): BigInt {
17  dcheck(bigint::IsCanonicalized(i));
18  return %RawDownCast<BigInt>(Convert<BigIntBase>(i));
19}
20