// Copyright 2019 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_COMPILER_GLOBALS_H_ #define V8_COMPILER_GLOBALS_H_ #include <ostream> #include "src/common/globals.h" #include "src/flags/flags.h" #include "src/objects/js-objects.h" #include "src/runtime/runtime.h" namespace v8 { namespace internal { namespace compiler { // The nci flag is currently used to experiment with feedback collection in // optimized code produced by generic lowering. // Considerations: // - Should we increment the call count? https://crbug.com/v8/10524 // - Is feedback already megamorphic in all these cases? // // TODO(jgruber): Remove once we've made a decision whether to collect feedback // unconditionally. inline bool CollectFeedbackInGenericLowering() { … } enum class StackCheckKind : uint8_t { … }; inline Runtime::FunctionId GetBuiltinForStackCheckKind(StackCheckKind kind) { … } enum class CanThrow : uint8_t { … }; enum class LazyDeoptOnThrow : uint8_t { … }; inline std::ostream& operator<<(std::ostream& os, LazyDeoptOnThrow lazy_deopt_on_throw) { … } inline std::ostream& operator<<(std::ostream& os, StackCheckKind kind) { … } inline size_t hash_value(StackCheckKind kind) { … } enum class CheckForMinusZeroMode : uint8_t { … }; inline size_t hash_value(CheckForMinusZeroMode mode) { … } inline std::ostream& operator<<(std::ostream& os, CheckForMinusZeroMode mode) { … } // The CallFeedbackRelation provides the meaning of the call feedback for a // TurboFan JSCall operator // - kReceiver: The call target was Function.prototype.apply and its receiver // was recorded as the feedback value. // - kTarget: The call target was recorded as the feedback value. // - kUnrelated: The feedback is no longer related to the call. If, during // lowering, a JSCall (e.g. of a higher order function) is replaced by a // JSCall with another target, the feedback has to be kept but is now // unrelated. enum class CallFeedbackRelation { … }; inline std::ostream& operator<<(std::ostream& os, CallFeedbackRelation call_feedback_relation) { … } // Maximum depth and total number of elements and properties for literal // graphs to be considered for fast deep-copying. The limit is chosen to // match the maximum number of inobject properties, to ensure that the // performance of using object literals is not worse than using constructor // functions, see crbug.com/v8/6211 for details. const int kMaxFastLiteralDepth = …; const int kMaxFastLiteralProperties = …; enum BaseTaggedness : uint8_t { … }; enum class MemoryAccessKind : uint8_t { … }; size_t hash_value(MemoryAccessKind); V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, MemoryAccessKind); inline ExternalArrayType GetArrayTypeFromElementsKind(ElementsKind kind) { … } inline int ExternalArrayElementSize(const ExternalArrayType element_type) { … } } // namespace compiler } // namespace internal } // namespace v8 // The biggest double value that fits within the int64_t/uint64_t value range. // This is different from safe integer range in that there are gaps of integers // in-between that cannot be represented as a double. constexpr double kMaxDoubleRepresentableInt64 = …; constexpr double kMinDoubleRepresentableInt64 = …; constexpr double kMaxDoubleRepresentableUint64 = …; // There is no (currently) available constexpr version of base::bit_cast, so // we have to make do with constructing the -0.0 bits manually (by setting the // sign bit to 1 and everything else to 0). // TODO(leszeks): Revisit when upgrading to C++20. constexpr int32_t kMinusZeroLoBits = …; constexpr int32_t kMinusZeroHiBits = …; constexpr int64_t kMinusZeroBits = …; #endif // V8_COMPILER_GLOBALS_H_