[vm] Decouple intrinsifier code from runtime

This is the next step towards preventing compiler from directly peeking
into runtime and instead interact with runtime through a well defined
surface.

This CL decouples the hand-written intrinsifier code from the runtime:

  * the intrinsifier is split up into a GraphIntrinsifier and AsmIntrinsifier
  * the recognized methods list is moved to a separate .h file
  * all intrinsifier code is moved into dart::compiler namespace
  * the AsmIntrinsifier is only interacting with RT through runtime_api.h

Issue https://github.com/dart-lang/sdk/issues/31709

Change-Id: I0a73ad620e051dd49c9db7da3241212b3b74ccdd
Reviewed-on: https://dart-review.googlesource.com/c/92740
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
This commit is contained in:
Martin Kustermann 2019-02-13 17:22:56 +00:00 committed by commit-bot@chromium.org
parent 4510fa08ca
commit 525b43d747
25 changed files with 4174 additions and 3655 deletions

View file

@ -0,0 +1,44 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Class for intrinsifying functions.
#if !defined(DART_PRECOMPILED_RUNTIME)
#define SHOULD_NOT_INCLUDE_RUNTIME
#include "vm/compiler/asm_intrinsifier.h"
namespace dart {
namespace compiler {
#if !defined(TARGET_ARCH_DBC)
void AsmIntrinsifier::String_identityHash(Assembler* assembler,
Label* normal_ir_body) {
String_getHashCode(assembler, normal_ir_body);
}
void AsmIntrinsifier::Double_identityHash(Assembler* assembler,
Label* normal_ir_body) {
Double_hashCode(assembler, normal_ir_body);
}
void AsmIntrinsifier::RegExp_ExecuteMatch(Assembler* assembler,
Label* normal_ir_body) {
AsmIntrinsifier::IntrinsifyRegExpExecuteMatch(assembler, normal_ir_body,
/*sticky=*/false);
}
void AsmIntrinsifier::RegExp_ExecuteMatchSticky(Assembler* assembler,
Label* normal_ir_body) {
AsmIntrinsifier::IntrinsifyRegExpExecuteMatch(assembler, normal_ir_body,
/*sticky=*/true);
}
#endif // !defined(TARGET_ARCH_DBC)
} // namespace compiler
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -0,0 +1,60 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Class for intrinsifying functions.
#ifndef RUNTIME_VM_COMPILER_ASM_INTRINSIFIER_H_
#define RUNTIME_VM_COMPILER_ASM_INTRINSIFIER_H_
#include "vm/allocation.h"
#include "vm/compiler/recognized_methods_list.h"
namespace dart {
// Forward declarations.
class FlowGraphCompiler;
class Function;
class TargetEntryInstr;
class ParsedFunction;
class FlowGraph;
namespace compiler {
class Assembler;
class Label;
class AsmIntrinsifier : public AllStatic {
public:
static intptr_t ParameterSlotFromSp();
static void IntrinsicCallPrologue(Assembler* assembler);
static void IntrinsicCallEpilogue(Assembler* assembler);
private:
friend class Intrinsifier;
// The "_A" value used in the intrinsification of
// `runtime/lib/math_patch.dart:_Random._nextState()`
static const int64_t kRandomAValue = 0xffffda61;
static bool CanIntrinsify(const Function& function);
#define DECLARE_FUNCTION(class_name, function_name, enum_name, fp) \
static void enum_name(Assembler* assembler, Label* normal_ir_body);
ALL_INTRINSICS_LIST(DECLARE_FUNCTION)
// On DBC all intrinsics are handled the same way.
#if defined(TARGET_ARCH_DBC)
GRAPH_INTRINSICS_LIST(DECLARE_FUNCTION)
#endif // defined(TARGET_ARCH_DBC)
#undef DECLARE_FUNCTION
static void IntrinsifyRegExpExecuteMatch(Assembler* assembler,
Label* normal_ir_body,
bool sticky);
};
} // namespace compiler
} // namespace dart
#endif // RUNTIME_VM_COMPILER_ASM_INTRINSIFIER_H_

View file

@ -5,28 +5,21 @@
#include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC.
#if defined(TARGET_ARCH_DBC)
#define SHOULD_NOT_INCLUDE_RUNTIME
#include "vm/class_id.h"
#include "vm/compiler/asm_intrinsifier.h"
#include "vm/compiler/assembler/assembler.h"
#include "vm/compiler/intrinsifier.h"
#include "vm/compiler/assembler/assembler.h"
#include "vm/compiler/backend/flow_graph_compiler.h"
#include "vm/cpu.h"
#include "vm/dart_entry.h"
#include "vm/object.h"
#include "vm/object_store.h"
#include "vm/regexp_assembler.h"
#include "vm/simulator.h"
#include "vm/symbols.h"
namespace dart {
namespace compiler {
DECLARE_FLAG(bool, interpret_irregexp);
intptr_t Intrinsifier::ParameterSlotFromSp() {
return -1;
}
#define DEFINE_FUNCTION(class_name, test_function_name, enum_name, fp) \
void Intrinsifier::enum_name(Assembler* assembler, Label* normal_ir_body) { \
void AsmIntrinsifier::enum_name(Assembler* assembler, \
Label* normal_ir_body) { \
if (Simulator::IsSupportedIntrinsic(Simulator::k##enum_name##Intrinsic)) { \
assembler->Intrinsic(Simulator::k##enum_name##Intrinsic); \
} \
@ -37,6 +30,7 @@ ALL_INTRINSICS_LIST(DEFINE_FUNCTION)
GRAPH_INTRINSICS_LIST(DEFINE_FUNCTION)
#undef DEFINE_FUNCTION
} // namespace compiler
} // namespace dart
#endif // defined TARGET_ARCH_DBC

View file

@ -17,6 +17,10 @@ namespace dart {
class LoopHierarchy;
class VariableLivenessAnalysis;
namespace compiler {
class GraphIntrinsifier;
}
class BlockIterator : public ValueObject {
public:
explicit BlockIterator(const GrowableArray<BlockEntryInstr*>& block_order)
@ -415,7 +419,7 @@ class FlowGraph : public ZoneAllocated {
friend class BranchSimplifier;
friend class ConstantPropagator;
friend class DeadCodeElimination;
friend class Intrinsifier;
friend class compiler::GraphIntrinsifier;
// SSA transformation methods and fields.
void ComputeDominators(GrowableArray<BitVector*>* dominance_frontier);

View file

@ -1220,7 +1220,7 @@ bool FlowGraphCompiler::TryIntrinsify() {
EnterIntrinsicMode();
SpecialStatsBegin(CombinedCodeStatistics::kTagIntrinsics);
bool complete = Intrinsifier::Intrinsify(parsed_function(), this);
bool complete = compiler::Intrinsifier::Intrinsify(parsed_function(), this);
SpecialStatsEnd(CombinedCodeStatistics::kTagIntrinsics);
ExitIntrinsicMode();

View file

@ -45,6 +45,10 @@ class RangeBoundary;
class UnboxIntegerInstr;
class TypeUsageInfo;
namespace compiler {
class BlockBuilder;
}
class Value : public ZoneAllocated {
public:
// A forward iterator that allows removing the current value from the
@ -7834,7 +7838,7 @@ class Environment : public ZoneAllocated {
private:
friend class ShallowIterator;
friend class BlockBuilder; // For Environment constructor.
friend class compiler::BlockBuilder; // For Environment constructor.
Environment(intptr_t length,
intptr_t fixed_parameter_count,

View file

@ -9,6 +9,13 @@ compiler_sources = [
"aot/aot_call_specializer.h",
"aot/precompiler.cc",
"aot/precompiler.h",
"asm_intrinsifier.cc",
"asm_intrinsifier.h",
"asm_intrinsifier_arm.cc",
"asm_intrinsifier_arm64.cc",
"asm_intrinsifier_dbc.cc",
"asm_intrinsifier_ia32.cc",
"asm_intrinsifier_x64.cc",
"assembler/assembler.cc",
"assembler/assembler.h",
"assembler/assembler_arm.cc",
@ -36,9 +43,9 @@ compiler_sources = [
"backend/branch_optimizer.h",
"backend/code_statistics.cc",
"backend/code_statistics.h",
"backend/compile_type.h",
"backend/constant_propagator.cc",
"backend/constant_propagator.h",
"backend/compile_type.h",
"backend/flow_graph.cc",
"backend/flow_graph.h",
"backend/flow_graph_checker.cc",
@ -107,29 +114,31 @@ compiler_sources = [
"frontend/prologue_builder.h",
"frontend/scope_builder.cc",
"frontend/scope_builder.h",
"graph_intrinsifier.cc",
"graph_intrinsifier.h",
"graph_intrinsifier_arm.cc",
"graph_intrinsifier_arm64.cc",
"graph_intrinsifier_ia32.cc",
"graph_intrinsifier_x64.cc",
"intrinsifier.cc",
"intrinsifier.h",
"intrinsifier_arm.cc",
"intrinsifier_arm64.cc",
"intrinsifier_dbc.cc",
"intrinsifier_ia32.cc",
"intrinsifier_x64.cc",
"jit/compiler.cc",
"jit/compiler.h",
"jit/jit_call_specializer.cc",
"jit/jit_call_specializer.h",
"method_recognizer.cc",
"method_recognizer.h",
"recognized_methods_list.h",
"relocation.cc",
"relocation.h",
"runtime_api.cc",
"runtime_api.h",
"stub_code_compiler.h",
"stub_code_compiler_arm.cc",
"stub_code_compiler_arm64.cc",
"stub_code_compiler_dbc.cc",
"stub_code_compiler_ia32.cc",
"stub_code_compiler_x64.cc",
"relocation.cc",
"relocation.h",
"runtime_api.cc",
"runtime_api.h",
]
compiler_sources_tests = [

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,67 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Class for intrinsifying functions.
#ifndef RUNTIME_VM_COMPILER_GRAPH_INTRINSIFIER_H_
#define RUNTIME_VM_COMPILER_GRAPH_INTRINSIFIER_H_
#include "vm/allocation.h"
#include "vm/compiler/recognized_methods_list.h"
namespace dart {
// Forward declarations.
class FlowGraphCompiler;
class ParsedFunction;
class FlowGraph;
namespace compiler {
class Assembler;
class Label;
#if !defined(TARGET_ARCH_DBC)
class GraphIntrinsifier : public AllStatic {
public:
static intptr_t ParameterSlotFromSp();
static bool GraphIntrinsify(const ParsedFunction& parsed_function,
FlowGraphCompiler* compiler);
static void IntrinsicCallPrologue(Assembler* assembler);
static void IntrinsicCallEpilogue(Assembler* assembler);
private:
#define DECLARE_FUNCTION(class_name, function_name, enum_name, fp) \
static void enum_name(Assembler* assembler, Label* normal_ir_body);
// On DBC graph intrinsics are handled in the same way as non-graph ones.
GRAPH_INTRINSICS_LIST(DECLARE_FUNCTION)
#undef DECLARE_FUNCTION
#define DECLARE_FUNCTION(class_name, function_name, enum_name, fp) \
static bool Build_##enum_name(FlowGraph* flow_graph);
GRAPH_INTRINSICS_LIST(DECLARE_FUNCTION)
#undef DECLARE_FUNCTION
};
#else // !defined(TARGET_ARCH_DBC)
class GraphIntrinsifier : public AllStatic {
public:
static bool GraphIntrinsify(const ParsedFunction& parsed_function,
FlowGraphCompiler* compiler) {
return false;
}
};
#endif // !defined(TARGET_ARCH_DBC)
} // namespace compiler
} // namespace dart
#endif // RUNTIME_VM_COMPILER_GRAPH_INTRINSIFIER_H_

View file

@ -0,0 +1,45 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/compiler/assembler/assembler.h"
#include "vm/compiler/graph_intrinsifier.h"
namespace dart {
namespace compiler {
#define __ assembler->
intptr_t GraphIntrinsifier::ParameterSlotFromSp() {
return -1;
}
static bool IsABIPreservedRegister(Register reg) {
return ((1 << reg) & kAbiPreservedCpuRegs) != 0;
}
void GraphIntrinsifier::IntrinsicCallPrologue(Assembler* assembler) {
ASSERT(IsABIPreservedRegister(CODE_REG));
ASSERT(IsABIPreservedRegister(ARGS_DESC_REG));
ASSERT(IsABIPreservedRegister(CALLEE_SAVED_TEMP));
// Save LR by moving it to a callee saved temporary register.
assembler->Comment("IntrinsicCallPrologue");
assembler->mov(CALLEE_SAVED_TEMP, Operand(LR));
}
void GraphIntrinsifier::IntrinsicCallEpilogue(Assembler* assembler) {
// Restore LR.
assembler->Comment("IntrinsicCallEpilogue");
assembler->mov(LR, Operand(CALLEE_SAVED_TEMP));
}
#undef __
} // namespace compiler
} // namespace dart
#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -0,0 +1,50 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/compiler/assembler/assembler.h"
#include "vm/compiler/graph_intrinsifier.h"
namespace dart {
namespace compiler {
#define __ assembler->
intptr_t GraphIntrinsifier::ParameterSlotFromSp() {
return -1;
}
static bool IsABIPreservedRegister(Register reg) {
return ((1 << reg) & kAbiPreservedCpuRegs) != 0;
}
void GraphIntrinsifier::IntrinsicCallPrologue(Assembler* assembler) {
ASSERT(IsABIPreservedRegister(CODE_REG));
ASSERT(!IsABIPreservedRegister(ARGS_DESC_REG));
ASSERT(IsABIPreservedRegister(CALLEE_SAVED_TEMP));
ASSERT(IsABIPreservedRegister(CALLEE_SAVED_TEMP2));
ASSERT(CALLEE_SAVED_TEMP != CODE_REG);
ASSERT(CALLEE_SAVED_TEMP != ARGS_DESC_REG);
ASSERT(CALLEE_SAVED_TEMP2 != CODE_REG);
ASSERT(CALLEE_SAVED_TEMP2 != ARGS_DESC_REG);
assembler->Comment("IntrinsicCallPrologue");
assembler->mov(CALLEE_SAVED_TEMP, LR);
assembler->mov(CALLEE_SAVED_TEMP2, ARGS_DESC_REG);
}
void GraphIntrinsifier::IntrinsicCallEpilogue(Assembler* assembler) {
assembler->Comment("IntrinsicCallEpilogue");
assembler->mov(LR, CALLEE_SAVED_TEMP);
assembler->mov(ARGS_DESC_REG, CALLEE_SAVED_TEMP2);
}
#undef __
} // namespace compiler
} // namespace dart
#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -0,0 +1,37 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
#if defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/compiler/assembler/assembler.h"
#include "vm/compiler/graph_intrinsifier.h"
namespace dart {
namespace compiler {
#define __ assembler->
intptr_t GraphIntrinsifier::ParameterSlotFromSp() {
return 0;
}
void GraphIntrinsifier::IntrinsicCallPrologue(Assembler* assembler) {
COMPILE_ASSERT(CALLEE_SAVED_TEMP != ARGS_DESC_REG);
assembler->Comment("IntrinsicCallPrologue");
assembler->movl(CALLEE_SAVED_TEMP, ARGS_DESC_REG);
}
void GraphIntrinsifier::IntrinsicCallEpilogue(Assembler* assembler) {
assembler->Comment("IntrinsicCallEpilogue");
assembler->movl(ARGS_DESC_REG, CALLEE_SAVED_TEMP);
}
#undef __
} // namespace compiler
} // namespace dart
#endif // defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -0,0 +1,45 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
#if defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/compiler/assembler/assembler.h"
#include "vm/compiler/graph_intrinsifier.h"
namespace dart {
namespace compiler {
#define __ assembler->
intptr_t GraphIntrinsifier::ParameterSlotFromSp() {
return 0;
}
static bool IsABIPreservedRegister(Register reg) {
return ((1 << reg) & CallingConventions::kCalleeSaveCpuRegisters) != 0;
}
void GraphIntrinsifier::IntrinsicCallPrologue(Assembler* assembler) {
ASSERT(IsABIPreservedRegister(CODE_REG));
ASSERT(!IsABIPreservedRegister(ARGS_DESC_REG));
ASSERT(IsABIPreservedRegister(CALLEE_SAVED_TEMP));
ASSERT(CALLEE_SAVED_TEMP != CODE_REG);
ASSERT(CALLEE_SAVED_TEMP != ARGS_DESC_REG);
assembler->Comment("IntrinsicCallPrologue");
assembler->movq(CALLEE_SAVED_TEMP, ARGS_DESC_REG);
}
void GraphIntrinsifier::IntrinsicCallEpilogue(Assembler* assembler) {
assembler->Comment("IntrinsicCallEpilogue");
assembler->movq(ARGS_DESC_REG, CALLEE_SAVED_TEMP);
}
#undef __
} // namespace compiler
} // namespace dart
#endif // defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)

File diff suppressed because it is too large Load diff

View file

@ -7,23 +7,20 @@
#define RUNTIME_VM_COMPILER_INTRINSIFIER_H_
#include "vm/allocation.h"
#include "vm/compiler/asm_intrinsifier.h"
#include "vm/compiler/graph_intrinsifier.h"
#include "vm/compiler/method_recognizer.h"
namespace dart {
// Forward declarations.
class FlowGraphCompiler;
class Function;
class ParsedFunction;
namespace compiler {
class Assembler;
class Label;
} // namespace compiler
class FlowGraphCompiler;
class Function;
class TargetEntryInstr;
class ParsedFunction;
class FlowGraph;
using compiler::Assembler;
using compiler::Label;
class Intrinsifier : public AllStatic {
public:
@ -33,46 +30,11 @@ class Intrinsifier : public AllStatic {
static void InitializeState();
#endif
static bool GraphIntrinsify(const ParsedFunction& parsed_function,
FlowGraphCompiler* compiler);
static intptr_t ParameterSlotFromSp();
static void IntrinsicCallPrologue(Assembler* assembler);
static void IntrinsicCallEpilogue(Assembler* assembler);
private:
// The "_A" value used in the intrinsification of
// `runtime/lib/math_patch.dart:_Random._nextState()`
static const int64_t kRandomAValue = 0xffffda61;
static bool CanIntrinsify(const Function& function);
#define DECLARE_FUNCTION(class_name, function_name, enum_name, fp) \
static void enum_name(Assembler* assembler, Label* normal_ir_body);
ALL_INTRINSICS_LIST(DECLARE_FUNCTION)
#if defined(TARGET_ARCH_DBC)
// On DBC graph intrinsics are handled in the same way as non-graph ones.
GRAPH_INTRINSICS_LIST(DECLARE_FUNCTION)
#endif
#undef DECLARE_FUNCTION
#if !defined(TARGET_ARCH_DBC)
#define DECLARE_FUNCTION(class_name, function_name, enum_name, fp) \
static bool Build_##enum_name(FlowGraph* flow_graph);
GRAPH_INTRINSICS_LIST(DECLARE_FUNCTION)
#undef DECLARE_FUNCTION
static void IntrinsifyRegExpExecuteMatch(Assembler* assembler,
Label* normal_ir_body,
bool sticky);
#endif
};
} // namespace compiler
} // namespace dart
#endif // RUNTIME_VM_COMPILER_INTRINSIFIER_H_

View file

@ -6,519 +6,12 @@
#define RUNTIME_VM_COMPILER_METHOD_RECOGNIZER_H_
#include "vm/allocation.h"
#include "vm/compiler/recognized_methods_list.h"
#include "vm/growable_array.h"
#include "vm/token.h"
namespace dart {
// clang-format off
// (class-name, function-name, recognized enum, result type, fingerprint).
// When adding a new function add a 0 as fingerprint, build and run to get the
// correct fingerprint from the mismatch error (or use Library::GetFunction()
// and print func.SourceFingerprint()).
#define OTHER_RECOGNIZED_LIST(V) \
V(::, identical, ObjectIdentical, 0x49c6e96a) \
V(ClassID, getID, ClassIDgetID, 0x7b18b257) \
V(Object, Object., ObjectConstructor, 0x681617fe) \
V(List, ., ListFactory, 0x629f8324) \
V(_List, ., ObjectArrayAllocate, 0x2121902f) \
V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 0x7041895a) \
V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 0x336fa3ea) \
V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 0x231bbe2e) \
V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 0x0371785f) \
V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 0x65ab3a20) \
V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 0x0cb0fcf6) \
V(_TypedList, _getInt64, ByteArrayBaseGetInt64, 0x7db75d78) \
V(_TypedList, _getUint64, ByteArrayBaseGetUint64, 0x1487cfc6) \
V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 0x6674ea6f) \
V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 0x236c6e7a) \
V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 0x5c367ffb) \
V(_TypedList, _getInt32x4, ByteArrayBaseGetInt32x4, 0x772d1c0f) \
V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 0x12bae36a) \
V(_TypedList, _setUint8, ByteArrayBaseSetUint8, 0x15821cc9) \
V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 0x1f8237fa) \
V(_TypedList, _setUint16, ByteArrayBaseSetUint16, 0x181e5d16) \
V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 0x7ddb9f87) \
V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 0x74094f8d) \
V(_TypedList, _setInt64, ByteArrayBaseSetInt64, 0x4741396e) \
V(_TypedList, _setUint64, ByteArrayBaseSetUint64, 0x3b398ae4) \
V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 0x03db087b) \
V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 0x38a80b0d) \
V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 0x40052c4e) \
V(_TypedList, _setInt32x4, ByteArrayBaseSetInt32x4, 0x07b89f54) \
V(::, _toClampedUint8, ConvertIntToClampedUint8, 0x564b0435) \
V(_StringBase, _interpolate, StringBaseInterpolate, 0x01ecb15a) \
V(_IntegerImplementation, toDouble, IntegerToDouble, 0x05da96ed) \
V(_Double, _add, DoubleAdd, 0x2a38277b) \
V(_Double, _sub, DoubleSub, 0x4f466391) \
V(_Double, _mul, DoubleMul, 0x175e4f66) \
V(_Double, _div, DoubleDiv, 0x0854181b) \
V(::, min, MathMin, 0x32ebc57d) \
V(::, max, MathMax, 0x377e8889) \
V(::, _doublePow, MathDoublePow, 0x5add0ec1) \
V(::, _intPow, MathIntPow, 0x11b45569) \
V(Float32x4, Float32x4., Float32x4Constructor, 0x26ea459b) \
V(Float32x4, Float32x4.zero, Float32x4Zero, 0x16eca604) \
V(Float32x4, Float32x4.splat, Float32x4Splat, 0x694e83e3) \
V(Float32x4, Float32x4.fromInt32x4Bits, Int32x4ToFloat32x4, 0x2f62ebd3) \
V(Float32x4, Float32x4.fromFloat64x2, Float64x2ToFloat32x4, 0x50ed6910) \
V(_Float32x4, shuffle, Float32x4Shuffle, 0x7829101f) \
V(_Float32x4, shuffleMix, Float32x4ShuffleMix, 0x4182c06b) \
V(_Float32x4, get:signMask, Float32x4GetSignMask, 0x1d08b351) \
V(_Float32x4, equal, Float32x4Equal, 0x11adb239) \
V(_Float32x4, greaterThan, Float32x4GreaterThan, 0x48adaf58) \
V(_Float32x4, greaterThanOrEqual, Float32x4GreaterThanOrEqual, 0x32db94ca) \
V(_Float32x4, lessThan, Float32x4LessThan, 0x425b000c) \
V(_Float32x4, lessThanOrEqual, Float32x4LessThanOrEqual, 0x0278c2f8) \
V(_Float32x4, notEqual, Float32x4NotEqual, 0x2987cd26) \
V(_Float32x4, min, Float32x4Min, 0x5ed74b6f) \
V(_Float32x4, max, Float32x4Max, 0x68696442) \
V(_Float32x4, scale, Float32x4Scale, 0x704e4122) \
V(_Float32x4, sqrt, Float32x4Sqrt, 0x2c967a6f) \
V(_Float32x4, reciprocalSqrt, Float32x4ReciprocalSqrt, 0x6264bfe8) \
V(_Float32x4, reciprocal, Float32x4Reciprocal, 0x3cd7e819) \
V(_Float32x4, unary-, Float32x4Negate, 0x37accb52) \
V(_Float32x4, abs, Float32x4Abs, 0x471cdd87) \
V(_Float32x4, clamp, Float32x4Clamp, 0x2cb30492) \
V(_Float32x4, withX, Float32x4WithX, 0x4e336aff) \
V(_Float32x4, withY, Float32x4WithY, 0x0a72b910) \
V(_Float32x4, withZ, Float32x4WithZ, 0x31e93658) \
V(_Float32x4, withW, Float32x4WithW, 0x60ddc105) \
V(Float64x2, Float64x2., Float64x2Constructor, 0x43054b9f) \
V(Float64x2, Float64x2.zero, Float64x2Zero, 0x4af12f9d) \
V(Float64x2, Float64x2.splat, Float64x2Splat, 0x134edef0) \
V(Float64x2, Float64x2.fromFloat32x4, Float32x4ToFloat64x2, 0x17d6b5e4) \
V(_Float64x2, get:x, Float64x2GetX, 0x58c09c58) \
V(_Float64x2, get:y, Float64x2GetY, 0x3cf5e5b8) \
V(_Float64x2, unary-, Float64x2Negate, 0x415ca009) \
V(_Float64x2, abs, Float64x2Abs, 0x031f9e47) \
V(_Float64x2, sqrt, Float64x2Sqrt, 0x77f711dd) \
V(_Float64x2, get:signMask, Float64x2GetSignMask, 0x27deda4b) \
V(_Float64x2, scale, Float64x2Scale, 0x26830a61) \
V(_Float64x2, withX, Float64x2WithX, 0x1d2bcaf5) \
V(_Float64x2, withY, Float64x2WithY, 0x383ed6ac) \
V(_Float64x2, min, Float64x2Min, 0x28d7ddf6) \
V(_Float64x2, max, Float64x2Max, 0x0bd74e5b) \
V(Int32x4, Int32x4., Int32x4Constructor, 0x480555a9) \
V(Int32x4, Int32x4.bool, Int32x4BoolConstructor, 0x36aa6963) \
V(Int32x4, Int32x4.fromFloat32x4Bits, Float32x4ToInt32x4, 0x6715388a) \
V(_Int32x4, get:flagX, Int32x4GetFlagX, 0x56396c82) \
V(_Int32x4, get:flagY, Int32x4GetFlagY, 0x44704738) \
V(_Int32x4, get:flagZ, Int32x4GetFlagZ, 0x20d6ff37) \
V(_Int32x4, get:flagW, Int32x4GetFlagW, 0x5045616a) \
V(_Int32x4, get:signMask, Int32x4GetSignMask, 0x2c1fb2a3) \
V(_Int32x4, shuffle, Int32x4Shuffle, 0x20bc0b16) \
V(_Int32x4, shuffleMix, Int32x4ShuffleMix, 0x5c7056e1) \
V(_Int32x4, select, Int32x4Select, 0x6b49654f) \
V(_Int32x4, withFlagX, Int32x4WithFlagX, 0x0ef58fcf) \
V(_Int32x4, withFlagY, Int32x4WithFlagY, 0x6485a9c4) \
V(_Int32x4, withFlagZ, Int32x4WithFlagZ, 0x267acdfa) \
V(_Int32x4, withFlagW, Int32x4WithFlagW, 0x345ac675) \
V(_HashVMBase, get:_index, LinkedHashMap_getIndex, 0x02477157) \
V(_HashVMBase, set:_index, LinkedHashMap_setIndex, 0x4fc8d5e0) \
V(_HashVMBase, get:_data, LinkedHashMap_getData, 0x2d7a70ac) \
V(_HashVMBase, set:_data, LinkedHashMap_setData, 0x0ec032e8) \
V(_HashVMBase, get:_usedData, LinkedHashMap_getUsedData, 0x088599ed) \
V(_HashVMBase, set:_usedData, LinkedHashMap_setUsedData, 0x5f42ca86) \
V(_HashVMBase, get:_hashMask, LinkedHashMap_getHashMask, 0x32f3b13b) \
V(_HashVMBase, set:_hashMask, LinkedHashMap_setHashMask, 0x7219c45b) \
V(_HashVMBase, get:_deletedKeys, LinkedHashMap_getDeletedKeys, 0x558481c2) \
V(_HashVMBase, set:_deletedKeys, LinkedHashMap_setDeletedKeys, 0x5aa9888d) \
V(::, _classRangeCheck, ClassRangeCheck, 0x2ae76b84) \
V(::, _classRangeCheckNegative, ClassRangeCheckNegated, 0x5acdfb75) \
// List of intrinsics:
// (class-name, function-name, intrinsification method, fingerprint).
#define CORE_LIB_INTRINSIC_LIST(V) \
V(_Smi, ~, Smi_bitNegate, 0x67299f4f) \
V(_Smi, get:bitLength, Smi_bitLength, 0x25b3cb0a) \
V(_Smi, _bitAndFromSmi, Smi_bitAndFromSmi, 0x562d5047) \
V(_BigIntImpl, _lsh, Bigint_lsh, 0x5b6cfc8b) \
V(_BigIntImpl, _rsh, Bigint_rsh, 0x6ff14a49) \
V(_BigIntImpl, _absAdd, Bigint_absAdd, 0x5bf14238) \
V(_BigIntImpl, _absSub, Bigint_absSub, 0x1de5bd32) \
V(_BigIntImpl, _mulAdd, Bigint_mulAdd, 0x6f277966) \
V(_BigIntImpl, _sqrAdd, Bigint_sqrAdd, 0x68e4c8ea) \
V(_BigIntImpl, _estimateQuotientDigit, Bigint_estimateQuotientDigit, \
0x35456d91) \
V(_BigIntMontgomeryReduction, _mulMod, Montgomery_mulMod, 0x0f7b0375) \
V(_Double, >, Double_greaterThan, 0x4f1375a3) \
V(_Double, >=, Double_greaterEqualThan, 0x4260c184) \
V(_Double, <, Double_lessThan, 0x365d1eba) \
V(_Double, <=, Double_lessEqualThan, 0x74b5eb64) \
V(_Double, ==, Double_equal, 0x613492fc) \
V(_Double, +, Double_add, 0x53994370) \
V(_Double, -, Double_sub, 0x3b69d466) \
V(_Double, *, Double_mul, 0x2bb9bd5d) \
V(_Double, /, Double_div, 0x483eee28) \
V(_Double, get:hashCode, Double_hashCode, 0x702b77b7) \
V(_Double, get:_identityHashCode, Double_identityHash, 0x7bda5549) \
V(_Double, get:isNaN, Double_getIsNaN, 0x0af9d4a9) \
V(_Double, get:isInfinite, Double_getIsInfinite, 0x0f7acb47) \
V(_Double, get:isNegative, Double_getIsNegative, 0x3a59e7f4) \
V(_Double, _mulFromInteger, Double_mulFromInteger, 0x2017fcf6) \
V(_Double, .fromInteger, DoubleFromInteger, 0x6d234f4b) \
V(_GrowableList, .withData, GrowableArray_Allocate, 0x28b2138e) \
V(_RegExp, _ExecuteMatch, RegExp_ExecuteMatch, 0x380184b1) \
V(_RegExp, _ExecuteMatchSticky, RegExp_ExecuteMatchSticky, 0x79b8f955) \
V(Object, ==, ObjectEquals, 0x7b32a55a) \
V(Object, get:runtimeType, ObjectRuntimeType, 0x00e8ab29) \
V(Object, _haveSameRuntimeType, ObjectHaveSameRuntimeType, 0x4dc50799) \
V(_StringBase, get:hashCode, String_getHashCode, 0x78c3d446) \
V(_StringBase, get:_identityHashCode, String_identityHash, 0x0472b1d8) \
V(_StringBase, get:isEmpty, StringBaseIsEmpty, 0x4a8b29c8) \
V(_StringBase, _substringMatches, StringBaseSubstringMatches, 0x46de4f10) \
V(_StringBase, [], StringBaseCharAt, 0x7cbb8603) \
V(_OneByteString, get:hashCode, OneByteString_getHashCode, 0x78c3d446) \
V(_OneByteString, _substringUncheckedNative, \
OneByteString_substringUnchecked, 0x3538ad86) \
V(_OneByteString, _setAt, OneByteStringSetAt, 0x11ffddd1) \
V(_OneByteString, _allocate, OneByteString_allocate, 0x74933376) \
V(_OneByteString, ==, OneByteString_equality, 0x4eda197e) \
V(_TwoByteString, ==, TwoByteString_equality, 0x4eda197e) \
V(_Type, get:hashCode, Type_getHashCode, 0x18d1523f) \
V(::, _getHash, Object_getHash, 0x2827856d) \
V(::, _setHash, Object_setHash, 0x690faebd) \
#define CORE_INTEGER_LIB_INTRINSIC_LIST(V) \
V(_IntegerImplementation, _addFromInteger, Integer_addFromInteger, \
0x6a10c54a) \
V(_IntegerImplementation, +, Integer_add, 0x43d53af7) \
V(_IntegerImplementation, _subFromInteger, Integer_subFromInteger, \
0x3fa4b1ed) \
V(_IntegerImplementation, -, Integer_sub, 0x2dc22e03) \
V(_IntegerImplementation, _mulFromInteger, Integer_mulFromInteger, \
0x3216e299) \
V(_IntegerImplementation, *, Integer_mul, 0x4e7a1c24) \
V(_IntegerImplementation, _moduloFromInteger, Integer_moduloFromInteger, \
0x6348b974) \
V(_IntegerImplementation, ~/, Integer_truncDivide, 0x4efb2d39) \
V(_IntegerImplementation, unary-, Integer_negate, 0x428bf6fa) \
V(_IntegerImplementation, _bitAndFromInteger, Integer_bitAndFromInteger, \
0x395b1678) \
V(_IntegerImplementation, &, Integer_bitAnd, 0x5ab35f30) \
V(_IntegerImplementation, _bitOrFromInteger, Integer_bitOrFromInteger, \
0x6a36b395) \
V(_IntegerImplementation, |, Integer_bitOr, 0x267fa107) \
V(_IntegerImplementation, _bitXorFromInteger, Integer_bitXorFromInteger, \
0x72da93f0) \
V(_IntegerImplementation, ^, Integer_bitXor, 0x0c7b0230) \
V(_IntegerImplementation, _greaterThanFromInteger, \
Integer_greaterThanFromInt, 0x4a50ed58) \
V(_IntegerImplementation, >, Integer_greaterThan, 0x6599a6e1) \
V(_IntegerImplementation, ==, Integer_equal, 0x58abc487) \
V(_IntegerImplementation, _equalToInteger, Integer_equalToInteger, \
0x063be842) \
V(_IntegerImplementation, <, Integer_lessThan, 0x365d1eba) \
V(_IntegerImplementation, <=, Integer_lessEqualThan, 0x74b5eb64) \
V(_IntegerImplementation, >=, Integer_greaterEqualThan, 0x4260c184) \
V(_IntegerImplementation, <<, Integer_shl, 0x371c45fa) \
V(_IntegerImplementation, >>, Integer_sar, 0x2b630578) \
V(_Double, toInt, DoubleToInteger, 0x26ef344b) \
#define MATH_LIB_INTRINSIC_LIST(V) \
V(::, sqrt, MathSqrt, 0x70482cf3) \
V(_Random, _nextState, Random_nextState, 0x2842c4d5) \
#define GRAPH_MATH_LIB_INTRINSIC_LIST(V) \
V(::, sin, MathSin, 0x6b7bd98c) \
V(::, cos, MathCos, 0x459bf5fe) \
V(::, tan, MathTan, 0x3bcd772a) \
V(::, asin, MathAsin, 0x2ecc2fcd) \
V(::, acos, MathAcos, 0x08cf2212) \
V(::, atan, MathAtan, 0x1e2731d5) \
V(::, atan2, MathAtan2, 0x39f1fa41) \
#define TYPED_DATA_LIB_INTRINSIC_LIST(V) \
V(Int8List, ., TypedData_Int8Array_factory, 0x7e39a3a1) \
V(Uint8List, ., TypedData_Uint8Array_factory, 0x3a79adf7) \
V(Uint8ClampedList, ., TypedData_Uint8ClampedArray_factory, 0x67f38395) \
V(Int16List, ., TypedData_Int16Array_factory, 0x6477bda8) \
V(Uint16List, ., TypedData_Uint16Array_factory, 0x5707c5a2) \
V(Int32List, ., TypedData_Int32Array_factory, 0x2b96ec0e) \
V(Uint32List, ., TypedData_Uint32Array_factory, 0x0c1c0d62) \
V(Int64List, ., TypedData_Int64Array_factory, 0x279ab485) \
V(Uint64List, ., TypedData_Uint64Array_factory, 0x7bcb89c2) \
V(Float32List, ., TypedData_Float32Array_factory, 0x43506c09) \
V(Float64List, ., TypedData_Float64Array_factory, 0x1fde3eaf) \
V(Float32x4List, ., TypedData_Float32x4Array_factory, 0x4a4030d6) \
V(Int32x4List, ., TypedData_Int32x4Array_factory, 0x6dd02406) \
V(Float64x2List, ., TypedData_Float64x2Array_factory, 0x688e4e97) \
#define GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \
V(_Int8List, [], Int8ArrayGetIndexed, 0x49767a2c) \
V(_Int8List, []=, Int8ArraySetIndexed, 0x24f42cd0) \
V(_Uint8List, [], Uint8ArrayGetIndexed, 0x088d86d4) \
V(_Uint8List, []=, Uint8ArraySetIndexed, 0x12639541) \
V(_ExternalUint8Array, [], ExternalUint8ArrayGetIndexed, 0x088d86d4) \
V(_ExternalUint8Array, []=, ExternalUint8ArraySetIndexed, 0x12639541) \
V(_Uint8ClampedList, [], Uint8ClampedArrayGetIndexed, 0x088d86d4) \
V(_Uint8ClampedList, []=, Uint8ClampedArraySetIndexed, 0x6790dba1) \
V(_ExternalUint8ClampedArray, [], ExternalUint8ClampedArrayGetIndexed, \
0x088d86d4) \
V(_ExternalUint8ClampedArray, []=, ExternalUint8ClampedArraySetIndexed, \
0x6790dba1) \
V(_Int16List, [], Int16ArrayGetIndexed, 0x5ec64948) \
V(_Int16List, []=, Int16ArraySetIndexed, 0x0e4e8221) \
V(_Uint16List, [], Uint16ArrayGetIndexed, 0x5f49d093) \
V(_Uint16List, []=, Uint16ArraySetIndexed, 0x2efbc90f) \
V(_Int32List, [], Int32ArrayGetIndexed, 0x4bc0d3dd) \
V(_Int32List, []=, Int32ArraySetIndexed, 0x1adf9823) \
V(_Uint32List, [], Uint32ArrayGetIndexed, 0x188658ce) \
V(_Uint32List, []=, Uint32ArraySetIndexed, 0x01f51a79) \
V(_Int64List, [], Int64ArrayGetIndexed, 0x51eafb97) \
V(_Int64List, []=, Int64ArraySetIndexed, 0x376181fb) \
V(_Uint64List, [], Uint64ArrayGetIndexed, 0x4b2a1ba2) \
V(_Uint64List, []=, Uint64ArraySetIndexed, 0x5f881bd4) \
V(_Float64List, [], Float64ArrayGetIndexed, 0x0a714486) \
V(_Float64List, []=, Float64ArraySetIndexed, 0x04937367) \
V(_Float32List, [], Float32ArrayGetIndexed, 0x5ade301f) \
V(_Float32List, []=, Float32ArraySetIndexed, 0x0d5c2e2b) \
V(_Float32x4List, [], Float32x4ArrayGetIndexed, 0x128cddeb) \
V(_Float32x4List, []=, Float32x4ArraySetIndexed, 0x7ad55c72) \
V(_Int32x4List, [], Int32x4ArrayGetIndexed, 0x4b78af9c) \
V(_Int32x4List, []=, Int32x4ArraySetIndexed, 0x31453dab) \
V(_Float64x2List, [], Float64x2ArrayGetIndexed, 0x644a0be1) \
V(_Float64x2List, []=, Float64x2ArraySetIndexed, 0x6b836b0b) \
V(_TypedList, get:length, TypedDataLength, 0x2091c4d8) \
V(_Float32x4, get:x, Float32x4ShuffleX, 0x63d1a9fd) \
V(_Float32x4, get:y, Float32x4ShuffleY, 0x203523d9) \
V(_Float32x4, get:z, Float32x4ShuffleZ, 0x13190678) \
V(_Float32x4, get:w, Float32x4ShuffleW, 0x698a38de) \
V(_Float32x4, *, Float32x4Mul, 0x5dec68b2) \
V(_Float32x4, -, Float32x4Sub, 0x3ea14461) \
V(_Float32x4, +, Float32x4Add, 0x7ffcf301) \
#define GRAPH_CORE_INTRINSICS_LIST(V) \
V(_List, get:length, ObjectArrayLength, 0x25952390) \
V(_List, [], ObjectArrayGetIndexed, 0x653da02e) \
V(_List, []=, ObjectArraySetIndexed, 0x16b3d2b0) \
V(_List, _setIndexed, ObjectArraySetIndexedUnchecked, 0x50d64c75) \
V(_ImmutableList, get:length, ImmutableArrayLength, 0x25952390) \
V(_ImmutableList, [], ImmutableArrayGetIndexed, 0x653da02e) \
V(_GrowableList, get:length, GrowableArrayLength, 0x18dd86b4) \
V(_GrowableList, get:_capacity, GrowableArrayCapacity, 0x2e04be60) \
V(_GrowableList, _setData, GrowableArraySetData, 0x3dbea348) \
V(_GrowableList, _setLength, GrowableArraySetLength, 0x753e55da) \
V(_GrowableList, [], GrowableArrayGetIndexed, 0x446fe1f0) \
V(_GrowableList, []=, GrowableArraySetIndexed, 0x40a462ec) \
V(_GrowableList, _setIndexed, GrowableArraySetIndexedUnchecked, 0x297083df) \
V(_StringBase, get:length, StringBaseLength, 0x2a2d03d1) \
V(_OneByteString, codeUnitAt, OneByteStringCodeUnitAt, 0x55a0a1f3) \
V(_TwoByteString, codeUnitAt, TwoByteStringCodeUnitAt, 0x55a0a1f3) \
V(_ExternalOneByteString, codeUnitAt, ExternalOneByteStringCodeUnitAt, \
0x55a0a1f3) \
V(_ExternalTwoByteString, codeUnitAt, ExternalTwoByteStringCodeUnitAt, \
0x55a0a1f3) \
V(_Double, unary-, DoubleFlipSignBit, 0x6db4674f) \
V(_Double, truncateToDouble, DoubleTruncate, 0x2f27e5d3) \
V(_Double, roundToDouble, DoubleRound, 0x2f89c512) \
V(_Double, floorToDouble, DoubleFloor, 0x6aa87a5f) \
V(_Double, ceilToDouble, DoubleCeil, 0x1b045e9e) \
V(_Double, _modulo, DoubleMod, 0x5b8ceed7)
#define GRAPH_INTRINSICS_LIST(V) \
GRAPH_CORE_INTRINSICS_LIST(V) \
GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \
GRAPH_MATH_LIB_INTRINSIC_LIST(V) \
#define DEVELOPER_LIB_INTRINSIC_LIST(V) \
V(_UserTag, makeCurrent, UserTag_makeCurrent, 0x0b3066fd) \
V(::, _getDefaultTag, UserTag_defaultTag, 0x69f3f1ad) \
V(::, _getCurrentTag, Profiler_getCurrentTag, 0x05fa99d2) \
V(::, _isDartStreamEnabled, Timeline_isDartStreamEnabled, 0x72f13f7a) \
#define ASYNC_LIB_INTRINSIC_LIST(V) \
V(::, _clearAsyncThreadStackTrace, ClearAsyncThreadStackTrace, 0x2edd4b25) \
V(::, _setAsyncThreadStackTrace, SetAsyncThreadStackTrace, 0x04f429a7) \
#define ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \
ASYNC_LIB_INTRINSIC_LIST(V) \
CORE_LIB_INTRINSIC_LIST(V) \
DEVELOPER_LIB_INTRINSIC_LIST(V) \
MATH_LIB_INTRINSIC_LIST(V) \
TYPED_DATA_LIB_INTRINSIC_LIST(V) \
#define ALL_INTRINSICS_LIST(V) \
ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \
CORE_INTEGER_LIB_INTRINSIC_LIST(V)
#define RECOGNIZED_LIST(V) \
OTHER_RECOGNIZED_LIST(V) \
ALL_INTRINSICS_LIST(V) \
GRAPH_INTRINSICS_LIST(V)
// A list of core function that should always be inlined.
#define INLINE_WHITE_LIST(V) \
V(Object, ==, ObjectEquals, 0x7b32a55a) \
V(_List, get:length, ObjectArrayLength, 0x25952390) \
V(_ImmutableList, get:length, ImmutableArrayLength, 0x25952390) \
V(_TypedList, get:length, TypedDataLength, 0x2091c4d8) \
V(_GrowableList, get:length, GrowableArrayLength, 0x18dd86b4) \
V(_GrowableList, get:_capacity, GrowableArrayCapacity, 0x2e04be60) \
V(_GrowableList, add, GrowableListAdd, 0x40b490b8) \
V(_GrowableList, removeLast, GrowableListRemoveLast, 0x007855e5) \
V(_StringBase, get:length, StringBaseLength, 0x2a2d03d1) \
V(ListIterator, moveNext, ListIteratorMoveNext, 0x2dca30ce) \
V(_FixedSizeArrayIterator, moveNext, FixedListIteratorMoveNext, 0x324eb20b) \
V(_GrowableList, get:iterator, GrowableArrayIterator, 0x5bd2ef37) \
V(_GrowableList, forEach, GrowableArrayForEach, 0x74900bb8) \
V(_List, ., ObjectArrayAllocate, 0x2121902f) \
V(ListMixin, get:isEmpty, ListMixinIsEmpty, 0x7be74d04) \
V(_List, get:iterator, ObjectArrayIterator, 0x6c851c55) \
V(_List, forEach, ObjectArrayForEach, 0x11406b13) \
V(_List, _slice, ObjectArraySlice, 0x4c865d1d) \
V(_ImmutableList, get:iterator, ImmutableArrayIterator, 0x6c851c55) \
V(_ImmutableList, forEach, ImmutableArrayForEach, 0x11406b13) \
V(_Int8ArrayView, [], Int8ArrayViewGetIndexed, 0x7e5a8458) \
V(_Int8ArrayView, []=, Int8ArrayViewSetIndexed, 0x62f615e4) \
V(_Uint8ArrayView, [], Uint8ArrayViewGetIndexed, 0x7d308247) \
V(_Uint8ArrayView, []=, Uint8ArrayViewSetIndexed, 0x65ba546e) \
V(_Uint8ClampedArrayView, [], Uint8ClampedArrayViewGetIndexed, 0x7d308247) \
V(_Uint8ClampedArrayView, []=, Uint8ClampedArrayViewSetIndexed, 0x65ba546e) \
V(_Uint16ArrayView, [], Uint16ArrayViewGetIndexed, 0xe96836dd) \
V(_Uint16ArrayView, []=, Uint16ArrayViewSetIndexed, 0x15b02947) \
V(_Int16ArrayView, [], Int16ArrayViewGetIndexed, 0x1b24a48b) \
V(_Int16ArrayView, []=, Int16ArrayViewSetIndexed, 0xb91ec2e6) \
V(_Uint32ArrayView, [], Uint32ArrayViewGetIndexed, 0x8a4f93b3) \
V(_Uint32ArrayView, []=, Uint32ArrayViewSetIndexed, 0xf54918b5) \
V(_Int32ArrayView, [], Int32ArrayViewGetIndexed, 0x85040819) \
V(_Int32ArrayView, []=, Int32ArrayViewSetIndexed, 0xaec8c6f5) \
V(_Uint64ArrayView, [], Uint64ArrayViewGetIndexed, 0xd0c44fe7) \
V(_Uint64ArrayView, []=, Uint64ArrayViewSetIndexed, 0x402712b7) \
V(_Int64ArrayView, [], Int64ArrayViewGetIndexed, 0xf3090b95) \
V(_Int64ArrayView, []=, Int64ArrayViewSetIndexed, 0xca07e497) \
V(_Float32ArrayView, [], Float32ArrayViewGetIndexed, 0xef967533) \
V(_Float32ArrayView, []=, Float32ArrayViewSetIndexed, 0xc9b691bd) \
V(_Float64ArrayView, [], Float64ArrayViewGetIndexed, 0x9d83f585) \
V(_Float64ArrayView, []=, Float64ArrayViewSetIndexed, 0x3c1adabd) \
V(_ByteDataView, setInt8, ByteDataViewSetInt8, 0x6395293e) \
V(_ByteDataView, setUint8, ByteDataViewSetUint8, 0x79979d1f) \
V(_ByteDataView, setInt16, ByteDataViewSetInt16, 0x525ec534) \
V(_ByteDataView, setUint16, ByteDataViewSetUint16, 0x48eda263) \
V(_ByteDataView, setInt32, ByteDataViewSetInt32, 0x523666fa) \
V(_ByteDataView, setUint32, ByteDataViewSetUint32, 0x5a4683da) \
V(_ByteDataView, setInt64, ByteDataViewSetInt64, 0x4283a650) \
V(_ByteDataView, setUint64, ByteDataViewSetUint64, 0x687a1892) \
V(_ByteDataView, setFloat32, ByteDataViewSetFloat32, 0x7d5784fd) \
V(_ByteDataView, setFloat64, ByteDataViewSetFloat64, 0x00101e3f) \
V(_ByteDataView, getInt8, ByteDataViewGetInt8, 0x68448b4d) \
V(_ByteDataView, getUint8, ByteDataViewGetUint8, 0x5d68cbf2) \
V(_ByteDataView, getInt16, ByteDataViewGetInt16, 0x691b5ead) \
V(_ByteDataView, getUint16, ByteDataViewGetUint16, 0x78b744d8) \
V(_ByteDataView, getInt32, ByteDataViewGetInt32, 0x3a0f4efa) \
V(_ByteDataView, getUint32, ByteDataViewGetUint32, 0x583261be) \
V(_ByteDataView, getInt64, ByteDataViewGetInt64, 0x77de471c) \
V(_ByteDataView, getUint64, ByteDataViewGetUint64, 0x0ffadc4b) \
V(_ByteDataView, getFloat32, ByteDataViewGetFloat32, 0x6a205749) \
V(_ByteDataView, getFloat64, ByteDataViewGetFloat64, 0x69f58d27) \
V(::, exp, MathExp, 0x32ab9efa) \
V(::, log, MathLog, 0x1ee8f9fc) \
V(::, max, MathMax, 0x377e8889) \
V(::, min, MathMin, 0x32ebc57d) \
V(::, pow, MathPow, 0x79efc5a2) \
V(::, _classRangeCheck, ClassRangeCheck, 0x2ae76b84) \
V(::, _classRangeCheckNegative, ClassRangeCheckNegated, 0x5acdfb75) \
V(::, _toInt, ConvertMaskedInt, 0x713908fd) \
V(::, _toInt8, ConvertIntToInt8, 0x7484a780) \
V(::, _toUint8, ConvertIntToUint8, 0x0a15b522) \
V(::, _toInt16, ConvertIntToInt16, 0x0a83fcc6) \
V(::, _toUint16, ConvertIntToUint16, 0x6087d1af) \
V(::, _toInt32, ConvertIntToInt32, 0x62b451b9) \
V(::, _toUint32, ConvertIntToUint32, 0x17a8e085) \
V(::, _byteSwap16, ByteSwap16, 0x44f173be) \
V(::, _byteSwap32, ByteSwap32, 0x6219333b) \
V(::, _byteSwap64, ByteSwap64, 0x9abe57e0) \
V(Lists, copy, ListsCopy, 0x40e974f6) \
V(_HashVMBase, get:_index, LinkedHashMap_getIndex, 0x02477157) \
V(_HashVMBase, set:_index, LinkedHashMap_setIndex, 0x4fc8d5e0) \
V(_HashVMBase, get:_data, LinkedHashMap_getData, 0x2d7a70ac) \
V(_HashVMBase, set:_data, LinkedHashMap_setData, 0x0ec032e8) \
V(_HashVMBase, get:_usedData, LinkedHashMap_getUsedData, 0x088599ed) \
V(_HashVMBase, set:_usedData, LinkedHashMap_setUsedData, 0x5f42ca86) \
V(_HashVMBase, get:_hashMask, LinkedHashMap_getHashMask, 0x32f3b13b) \
V(_HashVMBase, set:_hashMask, LinkedHashMap_setHashMask, 0x7219c45b) \
V(_HashVMBase, get:_deletedKeys, LinkedHashMap_getDeletedKeys, 0x558481c2) \
V(_HashVMBase, set:_deletedKeys, LinkedHashMap_setDeletedKeys, 0x5aa9888d) \
// A list of core function that should never be inlined.
#define INLINE_BLACK_LIST(V) \
V(::, asin, MathAsin, 0x2ecc2fcd) \
V(::, acos, MathAcos, 0x08cf2212) \
V(::, atan, MathAtan, 0x1e2731d5) \
V(::, atan2, MathAtan2, 0x39f1fa41) \
V(::, cos, MathCos, 0x459bf5fe) \
V(::, sin, MathSin, 0x6b7bd98c) \
V(::, sqrt, MathSqrt, 0x70482cf3) \
V(::, tan, MathTan, 0x3bcd772a) \
V(_BigIntImpl, _lsh, Bigint_lsh, 0x5b6cfc8b) \
V(_BigIntImpl, _rsh, Bigint_rsh, 0x6ff14a49) \
V(_BigIntImpl, _absAdd, Bigint_absAdd, 0x5bf14238) \
V(_BigIntImpl, _absSub, Bigint_absSub, 0x1de5bd32) \
V(_BigIntImpl, _mulAdd, Bigint_mulAdd, 0x6f277966) \
V(_BigIntImpl, _sqrAdd, Bigint_sqrAdd, 0x68e4c8ea) \
V(_BigIntImpl, _estimateQuotientDigit, Bigint_estimateQuotientDigit, \
0x35456d91) \
V(_BigIntMontgomeryReduction, _mulMod, Montgomery_mulMod, 0x0f7b0375) \
V(_Double, >, Double_greaterThan, 0x4f1375a3) \
V(_Double, >=, Double_greaterEqualThan, 0x4260c184) \
V(_Double, <, Double_lessThan, 0x365d1eba) \
V(_Double, <=, Double_lessEqualThan, 0x74b5eb64) \
V(_Double, ==, Double_equal, 0x613492fc) \
V(_Double, +, Double_add, 0x53994370) \
V(_Double, -, Double_sub, 0x3b69d466) \
V(_Double, *, Double_mul, 0x2bb9bd5d) \
V(_Double, /, Double_div, 0x483eee28) \
V(_IntegerImplementation, +, Integer_add, 0x43d53af7) \
V(_IntegerImplementation, -, Integer_sub, 0x2dc22e03) \
V(_IntegerImplementation, *, Integer_mul, 0x4e7a1c24) \
V(_IntegerImplementation, ~/, Integer_truncDivide, 0x4efb2d39) \
V(_IntegerImplementation, unary-, Integer_negate, 0x428bf6fa) \
V(_IntegerImplementation, &, Integer_bitAnd, 0x5ab35f30) \
V(_IntegerImplementation, |, Integer_bitOr, 0x267fa107) \
V(_IntegerImplementation, ^, Integer_bitXor, 0x0c7b0230) \
V(_IntegerImplementation, >, Integer_greaterThan, 0x6599a6e1) \
V(_IntegerImplementation, ==, Integer_equal, 0x58abc487) \
V(_IntegerImplementation, <, Integer_lessThan, 0x365d1eba) \
V(_IntegerImplementation, <=, Integer_lessEqualThan, 0x74b5eb64) \
V(_IntegerImplementation, >=, Integer_greaterEqualThan, 0x4260c184) \
V(_IntegerImplementation, <<, Integer_shl, 0x371c45fa) \
V(_IntegerImplementation, >>, Integer_sar, 0x2b630578) \
// A list of core functions that internally dispatch based on received id.
#define POLYMORPHIC_TARGET_LIST(V) \
V(_StringBase, [], StringBaseCharAt, 0x7cbb8603) \
V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 0x7041895a) \
V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 0x336fa3ea) \
V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 0x231bbe2e) \
V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 0x0371785f) \
V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 0x65ab3a20) \
V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 0x0cb0fcf6) \
V(_TypedList, _getInt64, ByteArrayBaseGetInt64, 0x7db75d78) \
V(_TypedList, _getUint64, ByteArrayBaseGetUint64, 0x1487cfc6) \
V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 0x6674ea6f) \
V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 0x236c6e7a) \
V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 0x5c367ffb) \
V(_TypedList, _getInt32x4, ByteArrayBaseGetInt32x4, 0x772d1c0f) \
V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 0x12bae36a) \
V(_TypedList, _setUint8, ByteArrayBaseSetInt8, 0x15821cc9) \
V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 0x1f8237fa) \
V(_TypedList, _setUint16, ByteArrayBaseSetInt16, 0x181e5d16) \
V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 0x7ddb9f87) \
V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 0x74094f8d) \
V(_TypedList, _setInt64, ByteArrayBaseSetInt64, 0x4741396e) \
V(_TypedList, _setUint64, ByteArrayBaseSetUint64, 0x3b398ae4) \
V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 0x03db087b) \
V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 0x38a80b0d) \
V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 0x40052c4e) \
V(_TypedList, _setInt32x4, ByteArrayBaseSetInt32x4, 0x07b89f54) \
V(Object, get:runtimeType, ObjectRuntimeType, 0x00e8ab29)
// clang-format on
// Forward declarations.
class Function;
class Library;
@ -588,35 +81,6 @@ class MethodTokenRecognizer : public AllStatic {
ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1 ", " #p2, fp))
#endif // !defined(DART_PRECOMPILED_RUNTIME)
// clang-format off
// List of recognized list factories:
// (factory-name-symbol, class-name-string, constructor-name-string,
// result-cid, fingerprint).
#define RECOGNIZED_LIST_FACTORY_LIST(V) \
V(_ListFactory, _List, ., kArrayCid, 0x2121902f) \
V(_GrowableListWithData, _GrowableList, .withData, kGrowableObjectArrayCid, \
0x28b2138e) \
V(_GrowableListFactory, _GrowableList, ., kGrowableObjectArrayCid, \
0x3eed680b) \
V(_Int8ArrayFactory, Int8List, ., kTypedDataInt8ArrayCid, 0x7e39a3a1) \
V(_Uint8ArrayFactory, Uint8List, ., kTypedDataUint8ArrayCid, 0x3a79adf7) \
V(_Uint8ClampedArrayFactory, Uint8ClampedList, ., \
kTypedDataUint8ClampedArrayCid, 0x67f38395) \
V(_Int16ArrayFactory, Int16List, ., kTypedDataInt16ArrayCid, 0x6477bda8) \
V(_Uint16ArrayFactory, Uint16List, ., kTypedDataUint16ArrayCid, 0x5707c5a2) \
V(_Int32ArrayFactory, Int32List, ., kTypedDataInt32ArrayCid, 0x2b96ec0e) \
V(_Uint32ArrayFactory, Uint32List, ., kTypedDataUint32ArrayCid, 0x0c1c0d62) \
V(_Int64ArrayFactory, Int64List, ., kTypedDataInt64ArrayCid, 0x279ab485) \
V(_Uint64ArrayFactory, Uint64List, ., kTypedDataUint64ArrayCid, 0x7bcb89c2) \
V(_Float64ArrayFactory, Float64List, ., kTypedDataFloat64ArrayCid, \
0x1fde3eaf) \
V(_Float32ArrayFactory, Float32List, ., kTypedDataFloat32ArrayCid, \
0x43506c09) \
V(_Float32x4ArrayFactory, Float32x4List, ., kTypedDataFloat32x4ArrayCid, \
0x4a4030d6)
// clang-format on
// Class that recognizes factories and returns corresponding result cid.
class FactoryRecognizer : public AllStatic {
public:

View file

@ -0,0 +1,545 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#ifndef RUNTIME_VM_COMPILER_RECOGNIZED_METHODS_LIST_H_
#define RUNTIME_VM_COMPILER_RECOGNIZED_METHODS_LIST_H_
namespace dart {
// clang-format off
// (class-name, function-name, recognized enum, result type, fingerprint).
// When adding a new function add a 0 as fingerprint, build and run to get the
// correct fingerprint from the mismatch error (or use Library::GetFunction()
// and print func.SourceFingerprint()).
#define OTHER_RECOGNIZED_LIST(V) \
V(::, identical, ObjectIdentical, 0x49c6e96a) \
V(ClassID, getID, ClassIDgetID, 0x7b18b257) \
V(Object, Object., ObjectConstructor, 0x681617fe) \
V(List, ., ListFactory, 0x629f8324) \
V(_List, ., ObjectArrayAllocate, 0x2121902f) \
V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 0x7041895a) \
V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 0x336fa3ea) \
V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 0x231bbe2e) \
V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 0x0371785f) \
V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 0x65ab3a20) \
V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 0x0cb0fcf6) \
V(_TypedList, _getInt64, ByteArrayBaseGetInt64, 0x7db75d78) \
V(_TypedList, _getUint64, ByteArrayBaseGetUint64, 0x1487cfc6) \
V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 0x6674ea6f) \
V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 0x236c6e7a) \
V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 0x5c367ffb) \
V(_TypedList, _getInt32x4, ByteArrayBaseGetInt32x4, 0x772d1c0f) \
V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 0x12bae36a) \
V(_TypedList, _setUint8, ByteArrayBaseSetUint8, 0x15821cc9) \
V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 0x1f8237fa) \
V(_TypedList, _setUint16, ByteArrayBaseSetUint16, 0x181e5d16) \
V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 0x7ddb9f87) \
V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 0x74094f8d) \
V(_TypedList, _setInt64, ByteArrayBaseSetInt64, 0x4741396e) \
V(_TypedList, _setUint64, ByteArrayBaseSetUint64, 0x3b398ae4) \
V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 0x03db087b) \
V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 0x38a80b0d) \
V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 0x40052c4e) \
V(_TypedList, _setInt32x4, ByteArrayBaseSetInt32x4, 0x07b89f54) \
V(::, _toClampedUint8, ConvertIntToClampedUint8, 0x564b0435) \
V(_StringBase, _interpolate, StringBaseInterpolate, 0x01ecb15a) \
V(_IntegerImplementation, toDouble, IntegerToDouble, 0x05da96ed) \
V(_Double, _add, DoubleAdd, 0x2a38277b) \
V(_Double, _sub, DoubleSub, 0x4f466391) \
V(_Double, _mul, DoubleMul, 0x175e4f66) \
V(_Double, _div, DoubleDiv, 0x0854181b) \
V(::, min, MathMin, 0x32ebc57d) \
V(::, max, MathMax, 0x377e8889) \
V(::, _doublePow, MathDoublePow, 0x5add0ec1) \
V(::, _intPow, MathIntPow, 0x11b45569) \
V(Float32x4, Float32x4., Float32x4Constructor, 0x26ea459b) \
V(Float32x4, Float32x4.zero, Float32x4Zero, 0x16eca604) \
V(Float32x4, Float32x4.splat, Float32x4Splat, 0x694e83e3) \
V(Float32x4, Float32x4.fromInt32x4Bits, Int32x4ToFloat32x4, 0x2f62ebd3) \
V(Float32x4, Float32x4.fromFloat64x2, Float64x2ToFloat32x4, 0x50ed6910) \
V(_Float32x4, shuffle, Float32x4Shuffle, 0x7829101f) \
V(_Float32x4, shuffleMix, Float32x4ShuffleMix, 0x4182c06b) \
V(_Float32x4, get:signMask, Float32x4GetSignMask, 0x1d08b351) \
V(_Float32x4, equal, Float32x4Equal, 0x11adb239) \
V(_Float32x4, greaterThan, Float32x4GreaterThan, 0x48adaf58) \
V(_Float32x4, greaterThanOrEqual, Float32x4GreaterThanOrEqual, 0x32db94ca) \
V(_Float32x4, lessThan, Float32x4LessThan, 0x425b000c) \
V(_Float32x4, lessThanOrEqual, Float32x4LessThanOrEqual, 0x0278c2f8) \
V(_Float32x4, notEqual, Float32x4NotEqual, 0x2987cd26) \
V(_Float32x4, min, Float32x4Min, 0x5ed74b6f) \
V(_Float32x4, max, Float32x4Max, 0x68696442) \
V(_Float32x4, scale, Float32x4Scale, 0x704e4122) \
V(_Float32x4, sqrt, Float32x4Sqrt, 0x2c967a6f) \
V(_Float32x4, reciprocalSqrt, Float32x4ReciprocalSqrt, 0x6264bfe8) \
V(_Float32x4, reciprocal, Float32x4Reciprocal, 0x3cd7e819) \
V(_Float32x4, unary-, Float32x4Negate, 0x37accb52) \
V(_Float32x4, abs, Float32x4Abs, 0x471cdd87) \
V(_Float32x4, clamp, Float32x4Clamp, 0x2cb30492) \
V(_Float32x4, withX, Float32x4WithX, 0x4e336aff) \
V(_Float32x4, withY, Float32x4WithY, 0x0a72b910) \
V(_Float32x4, withZ, Float32x4WithZ, 0x31e93658) \
V(_Float32x4, withW, Float32x4WithW, 0x60ddc105) \
V(Float64x2, Float64x2., Float64x2Constructor, 0x43054b9f) \
V(Float64x2, Float64x2.zero, Float64x2Zero, 0x4af12f9d) \
V(Float64x2, Float64x2.splat, Float64x2Splat, 0x134edef0) \
V(Float64x2, Float64x2.fromFloat32x4, Float32x4ToFloat64x2, 0x17d6b5e4) \
V(_Float64x2, get:x, Float64x2GetX, 0x58c09c58) \
V(_Float64x2, get:y, Float64x2GetY, 0x3cf5e5b8) \
V(_Float64x2, unary-, Float64x2Negate, 0x415ca009) \
V(_Float64x2, abs, Float64x2Abs, 0x031f9e47) \
V(_Float64x2, sqrt, Float64x2Sqrt, 0x77f711dd) \
V(_Float64x2, get:signMask, Float64x2GetSignMask, 0x27deda4b) \
V(_Float64x2, scale, Float64x2Scale, 0x26830a61) \
V(_Float64x2, withX, Float64x2WithX, 0x1d2bcaf5) \
V(_Float64x2, withY, Float64x2WithY, 0x383ed6ac) \
V(_Float64x2, min, Float64x2Min, 0x28d7ddf6) \
V(_Float64x2, max, Float64x2Max, 0x0bd74e5b) \
V(Int32x4, Int32x4., Int32x4Constructor, 0x480555a9) \
V(Int32x4, Int32x4.bool, Int32x4BoolConstructor, 0x36aa6963) \
V(Int32x4, Int32x4.fromFloat32x4Bits, Float32x4ToInt32x4, 0x6715388a) \
V(_Int32x4, get:flagX, Int32x4GetFlagX, 0x56396c82) \
V(_Int32x4, get:flagY, Int32x4GetFlagY, 0x44704738) \
V(_Int32x4, get:flagZ, Int32x4GetFlagZ, 0x20d6ff37) \
V(_Int32x4, get:flagW, Int32x4GetFlagW, 0x5045616a) \
V(_Int32x4, get:signMask, Int32x4GetSignMask, 0x2c1fb2a3) \
V(_Int32x4, shuffle, Int32x4Shuffle, 0x20bc0b16) \
V(_Int32x4, shuffleMix, Int32x4ShuffleMix, 0x5c7056e1) \
V(_Int32x4, select, Int32x4Select, 0x6b49654f) \
V(_Int32x4, withFlagX, Int32x4WithFlagX, 0x0ef58fcf) \
V(_Int32x4, withFlagY, Int32x4WithFlagY, 0x6485a9c4) \
V(_Int32x4, withFlagZ, Int32x4WithFlagZ, 0x267acdfa) \
V(_Int32x4, withFlagW, Int32x4WithFlagW, 0x345ac675) \
V(_HashVMBase, get:_index, LinkedHashMap_getIndex, 0x02477157) \
V(_HashVMBase, set:_index, LinkedHashMap_setIndex, 0x4fc8d5e0) \
V(_HashVMBase, get:_data, LinkedHashMap_getData, 0x2d7a70ac) \
V(_HashVMBase, set:_data, LinkedHashMap_setData, 0x0ec032e8) \
V(_HashVMBase, get:_usedData, LinkedHashMap_getUsedData, 0x088599ed) \
V(_HashVMBase, set:_usedData, LinkedHashMap_setUsedData, 0x5f42ca86) \
V(_HashVMBase, get:_hashMask, LinkedHashMap_getHashMask, 0x32f3b13b) \
V(_HashVMBase, set:_hashMask, LinkedHashMap_setHashMask, 0x7219c45b) \
V(_HashVMBase, get:_deletedKeys, LinkedHashMap_getDeletedKeys, 0x558481c2) \
V(_HashVMBase, set:_deletedKeys, LinkedHashMap_setDeletedKeys, 0x5aa9888d) \
V(::, _classRangeCheck, ClassRangeCheck, 0x2ae76b84) \
V(::, _classRangeCheckNegative, ClassRangeCheckNegated, 0x5acdfb75) \
// List of intrinsics:
// (class-name, function-name, intrinsification method, fingerprint).
#define CORE_LIB_INTRINSIC_LIST(V) \
V(_Smi, ~, Smi_bitNegate, 0x67299f4f) \
V(_Smi, get:bitLength, Smi_bitLength, 0x25b3cb0a) \
V(_Smi, _bitAndFromSmi, Smi_bitAndFromSmi, 0x562d5047) \
V(_BigIntImpl, _lsh, Bigint_lsh, 0x5b6cfc8b) \
V(_BigIntImpl, _rsh, Bigint_rsh, 0x6ff14a49) \
V(_BigIntImpl, _absAdd, Bigint_absAdd, 0x5bf14238) \
V(_BigIntImpl, _absSub, Bigint_absSub, 0x1de5bd32) \
V(_BigIntImpl, _mulAdd, Bigint_mulAdd, 0x6f277966) \
V(_BigIntImpl, _sqrAdd, Bigint_sqrAdd, 0x68e4c8ea) \
V(_BigIntImpl, _estimateQuotientDigit, Bigint_estimateQuotientDigit, \
0x35456d91) \
V(_BigIntMontgomeryReduction, _mulMod, Montgomery_mulMod, 0x0f7b0375) \
V(_Double, >, Double_greaterThan, 0x4f1375a3) \
V(_Double, >=, Double_greaterEqualThan, 0x4260c184) \
V(_Double, <, Double_lessThan, 0x365d1eba) \
V(_Double, <=, Double_lessEqualThan, 0x74b5eb64) \
V(_Double, ==, Double_equal, 0x613492fc) \
V(_Double, +, Double_add, 0x53994370) \
V(_Double, -, Double_sub, 0x3b69d466) \
V(_Double, *, Double_mul, 0x2bb9bd5d) \
V(_Double, /, Double_div, 0x483eee28) \
V(_Double, get:hashCode, Double_hashCode, 0x702b77b7) \
V(_Double, get:_identityHashCode, Double_identityHash, 0x7bda5549) \
V(_Double, get:isNaN, Double_getIsNaN, 0x0af9d4a9) \
V(_Double, get:isInfinite, Double_getIsInfinite, 0x0f7acb47) \
V(_Double, get:isNegative, Double_getIsNegative, 0x3a59e7f4) \
V(_Double, _mulFromInteger, Double_mulFromInteger, 0x2017fcf6) \
V(_Double, .fromInteger, DoubleFromInteger, 0x6d234f4b) \
V(_GrowableList, .withData, GrowableArray_Allocate, 0x28b2138e) \
V(_RegExp, _ExecuteMatch, RegExp_ExecuteMatch, 0x380184b1) \
V(_RegExp, _ExecuteMatchSticky, RegExp_ExecuteMatchSticky, 0x79b8f955) \
V(Object, ==, ObjectEquals, 0x7b32a55a) \
V(Object, get:runtimeType, ObjectRuntimeType, 0x00e8ab29) \
V(Object, _haveSameRuntimeType, ObjectHaveSameRuntimeType, 0x4dc50799) \
V(_StringBase, get:hashCode, String_getHashCode, 0x78c3d446) \
V(_StringBase, get:_identityHashCode, String_identityHash, 0x0472b1d8) \
V(_StringBase, get:isEmpty, StringBaseIsEmpty, 0x4a8b29c8) \
V(_StringBase, _substringMatches, StringBaseSubstringMatches, 0x46de4f10) \
V(_StringBase, [], StringBaseCharAt, 0x7cbb8603) \
V(_OneByteString, get:hashCode, OneByteString_getHashCode, 0x78c3d446) \
V(_OneByteString, _substringUncheckedNative, \
OneByteString_substringUnchecked, 0x3538ad86) \
V(_OneByteString, _setAt, OneByteStringSetAt, 0x11ffddd1) \
V(_OneByteString, _allocate, OneByteString_allocate, 0x74933376) \
V(_OneByteString, ==, OneByteString_equality, 0x4eda197e) \
V(_TwoByteString, ==, TwoByteString_equality, 0x4eda197e) \
V(_Type, get:hashCode, Type_getHashCode, 0x18d1523f) \
V(::, _getHash, Object_getHash, 0x2827856d) \
V(::, _setHash, Object_setHash, 0x690faebd) \
#define CORE_INTEGER_LIB_INTRINSIC_LIST(V) \
V(_IntegerImplementation, _addFromInteger, Integer_addFromInteger, \
0x6a10c54a) \
V(_IntegerImplementation, +, Integer_add, 0x43d53af7) \
V(_IntegerImplementation, _subFromInteger, Integer_subFromInteger, \
0x3fa4b1ed) \
V(_IntegerImplementation, -, Integer_sub, 0x2dc22e03) \
V(_IntegerImplementation, _mulFromInteger, Integer_mulFromInteger, \
0x3216e299) \
V(_IntegerImplementation, *, Integer_mul, 0x4e7a1c24) \
V(_IntegerImplementation, _moduloFromInteger, Integer_moduloFromInteger, \
0x6348b974) \
V(_IntegerImplementation, ~/, Integer_truncDivide, 0x4efb2d39) \
V(_IntegerImplementation, unary-, Integer_negate, 0x428bf6fa) \
V(_IntegerImplementation, _bitAndFromInteger, Integer_bitAndFromInteger, \
0x395b1678) \
V(_IntegerImplementation, &, Integer_bitAnd, 0x5ab35f30) \
V(_IntegerImplementation, _bitOrFromInteger, Integer_bitOrFromInteger, \
0x6a36b395) \
V(_IntegerImplementation, |, Integer_bitOr, 0x267fa107) \
V(_IntegerImplementation, _bitXorFromInteger, Integer_bitXorFromInteger, \
0x72da93f0) \
V(_IntegerImplementation, ^, Integer_bitXor, 0x0c7b0230) \
V(_IntegerImplementation, _greaterThanFromInteger, \
Integer_greaterThanFromInt, 0x4a50ed58) \
V(_IntegerImplementation, >, Integer_greaterThan, 0x6599a6e1) \
V(_IntegerImplementation, ==, Integer_equal, 0x58abc487) \
V(_IntegerImplementation, _equalToInteger, Integer_equalToInteger, \
0x063be842) \
V(_IntegerImplementation, <, Integer_lessThan, 0x365d1eba) \
V(_IntegerImplementation, <=, Integer_lessEqualThan, 0x74b5eb64) \
V(_IntegerImplementation, >=, Integer_greaterEqualThan, 0x4260c184) \
V(_IntegerImplementation, <<, Integer_shl, 0x371c45fa) \
V(_IntegerImplementation, >>, Integer_sar, 0x2b630578) \
V(_Double, toInt, DoubleToInteger, 0x26ef344b) \
#define MATH_LIB_INTRINSIC_LIST(V) \
V(::, sqrt, MathSqrt, 0x70482cf3) \
V(_Random, _nextState, Random_nextState, 0x2842c4d5) \
#define GRAPH_MATH_LIB_INTRINSIC_LIST(V) \
V(::, sin, MathSin, 0x6b7bd98c) \
V(::, cos, MathCos, 0x459bf5fe) \
V(::, tan, MathTan, 0x3bcd772a) \
V(::, asin, MathAsin, 0x2ecc2fcd) \
V(::, acos, MathAcos, 0x08cf2212) \
V(::, atan, MathAtan, 0x1e2731d5) \
V(::, atan2, MathAtan2, 0x39f1fa41) \
#define TYPED_DATA_LIB_INTRINSIC_LIST(V) \
V(Int8List, ., TypedData_Int8Array_factory, 0x7e39a3a1) \
V(Uint8List, ., TypedData_Uint8Array_factory, 0x3a79adf7) \
V(Uint8ClampedList, ., TypedData_Uint8ClampedArray_factory, 0x67f38395) \
V(Int16List, ., TypedData_Int16Array_factory, 0x6477bda8) \
V(Uint16List, ., TypedData_Uint16Array_factory, 0x5707c5a2) \
V(Int32List, ., TypedData_Int32Array_factory, 0x2b96ec0e) \
V(Uint32List, ., TypedData_Uint32Array_factory, 0x0c1c0d62) \
V(Int64List, ., TypedData_Int64Array_factory, 0x279ab485) \
V(Uint64List, ., TypedData_Uint64Array_factory, 0x7bcb89c2) \
V(Float32List, ., TypedData_Float32Array_factory, 0x43506c09) \
V(Float64List, ., TypedData_Float64Array_factory, 0x1fde3eaf) \
V(Float32x4List, ., TypedData_Float32x4Array_factory, 0x4a4030d6) \
V(Int32x4List, ., TypedData_Int32x4Array_factory, 0x6dd02406) \
V(Float64x2List, ., TypedData_Float64x2Array_factory, 0x688e4e97) \
#define GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \
V(_Int8List, [], Int8ArrayGetIndexed, 0x49767a2c) \
V(_Int8List, []=, Int8ArraySetIndexed, 0x24f42cd0) \
V(_Uint8List, [], Uint8ArrayGetIndexed, 0x088d86d4) \
V(_Uint8List, []=, Uint8ArraySetIndexed, 0x12639541) \
V(_ExternalUint8Array, [], ExternalUint8ArrayGetIndexed, 0x088d86d4) \
V(_ExternalUint8Array, []=, ExternalUint8ArraySetIndexed, 0x12639541) \
V(_Uint8ClampedList, [], Uint8ClampedArrayGetIndexed, 0x088d86d4) \
V(_Uint8ClampedList, []=, Uint8ClampedArraySetIndexed, 0x6790dba1) \
V(_ExternalUint8ClampedArray, [], ExternalUint8ClampedArrayGetIndexed, \
0x088d86d4) \
V(_ExternalUint8ClampedArray, []=, ExternalUint8ClampedArraySetIndexed, \
0x6790dba1) \
V(_Int16List, [], Int16ArrayGetIndexed, 0x5ec64948) \
V(_Int16List, []=, Int16ArraySetIndexed, 0x0e4e8221) \
V(_Uint16List, [], Uint16ArrayGetIndexed, 0x5f49d093) \
V(_Uint16List, []=, Uint16ArraySetIndexed, 0x2efbc90f) \
V(_Int32List, [], Int32ArrayGetIndexed, 0x4bc0d3dd) \
V(_Int32List, []=, Int32ArraySetIndexed, 0x1adf9823) \
V(_Uint32List, [], Uint32ArrayGetIndexed, 0x188658ce) \
V(_Uint32List, []=, Uint32ArraySetIndexed, 0x01f51a79) \
V(_Int64List, [], Int64ArrayGetIndexed, 0x51eafb97) \
V(_Int64List, []=, Int64ArraySetIndexed, 0x376181fb) \
V(_Uint64List, [], Uint64ArrayGetIndexed, 0x4b2a1ba2) \
V(_Uint64List, []=, Uint64ArraySetIndexed, 0x5f881bd4) \
V(_Float64List, [], Float64ArrayGetIndexed, 0x0a714486) \
V(_Float64List, []=, Float64ArraySetIndexed, 0x04937367) \
V(_Float32List, [], Float32ArrayGetIndexed, 0x5ade301f) \
V(_Float32List, []=, Float32ArraySetIndexed, 0x0d5c2e2b) \
V(_Float32x4List, [], Float32x4ArrayGetIndexed, 0x128cddeb) \
V(_Float32x4List, []=, Float32x4ArraySetIndexed, 0x7ad55c72) \
V(_Int32x4List, [], Int32x4ArrayGetIndexed, 0x4b78af9c) \
V(_Int32x4List, []=, Int32x4ArraySetIndexed, 0x31453dab) \
V(_Float64x2List, [], Float64x2ArrayGetIndexed, 0x644a0be1) \
V(_Float64x2List, []=, Float64x2ArraySetIndexed, 0x6b836b0b) \
V(_TypedList, get:length, TypedDataLength, 0x2091c4d8) \
V(_Float32x4, get:x, Float32x4ShuffleX, 0x63d1a9fd) \
V(_Float32x4, get:y, Float32x4ShuffleY, 0x203523d9) \
V(_Float32x4, get:z, Float32x4ShuffleZ, 0x13190678) \
V(_Float32x4, get:w, Float32x4ShuffleW, 0x698a38de) \
V(_Float32x4, *, Float32x4Mul, 0x5dec68b2) \
V(_Float32x4, -, Float32x4Sub, 0x3ea14461) \
V(_Float32x4, +, Float32x4Add, 0x7ffcf301) \
#define GRAPH_CORE_INTRINSICS_LIST(V) \
V(_List, get:length, ObjectArrayLength, 0x25952390) \
V(_List, [], ObjectArrayGetIndexed, 0x653da02e) \
V(_List, []=, ObjectArraySetIndexed, 0x16b3d2b0) \
V(_List, _setIndexed, ObjectArraySetIndexedUnchecked, 0x50d64c75) \
V(_ImmutableList, get:length, ImmutableArrayLength, 0x25952390) \
V(_ImmutableList, [], ImmutableArrayGetIndexed, 0x653da02e) \
V(_GrowableList, get:length, GrowableArrayLength, 0x18dd86b4) \
V(_GrowableList, get:_capacity, GrowableArrayCapacity, 0x2e04be60) \
V(_GrowableList, _setData, GrowableArraySetData, 0x3dbea348) \
V(_GrowableList, _setLength, GrowableArraySetLength, 0x753e55da) \
V(_GrowableList, [], GrowableArrayGetIndexed, 0x446fe1f0) \
V(_GrowableList, []=, GrowableArraySetIndexed, 0x40a462ec) \
V(_GrowableList, _setIndexed, GrowableArraySetIndexedUnchecked, 0x297083df) \
V(_StringBase, get:length, StringBaseLength, 0x2a2d03d1) \
V(_OneByteString, codeUnitAt, OneByteStringCodeUnitAt, 0x55a0a1f3) \
V(_TwoByteString, codeUnitAt, TwoByteStringCodeUnitAt, 0x55a0a1f3) \
V(_ExternalOneByteString, codeUnitAt, ExternalOneByteStringCodeUnitAt, \
0x55a0a1f3) \
V(_ExternalTwoByteString, codeUnitAt, ExternalTwoByteStringCodeUnitAt, \
0x55a0a1f3) \
V(_Double, unary-, DoubleFlipSignBit, 0x6db4674f) \
V(_Double, truncateToDouble, DoubleTruncate, 0x2f27e5d3) \
V(_Double, roundToDouble, DoubleRound, 0x2f89c512) \
V(_Double, floorToDouble, DoubleFloor, 0x6aa87a5f) \
V(_Double, ceilToDouble, DoubleCeil, 0x1b045e9e) \
V(_Double, _modulo, DoubleMod, 0x5b8ceed7)
#define GRAPH_INTRINSICS_LIST(V) \
GRAPH_CORE_INTRINSICS_LIST(V) \
GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \
GRAPH_MATH_LIB_INTRINSIC_LIST(V) \
#define DEVELOPER_LIB_INTRINSIC_LIST(V) \
V(_UserTag, makeCurrent, UserTag_makeCurrent, 0x0b3066fd) \
V(::, _getDefaultTag, UserTag_defaultTag, 0x69f3f1ad) \
V(::, _getCurrentTag, Profiler_getCurrentTag, 0x05fa99d2) \
V(::, _isDartStreamEnabled, Timeline_isDartStreamEnabled, 0x72f13f7a) \
#define ASYNC_LIB_INTRINSIC_LIST(V) \
V(::, _clearAsyncThreadStackTrace, ClearAsyncThreadStackTrace, 0x2edd4b25) \
V(::, _setAsyncThreadStackTrace, SetAsyncThreadStackTrace, 0x04f429a7) \
#define ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \
ASYNC_LIB_INTRINSIC_LIST(V) \
CORE_LIB_INTRINSIC_LIST(V) \
DEVELOPER_LIB_INTRINSIC_LIST(V) \
MATH_LIB_INTRINSIC_LIST(V) \
TYPED_DATA_LIB_INTRINSIC_LIST(V) \
#define ALL_INTRINSICS_LIST(V) \
ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \
CORE_INTEGER_LIB_INTRINSIC_LIST(V)
#define RECOGNIZED_LIST(V) \
OTHER_RECOGNIZED_LIST(V) \
ALL_INTRINSICS_LIST(V) \
GRAPH_INTRINSICS_LIST(V)
// A list of core function that should always be inlined.
#define INLINE_WHITE_LIST(V) \
V(Object, ==, ObjectEquals, 0x7b32a55a) \
V(_List, get:length, ObjectArrayLength, 0x25952390) \
V(_ImmutableList, get:length, ImmutableArrayLength, 0x25952390) \
V(_TypedList, get:length, TypedDataLength, 0x2091c4d8) \
V(_GrowableList, get:length, GrowableArrayLength, 0x18dd86b4) \
V(_GrowableList, get:_capacity, GrowableArrayCapacity, 0x2e04be60) \
V(_GrowableList, add, GrowableListAdd, 0x40b490b8) \
V(_GrowableList, removeLast, GrowableListRemoveLast, 0x007855e5) \
V(_StringBase, get:length, StringBaseLength, 0x2a2d03d1) \
V(ListIterator, moveNext, ListIteratorMoveNext, 0x2dca30ce) \
V(_FixedSizeArrayIterator, moveNext, FixedListIteratorMoveNext, 0x324eb20b) \
V(_GrowableList, get:iterator, GrowableArrayIterator, 0x5bd2ef37) \
V(_GrowableList, forEach, GrowableArrayForEach, 0x74900bb8) \
V(_List, ., ObjectArrayAllocate, 0x2121902f) \
V(ListMixin, get:isEmpty, ListMixinIsEmpty, 0x7be74d04) \
V(_List, get:iterator, ObjectArrayIterator, 0x6c851c55) \
V(_List, forEach, ObjectArrayForEach, 0x11406b13) \
V(_List, _slice, ObjectArraySlice, 0x4c865d1d) \
V(_ImmutableList, get:iterator, ImmutableArrayIterator, 0x6c851c55) \
V(_ImmutableList, forEach, ImmutableArrayForEach, 0x11406b13) \
V(_Int8ArrayView, [], Int8ArrayViewGetIndexed, 0x7e5a8458) \
V(_Int8ArrayView, []=, Int8ArrayViewSetIndexed, 0x62f615e4) \
V(_Uint8ArrayView, [], Uint8ArrayViewGetIndexed, 0x7d308247) \
V(_Uint8ArrayView, []=, Uint8ArrayViewSetIndexed, 0x65ba546e) \
V(_Uint8ClampedArrayView, [], Uint8ClampedArrayViewGetIndexed, 0x7d308247) \
V(_Uint8ClampedArrayView, []=, Uint8ClampedArrayViewSetIndexed, 0x65ba546e) \
V(_Uint16ArrayView, [], Uint16ArrayViewGetIndexed, 0xe96836dd) \
V(_Uint16ArrayView, []=, Uint16ArrayViewSetIndexed, 0x15b02947) \
V(_Int16ArrayView, [], Int16ArrayViewGetIndexed, 0x1b24a48b) \
V(_Int16ArrayView, []=, Int16ArrayViewSetIndexed, 0xb91ec2e6) \
V(_Uint32ArrayView, [], Uint32ArrayViewGetIndexed, 0x8a4f93b3) \
V(_Uint32ArrayView, []=, Uint32ArrayViewSetIndexed, 0xf54918b5) \
V(_Int32ArrayView, [], Int32ArrayViewGetIndexed, 0x85040819) \
V(_Int32ArrayView, []=, Int32ArrayViewSetIndexed, 0xaec8c6f5) \
V(_Uint64ArrayView, [], Uint64ArrayViewGetIndexed, 0xd0c44fe7) \
V(_Uint64ArrayView, []=, Uint64ArrayViewSetIndexed, 0x402712b7) \
V(_Int64ArrayView, [], Int64ArrayViewGetIndexed, 0xf3090b95) \
V(_Int64ArrayView, []=, Int64ArrayViewSetIndexed, 0xca07e497) \
V(_Float32ArrayView, [], Float32ArrayViewGetIndexed, 0xef967533) \
V(_Float32ArrayView, []=, Float32ArrayViewSetIndexed, 0xc9b691bd) \
V(_Float64ArrayView, [], Float64ArrayViewGetIndexed, 0x9d83f585) \
V(_Float64ArrayView, []=, Float64ArrayViewSetIndexed, 0x3c1adabd) \
V(_ByteDataView, setInt8, ByteDataViewSetInt8, 0x6395293e) \
V(_ByteDataView, setUint8, ByteDataViewSetUint8, 0x79979d1f) \
V(_ByteDataView, setInt16, ByteDataViewSetInt16, 0x525ec534) \
V(_ByteDataView, setUint16, ByteDataViewSetUint16, 0x48eda263) \
V(_ByteDataView, setInt32, ByteDataViewSetInt32, 0x523666fa) \
V(_ByteDataView, setUint32, ByteDataViewSetUint32, 0x5a4683da) \
V(_ByteDataView, setInt64, ByteDataViewSetInt64, 0x4283a650) \
V(_ByteDataView, setUint64, ByteDataViewSetUint64, 0x687a1892) \
V(_ByteDataView, setFloat32, ByteDataViewSetFloat32, 0x7d5784fd) \
V(_ByteDataView, setFloat64, ByteDataViewSetFloat64, 0x00101e3f) \
V(_ByteDataView, getInt8, ByteDataViewGetInt8, 0x68448b4d) \
V(_ByteDataView, getUint8, ByteDataViewGetUint8, 0x5d68cbf2) \
V(_ByteDataView, getInt16, ByteDataViewGetInt16, 0x691b5ead) \
V(_ByteDataView, getUint16, ByteDataViewGetUint16, 0x78b744d8) \
V(_ByteDataView, getInt32, ByteDataViewGetInt32, 0x3a0f4efa) \
V(_ByteDataView, getUint32, ByteDataViewGetUint32, 0x583261be) \
V(_ByteDataView, getInt64, ByteDataViewGetInt64, 0x77de471c) \
V(_ByteDataView, getUint64, ByteDataViewGetUint64, 0x0ffadc4b) \
V(_ByteDataView, getFloat32, ByteDataViewGetFloat32, 0x6a205749) \
V(_ByteDataView, getFloat64, ByteDataViewGetFloat64, 0x69f58d27) \
V(::, exp, MathExp, 0x32ab9efa) \
V(::, log, MathLog, 0x1ee8f9fc) \
V(::, max, MathMax, 0x377e8889) \
V(::, min, MathMin, 0x32ebc57d) \
V(::, pow, MathPow, 0x79efc5a2) \
V(::, _classRangeCheck, ClassRangeCheck, 0x2ae76b84) \
V(::, _classRangeCheckNegative, ClassRangeCheckNegated, 0x5acdfb75) \
V(::, _toInt, ConvertMaskedInt, 0x713908fd) \
V(::, _toInt8, ConvertIntToInt8, 0x7484a780) \
V(::, _toUint8, ConvertIntToUint8, 0x0a15b522) \
V(::, _toInt16, ConvertIntToInt16, 0x0a83fcc6) \
V(::, _toUint16, ConvertIntToUint16, 0x6087d1af) \
V(::, _toInt32, ConvertIntToInt32, 0x62b451b9) \
V(::, _toUint32, ConvertIntToUint32, 0x17a8e085) \
V(::, _byteSwap16, ByteSwap16, 0x44f173be) \
V(::, _byteSwap32, ByteSwap32, 0x6219333b) \
V(::, _byteSwap64, ByteSwap64, 0x9abe57e0) \
V(Lists, copy, ListsCopy, 0x40e974f6) \
V(_HashVMBase, get:_index, LinkedHashMap_getIndex, 0x02477157) \
V(_HashVMBase, set:_index, LinkedHashMap_setIndex, 0x4fc8d5e0) \
V(_HashVMBase, get:_data, LinkedHashMap_getData, 0x2d7a70ac) \
V(_HashVMBase, set:_data, LinkedHashMap_setData, 0x0ec032e8) \
V(_HashVMBase, get:_usedData, LinkedHashMap_getUsedData, 0x088599ed) \
V(_HashVMBase, set:_usedData, LinkedHashMap_setUsedData, 0x5f42ca86) \
V(_HashVMBase, get:_hashMask, LinkedHashMap_getHashMask, 0x32f3b13b) \
V(_HashVMBase, set:_hashMask, LinkedHashMap_setHashMask, 0x7219c45b) \
V(_HashVMBase, get:_deletedKeys, LinkedHashMap_getDeletedKeys, 0x558481c2) \
V(_HashVMBase, set:_deletedKeys, LinkedHashMap_setDeletedKeys, 0x5aa9888d) \
// A list of core function that should never be inlined.
#define INLINE_BLACK_LIST(V) \
V(::, asin, MathAsin, 0x2ecc2fcd) \
V(::, acos, MathAcos, 0x08cf2212) \
V(::, atan, MathAtan, 0x1e2731d5) \
V(::, atan2, MathAtan2, 0x39f1fa41) \
V(::, cos, MathCos, 0x459bf5fe) \
V(::, sin, MathSin, 0x6b7bd98c) \
V(::, sqrt, MathSqrt, 0x70482cf3) \
V(::, tan, MathTan, 0x3bcd772a) \
V(_BigIntImpl, _lsh, Bigint_lsh, 0x5b6cfc8b) \
V(_BigIntImpl, _rsh, Bigint_rsh, 0x6ff14a49) \
V(_BigIntImpl, _absAdd, Bigint_absAdd, 0x5bf14238) \
V(_BigIntImpl, _absSub, Bigint_absSub, 0x1de5bd32) \
V(_BigIntImpl, _mulAdd, Bigint_mulAdd, 0x6f277966) \
V(_BigIntImpl, _sqrAdd, Bigint_sqrAdd, 0x68e4c8ea) \
V(_BigIntImpl, _estimateQuotientDigit, Bigint_estimateQuotientDigit, \
0x35456d91) \
V(_BigIntMontgomeryReduction, _mulMod, Montgomery_mulMod, 0x0f7b0375) \
V(_Double, >, Double_greaterThan, 0x4f1375a3) \
V(_Double, >=, Double_greaterEqualThan, 0x4260c184) \
V(_Double, <, Double_lessThan, 0x365d1eba) \
V(_Double, <=, Double_lessEqualThan, 0x74b5eb64) \
V(_Double, ==, Double_equal, 0x613492fc) \
V(_Double, +, Double_add, 0x53994370) \
V(_Double, -, Double_sub, 0x3b69d466) \
V(_Double, *, Double_mul, 0x2bb9bd5d) \
V(_Double, /, Double_div, 0x483eee28) \
V(_IntegerImplementation, +, Integer_add, 0x43d53af7) \
V(_IntegerImplementation, -, Integer_sub, 0x2dc22e03) \
V(_IntegerImplementation, *, Integer_mul, 0x4e7a1c24) \
V(_IntegerImplementation, ~/, Integer_truncDivide, 0x4efb2d39) \
V(_IntegerImplementation, unary-, Integer_negate, 0x428bf6fa) \
V(_IntegerImplementation, &, Integer_bitAnd, 0x5ab35f30) \
V(_IntegerImplementation, |, Integer_bitOr, 0x267fa107) \
V(_IntegerImplementation, ^, Integer_bitXor, 0x0c7b0230) \
V(_IntegerImplementation, >, Integer_greaterThan, 0x6599a6e1) \
V(_IntegerImplementation, ==, Integer_equal, 0x58abc487) \
V(_IntegerImplementation, <, Integer_lessThan, 0x365d1eba) \
V(_IntegerImplementation, <=, Integer_lessEqualThan, 0x74b5eb64) \
V(_IntegerImplementation, >=, Integer_greaterEqualThan, 0x4260c184) \
V(_IntegerImplementation, <<, Integer_shl, 0x371c45fa) \
V(_IntegerImplementation, >>, Integer_sar, 0x2b630578) \
// A list of core functions that internally dispatch based on received id.
#define POLYMORPHIC_TARGET_LIST(V) \
V(_StringBase, [], StringBaseCharAt, 0x7cbb8603) \
V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 0x7041895a) \
V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 0x336fa3ea) \
V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 0x231bbe2e) \
V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 0x0371785f) \
V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 0x65ab3a20) \
V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 0x0cb0fcf6) \
V(_TypedList, _getInt64, ByteArrayBaseGetInt64, 0x7db75d78) \
V(_TypedList, _getUint64, ByteArrayBaseGetUint64, 0x1487cfc6) \
V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 0x6674ea6f) \
V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 0x236c6e7a) \
V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 0x5c367ffb) \
V(_TypedList, _getInt32x4, ByteArrayBaseGetInt32x4, 0x772d1c0f) \
V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 0x12bae36a) \
V(_TypedList, _setUint8, ByteArrayBaseSetInt8, 0x15821cc9) \
V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 0x1f8237fa) \
V(_TypedList, _setUint16, ByteArrayBaseSetInt16, 0x181e5d16) \
V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 0x7ddb9f87) \
V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 0x74094f8d) \
V(_TypedList, _setInt64, ByteArrayBaseSetInt64, 0x4741396e) \
V(_TypedList, _setUint64, ByteArrayBaseSetUint64, 0x3b398ae4) \
V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 0x03db087b) \
V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 0x38a80b0d) \
V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 0x40052c4e) \
V(_TypedList, _setInt32x4, ByteArrayBaseSetInt32x4, 0x07b89f54) \
V(Object, get:runtimeType, ObjectRuntimeType, 0x00e8ab29)
// List of recognized list factories:
// (factory-name-symbol, class-name-string, constructor-name-string,
// result-cid, fingerprint).
#define RECOGNIZED_LIST_FACTORY_LIST(V) \
V(_ListFactory, _List, ., kArrayCid, 0x2121902f) \
V(_GrowableListWithData, _GrowableList, .withData, kGrowableObjectArrayCid, \
0x28b2138e) \
V(_GrowableListFactory, _GrowableList, ., kGrowableObjectArrayCid, \
0x3eed680b) \
V(_Int8ArrayFactory, Int8List, ., kTypedDataInt8ArrayCid, 0x7e39a3a1) \
V(_Uint8ArrayFactory, Uint8List, ., kTypedDataUint8ArrayCid, 0x3a79adf7) \
V(_Uint8ClampedArrayFactory, Uint8ClampedList, ., \
kTypedDataUint8ClampedArrayCid, 0x67f38395) \
V(_Int16ArrayFactory, Int16List, ., kTypedDataInt16ArrayCid, 0x6477bda8) \
V(_Uint16ArrayFactory, Uint16List, ., kTypedDataUint16ArrayCid, 0x5707c5a2) \
V(_Int32ArrayFactory, Int32List, ., kTypedDataInt32ArrayCid, 0x2b96ec0e) \
V(_Uint32ArrayFactory, Uint32List, ., kTypedDataUint32ArrayCid, 0x0c1c0d62) \
V(_Int64ArrayFactory, Int64List, ., kTypedDataInt64ArrayCid, 0x279ab485) \
V(_Uint64ArrayFactory, Uint64List, ., kTypedDataUint64ArrayCid, 0x7bcb89c2) \
V(_Float64ArrayFactory, Float64List, ., kTypedDataFloat64ArrayCid, \
0x1fde3eaf) \
V(_Float32ArrayFactory, Float32List, ., kTypedDataFloat32ArrayCid, \
0x43506c09) \
V(_Float32x4ArrayFactory, Float32x4List, ., kTypedDataFloat32x4ArrayCid, \
0x4a4030d6)
// clang-format on
} // namespace dart
#endif // RUNTIME_VM_COMPILER_RECOGNIZED_METHODS_LIST_H_

