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

ic.tq « builtins « src « v8 « deps - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f6fecc557f479f9787b7201840beef356bd1f949 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// 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.

namespace ic {

// --- The public interface (forwards to the actual implementation).

@export
macro CollectCallFeedback(
    maybeTarget: JSAny, context: Context,
    maybeFeedbackVector: Undefined|FeedbackVector, slotId: uintptr): void {
  callable::CollectCallFeedback(
      maybeTarget, context, maybeFeedbackVector, slotId);
}

@export
macro CollectInstanceOfFeedback(
    maybeTarget: JSAny, context: Context,
    maybeFeedbackVector: Undefined|FeedbackVector, slotId: uintptr): void {
  callable::CollectInstanceOfFeedback(
      maybeTarget, context, maybeFeedbackVector, slotId);
}

@export
macro CollectConstructFeedback(implicit context: Context)(
    target: JSAny, newTarget: JSAny,
    maybeFeedbackVector: Undefined|FeedbackVector,
    slotId: uintptr): never labels ConstructGeneric,
    ConstructArray(AllocationSite) {
  callable::CollectConstructFeedback(
      target, newTarget, maybeFeedbackVector, slotId)
      otherwise ConstructGeneric, ConstructArray;
}

// --- Common functionality.

extern macro MegamorphicSymbolConstant(): Symbol;
extern macro UninitializedSymbolConstant(): Symbol;

const kMegamorphicSymbol: Symbol = MegamorphicSymbolConstant();
const kUninitializedSymbol: Symbol = UninitializedSymbolConstant();

macro IsMegamorphic(feedback: MaybeObject): bool {
  return TaggedEqual(feedback, kMegamorphicSymbol);
}

macro IsUninitialized(feedback: MaybeObject): bool {
  return TaggedEqual(feedback, kUninitializedSymbol);
}

extern macro LoadFeedbackVectorSlot(FeedbackVector, uintptr): MaybeObject;
extern macro StoreFeedbackVectorSlot(
    FeedbackVector, uintptr, MaybeObject): void;
extern macro StoreWeakReferenceInFeedbackVector(
    FeedbackVector, uintptr, HeapObject): MaybeObject;
extern macro ReportFeedbackUpdate(FeedbackVector, uintptr, constexpr string);

}  // namespace ic