View file

@ -11,7 +11,10 @@
#include "vm/native_arguments.h"
#include "vm/native_entry.h"
#include "vm/object.h"
#include "vm/object_store.h"
#include "vm/runtime_entry.h"
#include "vm/symbols.h"
#include "vm/timeline.h"
namespace dart {
namespace compiler {
@ -24,6 +27,11 @@ bool IsNotTemporaryScopedHandle(const Object& obj) {
return obj.IsNotTemporaryScopedHandle();
}
#define DO(clazz) \
bool Is##clazz##Handle(const Object& obj) { return obj.Is##clazz(); }
CLASS_LIST_FOR_HANDLES(DO)
#undef DO
bool IsInOldSpace(const Object& obj) {
return obj.IsOld();
}
@ -93,6 +101,21 @@ const Type& IntType() {
return Type::Handle(dart::Type::IntType());
}
const Class& GrowableObjectArrayClass() {
auto object_store = Isolate::Current()->object_store();
return Class::Handle(object_store->growable_object_array_class());
}
const Class& MintClass() {
auto object_store = Isolate::Current()->object_store();
return Class::Handle(object_store->mint_class());
}
const Class& DoubleClass() {
auto object_store = Isolate::Current()->object_store();
return Class::Handle(object_store->double_class());
}
bool IsOriginalObject(const Object& object) {
if (object.IsICData()) {
return ICData::Cast(object).IsOriginal();
@ -118,6 +141,35 @@ int32_t CreateJitCookie() {
return static_cast<int32_t>(Isolate::Current()->random()->NextUInt32());
}
word TypedDataElementSizeInBytes(classid_t cid) {
return dart::TypedData::ElementSizeInBytes(cid);
}
word TypedDataMaxNewSpaceElements(classid_t cid) {
return dart::TypedData::MaxNewSpaceElements(cid);
}
const Field& LookupMathRandomStateFieldOffset() {
const auto& math_lib = dart::Library::Handle(dart::Library::MathLibrary());
ASSERT(!math_lib.IsNull());
const auto& random_class = dart::Class::Handle(
math_lib.LookupClassAllowPrivate(dart::Symbols::_Random()));
ASSERT(!random_class.IsNull());
const auto& state_field = dart::Field::ZoneHandle(
random_class.LookupInstanceFieldAllowPrivate(dart::Symbols::_state()));
return state_field;
}
word LookupFieldOffsetInBytes(const Field& field) {
return field.Offset();
}
#if defined(TARGET_ARCH_IA32)
uword SymbolsPredefinedAddress() {
return reinterpret_cast<uword>(dart::Symbols::PredefinedAddress());
}
#endif
#if !defined(TARGET_ARCH_DBC)
const Code& StubCodeAllocateArray() {
return dart::StubCode::AllocateArray();
@ -194,6 +246,14 @@ word Class::type_arguments_field_offset_in_words_offset() {
return dart::Class::type_arguments_field_offset_in_words_offset();
}
word Class::declaration_type_offset() {
return dart::Class::declaration_type_offset();
}
word Class::num_type_arguments_offset_in_bytes() {
return dart::Class::num_type_arguments_offset();
}
const word Class::kNoTypeArguments = dart::Class::kNoTypeArguments;
classid_t Class::GetId(const dart::Class& handle) {
@ -232,6 +292,10 @@ word Instance::DataOffsetFor(intptr_t cid) {
return dart::Instance::DataOffsetFor(cid);
}
word Instance::ElementSizeFor(intptr_t cid) {
return dart::Instance::ElementSizeFor(cid);
}
word Function::code_offset() {
return dart::Function::code_offset();
}
@ -326,122 +390,120 @@ word SingleTargetCache::target_offset() {
return dart::SingleTargetCache::target_offset();
}
const word Array::kMaxNewSpaceElements = dart::Array::kMaxNewSpaceElements;
word Context::InstanceSize(word n) {
return dart::Context::InstanceSize(n);
}
word Context::variable_offset(word n) {
return dart::Context::variable_offset(n);
}
word TypedData::InstanceSize() {
return sizeof(RawTypedData);
}
word Array::header_size() {
return sizeof(dart::RawArray);
}
word Array::tags_offset() {
return dart::Array::tags_offset();
}
#define CLASS_NAME_LIST(V) \
V(AbstractType, type_test_stub_entry_point_offset) \
V(ArgumentsDescriptor, count_offset) \
V(ArgumentsDescriptor, type_args_len_offset) \
V(Array, data_offset) \
V(Array, length_offset) \
V(Array, tags_offset) \
V(Array, type_arguments_offset) \
V(ClassTable, table_offset) \
V(Closure, context_offset) \
V(Closure, delayed_type_arguments_offset) \
V(Closure, function_offset) \
V(Closure, function_type_arguments_offset) \
V(Closure, instantiator_type_arguments_offset) \
V(Code, object_pool_offset) \
V(Code, saved_instructions_offset) \
V(Context, num_variables_offset) \
V(Context, parent_offset) \
V(Double, value_offset) \
V(Float32x4, value_offset) \
V(Float64x2, value_offset) \
V(GrowableObjectArray, data_offset) \
V(GrowableObjectArray, length_offset) \
V(GrowableObjectArray, type_arguments_offset) \
V(HeapPage, card_table_offset) \
V(Isolate, class_table_offset) \
V(Isolate, current_tag_offset) \
V(Isolate, default_tag_offset) \
V(Isolate, ic_miss_code_offset) \
V(Isolate, object_store_offset) \
V(Isolate, user_tag_offset) \
V(MarkingStackBlock, pointers_offset) \
V(MarkingStackBlock, top_offset) \
V(Mint, value_offset) \
V(NativeArguments, argc_tag_offset) \
V(NativeArguments, argv_offset) \
V(NativeArguments, retval_offset) \
V(NativeArguments, thread_offset) \
V(ObjectStore, double_type_offset) \
V(ObjectStore, int_type_offset) \
V(ObjectStore, string_type_offset) \
V(OneByteString, data_offset) \
V(StoreBufferBlock, pointers_offset) \
V(StoreBufferBlock, top_offset) \
V(String, hash_offset) \
V(String, length_offset) \
V(SubtypeTestCache, cache_offset) \
V(Thread, active_exception_offset) \
V(Thread, active_stacktrace_offset) \
V(Thread, async_stack_trace_offset) \
V(Thread, auto_scope_native_wrapper_entry_point_offset) \
V(Thread, bool_false_offset) \
V(Thread, bool_true_offset) \
V(Thread, dart_stream_offset) \
V(Thread, end_offset) \
V(Thread, global_object_pool_offset) \
V(Thread, isolate_offset) \
V(Thread, marking_stack_block_offset) \
V(Thread, no_scope_native_wrapper_entry_point_offset) \
V(Thread, object_null_offset) \
V(Thread, predefined_symbols_address_offset) \
V(Thread, resume_pc_offset) \
V(Thread, store_buffer_block_offset) \
V(Thread, top_exit_frame_info_offset) \
V(Thread, top_offset) \
V(Thread, top_resource_offset) \
V(Thread, vm_tag_offset) \
V(TimelineStream, enabled_offset) \
V(TwoByteString, data_offset) \
V(Type, arguments_offset) \
V(TypedData, data_offset) \
V(TypedData, length_offset) \
V(Type, hash_offset) \
V(TypeRef, type_offset) \
V(Type, signature_offset) \
V(Type, type_state_offset) \
V(UserTag, tag_offset)
word Array::data_offset() {
return dart::Array::data_offset();
}
#define DEFINE_FORWARDER(clazz, name) \
word clazz::name() { return dart::clazz::name(); }
word Array::type_arguments_offset() {
return dart::Array::type_arguments_offset();
}
word Array::length_offset() {
return dart::Array::length_offset();
}
const word Array::kMaxNewSpaceElements = dart::Array::kMaxNewSpaceElements;
word ArgumentsDescriptor::count_offset() {
return dart::ArgumentsDescriptor::count_offset();
}
word ArgumentsDescriptor::type_args_len_offset() {
return dart::ArgumentsDescriptor::type_args_len_offset();
}
word AbstractType::type_test_stub_entry_point_offset() {
return dart::AbstractType::type_test_stub_entry_point_offset();
}
word Type::type_state_offset() {
return dart::Type::type_state_offset();
}
word Type::arguments_offset() {
return dart::Type::arguments_offset();
}
word Type::signature_offset() {
return dart::Type::signature_offset();
}
word TypeRef::type_offset() {
return dart::TypeRef::type_offset();
}
CLASS_NAME_LIST(DEFINE_FORWARDER)
#undef DEFINE_FORWARDER
const word HeapPage::kBytesPerCardLog2 = dart::HeapPage::kBytesPerCardLog2;
word HeapPage::card_table_offset() {
return dart::HeapPage::card_table_offset();
const word String::kHashBits = dart::String::kHashBits;
word String::InstanceSize() {
return sizeof(dart::RawString);
}
bool Heap::IsAllocatableInNewSpace(intptr_t instance_size) {
return dart::Heap::IsAllocatableInNewSpace(instance_size);
}
word Thread::active_exception_offset() {
return dart::Thread::active_exception_offset();
}
word Thread::active_stacktrace_offset() {
return dart::Thread::active_stacktrace_offset();
}
word Thread::resume_pc_offset() {
return dart::Thread::resume_pc_offset();
}
word Thread::marking_stack_block_offset() {
return dart::Thread::marking_stack_block_offset();
}
word Thread::top_exit_frame_info_offset() {
return dart::Thread::top_exit_frame_info_offset();
}
word Thread::top_resource_offset() {
return dart::Thread::top_resource_offset();
}
word Thread::global_object_pool_offset() {
return dart::Thread::global_object_pool_offset();
}
word Thread::object_null_offset() {
return dart::Thread::object_null_offset();
}
word Thread::bool_true_offset() {
return dart::Thread::bool_true_offset();
}
word Thread::bool_false_offset() {
return dart::Thread::bool_false_offset();
}
word Thread::top_offset() {
return dart::Thread::top_offset();
}
word Thread::end_offset() {
return dart::Thread::end_offset();
}
word Thread::isolate_offset() {
return dart::Thread::isolate_offset();
}
word Thread::store_buffer_block_offset() {
return dart::Thread::store_buffer_block_offset();
}
#if !defined(TARGET_ARCH_DBC)
word Thread::write_barrier_code_offset() {
return dart::Thread::write_barrier_code_offset();
@ -496,10 +558,6 @@ word Thread::write_barrier_wrappers_thread_offset(intptr_t regno) {
}
#endif
word Thread::vm_tag_offset() {
return dart::Thread::vm_tag_offset();
}
#if !defined(TARGET_ARCH_DBC)
word Thread::monomorphic_miss_stub_offset() {
@ -564,14 +622,6 @@ word Thread::deoptimize_stub_offset() {
#endif // !defined(TARGET_ARCH_DBC)
word Thread::no_scope_native_wrapper_entry_point_offset() {
return dart::Thread::no_scope_native_wrapper_entry_point_offset();
}
word Thread::auto_scope_native_wrapper_entry_point_offset() {
return dart::Thread::auto_scope_native_wrapper_entry_point_offset();
}
#define DECLARE_CONSTANT_OFFSET_GETTER(name) \
word Thread::name##_address_offset() { \
return dart::Thread::name##_address_offset(); \
@ -583,40 +633,16 @@ word Thread::OffsetFromThread(const dart::Object& object) {
return dart::Thread::OffsetFromThread(object);
}
uword StoreBufferBlock::top_offset() {
return dart::StoreBufferBlock::top_offset();
}
uword StoreBufferBlock::pointers_offset() {
return dart::StoreBufferBlock::pointers_offset();
}
const word StoreBufferBlock::kSize = dart::StoreBufferBlock::kSize;
uword MarkingStackBlock::top_offset() {
return dart::MarkingStackBlock::top_offset();
}
uword MarkingStackBlock::pointers_offset() {
return dart::MarkingStackBlock::pointers_offset();
}
const word MarkingStackBlock::kSize = dart::MarkingStackBlock::kSize;
word Isolate::class_table_offset() {
return dart::Isolate::class_table_offset();
}
word Isolate::ic_miss_code_offset() {
return dart::Isolate::ic_miss_code_offset();
}
#if !defined(PRODUCT)
word Isolate::single_step_offset() {
return dart::Isolate::single_step_offset();
}
#endif // !defined(PRODUCT)
word ClassTable::table_offset() {
return dart::ClassTable::table_offset();
}
#if !defined(PRODUCT)
word ClassTable::ClassOffsetFor(intptr_t cid) {
return dart::ClassTable::ClassOffsetFor(cid);
@ -651,22 +677,10 @@ intptr_t Instructions::HeaderSize() {
return dart::Instructions::HeaderSize();
}
intptr_t Code::object_pool_offset() {
return dart::Code::object_pool_offset();
}
intptr_t Code::saved_instructions_offset() {
return dart::Code::saved_instructions_offset();
}
intptr_t Code::entry_point_offset(CodeEntryKind kind) {
return dart::Code::entry_point_offset(kind);
}
word SubtypeTestCache::cache_offset() {
return dart::SubtypeTestCache::cache_offset();
}
const word SubtypeTestCache::kTestEntryLength =
dart::SubtypeTestCache::kTestEntryLength;
const word SubtypeTestCache::kInstanceClassIdOrFunction =
@ -687,42 +701,6 @@ word Context::header_size() {
return sizeof(dart::RawContext);
}
word Context::parent_offset() {
return dart::Context::parent_offset();
}
word Context::num_variables_offset() {
return dart::Context::num_variables_offset();
}
word Context::variable_offset(word i) {
return dart::Context::variable_offset(i);
}
word Context::InstanceSize(word n) {
return dart::Context::InstanceSize(n);
}
word Closure::context_offset() {
return dart::Closure::context_offset();
}
word Closure::delayed_type_arguments_offset() {
return dart::Closure::delayed_type_arguments_offset();
}
word Closure::function_offset() {
return dart::Closure::function_offset();
}
word Closure::function_type_arguments_offset() {
return dart::Closure::function_type_arguments_offset();
}
word Closure::instantiator_type_arguments_offset() {
return dart::Closure::instantiator_type_arguments_offset();
}
#if !defined(PRODUCT)
word ClassHeapStats::TraceAllocationMask() {
return dart::ClassHeapStats::TraceAllocationMask();
@ -741,22 +719,7 @@ word ClassHeapStats::allocated_size_since_gc_new_space_offset() {
}
#endif // !defined(PRODUCT)
word Double::value_offset() {
return dart::Double::value_offset();
}
word Mint::value_offset() {
return dart::Mint::value_offset();
}
word Float32x4::value_offset() {
return dart::Float32x4::value_offset();
}
word Float64x2::value_offset() {
return dart::Float64x2::value_offset();
}
const word Smi::kBits = dart::Smi::kBits;
bool IsSmi(const dart::Object& a) {
return a.IsSmi();
}
@ -804,26 +767,19 @@ word ToRawPointer(const dart::Object& a) {
const word NativeEntry::kNumCallWrapperArguments =
dart::NativeEntry::kNumCallWrapperArguments;
word NativeArguments::thread_offset() {
return dart::NativeArguments::thread_offset();
}
word NativeArguments::argc_tag_offset() {
return dart::NativeArguments::argc_tag_offset();
}
word NativeArguments::argv_offset() {
return dart::NativeArguments::argv_offset();
}
word NativeArguments::retval_offset() {
return dart::NativeArguments::retval_offset();
}
word NativeArguments::StructSize() {
return sizeof(dart::NativeArguments);
}
word RegExp::function_offset(classid_t cid, bool sticky) {
return dart::RegExp::function_offset(cid, sticky);
}
const word Symbols::kNumberOfOneCharCodeSymbols =
dart::Symbols::kNumberOfOneCharCodeSymbols;
const word Symbols::kNullCharCodeSymbolOffset =
dart::Symbols::kNullCharCodeSymbolOffset;
} // namespace target
} // namespace compiler
} // namespace dart

View file

@ -21,6 +21,7 @@
#include "platform/globals.h"
#include "vm/allocation.h"
#include "vm/bitfield.h"
#include "vm/class_id.h"
#include "vm/code_entry_kind.h"
#include "vm/frame_layout.h"
#include "vm/pointer_tagging.h"
@ -30,19 +31,15 @@
namespace dart {
// Forward declarations.
class Bool;
class Class;
class Code;
class Code;
class Function;
class LocalVariable;
class Object;
class RuntimeEntry;
class String;
class Type;
class TypeArguments;
class Zone;
#define DO(clazz) class clazz;
CLASS_LIST_FOR_HANDLES(DO)
#undef DO
namespace compiler {
class Assembler;
}
@ -97,6 +94,9 @@ const Type& DynamicType();
const Type& ObjectType();
const Type& VoidType();
const Type& IntType();
const Class& GrowableObjectArrayClass();
const Class& MintClass();
const Class& DoubleClass();
template <typename To, typename From>
const To& CastHandle(const From& from) {
@ -149,6 +149,22 @@ bool HasIntegerValue(const dart::Object& obj, int64_t* value);
// generated code.
int32_t CreateJitCookie();
// Returns the size in bytes for the given class id.
word TypedDataElementSizeInBytes(classid_t cid);
// Returns the size in bytes for the given class id.
word TypedDataMaxNewSpaceElements(classid_t cid);
// Looks up the dart:math's _Random._A field.
const Field& LookupMathRandomStateFieldOffset();
// Returns the offset in bytes of [field].
word LookupFieldOffsetInBytes(const Field& field);
#if defined(TARGET_ARCH_IA32)
uword SymbolsPredefinedAddress();
#endif
typedef void (*RuntimeEntryCallInternal)(const dart::RuntimeEntry*,
compiler::Assembler*,
intptr_t);
@ -328,6 +344,11 @@ class Class : public AllStatic {
public:
static word type_arguments_field_offset_in_words_offset();
static word declaration_type_offset();
// The offset of the RawObject::num_type_arguments_ field in bytes.
static word num_type_arguments_offset_in_bytes();
// The value used if no type arguments vector is present.
static const word kNoTypeArguments;
@ -358,6 +379,7 @@ class Instance : public AllStatic {
// Returns the offset to the first field of [RawInstance].
static word first_field_offset();
static word DataOffsetFor(intptr_t cid);
static word ElementSizeFor(intptr_t cid);
};
class Function : public AllStatic {
@ -413,6 +435,20 @@ class Array : public AllStatic {
static const word kMaxNewSpaceElements;
};
class GrowableObjectArray : public AllStatic {
public:
static word data_offset();
static word type_arguments_offset();
static word length_offset();
};
class TypedData : public AllStatic {
public:
static word data_offset();
static word length_offset();
static word InstanceSize();
};
class ArgumentsDescriptor : public AllStatic {
public:
static word count_offset();
@ -426,6 +462,7 @@ class AbstractType : public AllStatic {
class Type : public AllStatic {
public:
static word hash_offset();
static word type_state_offset();
static word arguments_offset();
static word signature_offset();
@ -441,11 +478,34 @@ class Double : public AllStatic {
static word value_offset();
};
class Smi : public AllStatic {
public:
static const word kBits;
};
class Mint : public AllStatic {
public:
static word value_offset();
};
class String : public AllStatic {
public:
static const word kHashBits;
static word hash_offset();
static word length_offset();
static word InstanceSize();
};
class OneByteString : public AllStatic {
public:
static word data_offset();
};
class TwoByteString : public AllStatic {
public:
static word data_offset();
};
class Float32x4 : public AllStatic {
public:
static word value_offset();
@ -456,8 +516,17 @@ class Float64x2 : public AllStatic {
static word value_offset();
};
class TimelineStream : public AllStatic {
public:
static word enabled_offset();
};
class Thread : public AllStatic {
public:
static word dart_stream_offset();
static word async_stack_trace_offset();
static word predefined_symbols_address_offset();
static word active_exception_offset();
static word active_stacktrace_offset();
static word resume_pc_offset();
@ -526,20 +595,31 @@ class Thread : public AllStatic {
class StoreBufferBlock : public AllStatic {
public:
static uword top_offset();
static uword pointers_offset();
static word top_offset();
static word pointers_offset();
static const word kSize;
};
class MarkingStackBlock : public AllStatic {
public:
static uword top_offset();
static uword pointers_offset();
static word top_offset();
static word pointers_offset();
static const word kSize;
};
class ObjectStore : public AllStatic {
public:
static word double_type_offset();
static word int_type_offset();
static word string_type_offset();
};
class Isolate : public AllStatic {
public:
static word object_store_offset();
static word default_tag_offset();
static word current_tag_offset();
static word user_tag_offset();
static word class_table_offset();
static word ic_miss_code_offset();
#if !defined(PRODUCT)
@ -650,6 +730,22 @@ class NativeEntry {
static const word kNumCallWrapperArguments;
};
class RegExp : public AllStatic {
public:
static word function_offset(classid_t cid, bool sticky);
};
class UserTag : public AllStatic {
public:
static word tag_offset();
};
class Symbols : public AllStatic {
public:
static const word kNumberOfOneCharCodeSymbols;
static const word kNullCharCodeSymbolOffset;
};
} // namespace target
} // namespace compiler
} // namespace dart

View file

@ -1879,7 +1879,7 @@ RawError* Object::Init(Isolate* isolate,
ClassFinalizer::VerifyBootstrapClasses();
// Set up the intrinsic state of all functions (core, math and typed data).
Intrinsifier::InitializeState();
compiler::Intrinsifier::InitializeState();
// Set up recognized state of all functions (core, math and typed data).
MethodRecognizer::InitializeState();

View file

@ -843,6 +843,9 @@ class Class : public Object {
StoreNonPointer(&raw_ptr()->id_, value);
}
static intptr_t id_offset() { return OFFSET_OF(RawClass, id_); }
static intptr_t num_type_arguments_offset() {
return OFFSET_OF(RawClass, num_type_arguments_);
}
RawString* Name() const;
RawString* ScrubbedName() const;
@ -1397,9 +1400,6 @@ class Class : public Object {
int16_t num_type_arguments() const { return raw_ptr()->num_type_arguments_; }
void set_num_type_arguments(intptr_t value) const;
static intptr_t num_type_arguments_offset() {
return OFFSET_OF(RawClass, num_type_arguments_);
}
public:
bool has_pragma() const {