Commit 609c8059 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

Remove redundant WARN_UNUSED_RESULT macro

Replace all uses with V8_WARN_UNUSED_RESULT.
WARN_UNUSED_RESULT was defined in src/base/compiler-specific.h, which
includes include/v8config.h, which already defined
V8_WARN_UNUSED_RESULT.

R=mstarzinger@chromium.org

Bug: v8:7570
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I662072294605036ca5aa0c8fdaa0218ac5d95f23
Reviewed-on: https://chromium-review.googlesource.com/998893Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52457}
parent 1d9b29d5
......@@ -3244,8 +3244,7 @@ class V8_EXPORT Object : public Value {
V8_WARN_UNUSED_RESULT Maybe<bool> Delete(Local<Context> context,
Local<Value> key);
V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context,
uint32_t index);
V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, uint32_t index);
V8_WARN_UNUSED_RESULT Maybe<bool> Delete(Local<Context> context,
uint32_t index);
......
......@@ -405,7 +405,7 @@ namespace v8 { template <typename T> class AlignOfHelper { char c; T t; }; }
// Annotate a function indicating the caller must examine the return value.
// Use like:
// int foo() WARN_UNUSED_RESULT;
// int foo() V8_WARN_UNUSED_RESULT;
#if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
......
......@@ -16,16 +16,6 @@
#define ALLOW_UNUSED_TYPE
#endif
// Annotate a function indicating the caller must examine the return value.
// Use like:
// int foo() WARN_UNUSED_RESULT;
#if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT
#define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
#define WARN_UNUSED_RESULT /* NOT SUPPORTED */
#endif
// Tell the compiler a function is using a printf-style format string.
// |format_param| is the one-based index of the format string parameter;
// |dots_param| is the one-based index of the "..." parameter.
......
......@@ -75,49 +75,49 @@ class Flags final {
mask_type mask_;
};
#define DEFINE_OPERATORS_FOR_FLAGS(Type) \
inline Type operator&( \
Type::flag_type lhs, \
Type::flag_type rhs)ALLOW_UNUSED_TYPE WARN_UNUSED_RESULT; \
inline Type operator&(Type::flag_type lhs, Type::flag_type rhs) { \
return Type(lhs) & rhs; \
} \
inline Type operator&(Type::flag_type lhs, \
const Type& rhs)ALLOW_UNUSED_TYPE WARN_UNUSED_RESULT; \
inline Type operator&(Type::flag_type lhs, const Type& rhs) { \
return rhs & lhs; \
} \
inline void operator&(Type::flag_type lhs, \
Type::mask_type rhs)ALLOW_UNUSED_TYPE; \
inline void operator&(Type::flag_type lhs, Type::mask_type rhs) {} \
inline Type operator|(Type::flag_type lhs, Type::flag_type rhs) \
ALLOW_UNUSED_TYPE WARN_UNUSED_RESULT; \
inline Type operator|(Type::flag_type lhs, Type::flag_type rhs) { \
return Type(lhs) | rhs; \
} \
inline Type operator|(Type::flag_type lhs, const Type& rhs) \
ALLOW_UNUSED_TYPE WARN_UNUSED_RESULT; \
inline Type operator|(Type::flag_type lhs, const Type& rhs) { \
return rhs | lhs; \
} \
inline void operator|(Type::flag_type lhs, Type::mask_type rhs) \
ALLOW_UNUSED_TYPE; \
inline void operator|(Type::flag_type lhs, Type::mask_type rhs) {} \
inline Type operator^(Type::flag_type lhs, Type::flag_type rhs) \
ALLOW_UNUSED_TYPE WARN_UNUSED_RESULT; \
inline Type operator^(Type::flag_type lhs, Type::flag_type rhs) { \
return Type(lhs) ^ rhs; \
} inline Type \
operator^(Type::flag_type lhs, const Type& rhs) \
ALLOW_UNUSED_TYPE WARN_UNUSED_RESULT; \
inline Type operator^(Type::flag_type lhs, const Type& rhs) { \
return rhs ^ lhs; \
} inline void \
operator^(Type::flag_type lhs, Type::mask_type rhs) ALLOW_UNUSED_TYPE; \
inline void operator^(Type::flag_type lhs, Type::mask_type rhs) { \
} inline Type \
operator~(Type::flag_type val)ALLOW_UNUSED_TYPE; \
#define DEFINE_OPERATORS_FOR_FLAGS(Type) \
inline Type operator&( \
Type::flag_type lhs, \
Type::flag_type rhs)ALLOW_UNUSED_TYPE V8_WARN_UNUSED_RESULT; \
inline Type operator&(Type::flag_type lhs, Type::flag_type rhs) { \
return Type(lhs) & rhs; \
} \
inline Type operator&( \
Type::flag_type lhs, \
const Type& rhs)ALLOW_UNUSED_TYPE V8_WARN_UNUSED_RESULT; \
inline Type operator&(Type::flag_type lhs, const Type& rhs) { \
return rhs & lhs; \
} \
inline void operator&(Type::flag_type lhs, \
Type::mask_type rhs)ALLOW_UNUSED_TYPE; \
inline void operator&(Type::flag_type lhs, Type::mask_type rhs) {} \
inline Type operator|(Type::flag_type lhs, Type::flag_type rhs) \
ALLOW_UNUSED_TYPE V8_WARN_UNUSED_RESULT; \
inline Type operator|(Type::flag_type lhs, Type::flag_type rhs) { \
return Type(lhs) | rhs; \
} \
inline Type operator|(Type::flag_type lhs, const Type& rhs) \
ALLOW_UNUSED_TYPE V8_WARN_UNUSED_RESULT; \
inline Type operator|(Type::flag_type lhs, const Type& rhs) { \
return rhs | lhs; \
} \
inline void operator|(Type::flag_type lhs, Type::mask_type rhs) \
ALLOW_UNUSED_TYPE; \
inline void operator|(Type::flag_type lhs, Type::mask_type rhs) {} \
inline Type operator^(Type::flag_type lhs, Type::flag_type rhs) \
ALLOW_UNUSED_TYPE V8_WARN_UNUSED_RESULT; \
inline Type operator^(Type::flag_type lhs, Type::flag_type rhs) { \
return Type(lhs) ^ rhs; \
} \
inline Type operator^(Type::flag_type lhs, const Type& rhs) \
ALLOW_UNUSED_TYPE V8_WARN_UNUSED_RESULT; \
inline Type operator^(Type::flag_type lhs, const Type& rhs) { \
return rhs ^ lhs; \
} \
inline void operator^(Type::flag_type lhs, Type::mask_type rhs) \
ALLOW_UNUSED_TYPE; \
inline void operator^(Type::flag_type lhs, Type::mask_type rhs) {} \
inline Type operator~(Type::flag_type val)ALLOW_UNUSED_TYPE; \
inline Type operator~(Type::flag_type val) { return ~Type(val); }
} // namespace base
......
......@@ -159,11 +159,11 @@ typedef union {
#define STRICT_ASSIGN(type, lval, rval) ((lval) = (rval))
int32_t __ieee754_rem_pio2(double x, double *y) WARN_UNUSED_RESULT;
double __kernel_cos(double x, double y) WARN_UNUSED_RESULT;
int __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec,
const int32_t *ipio2) WARN_UNUSED_RESULT;
double __kernel_sin(double x, double y, int iy) WARN_UNUSED_RESULT;
int32_t __ieee754_rem_pio2(double x, double* y) V8_WARN_UNUSED_RESULT;
double __kernel_cos(double x, double y) V8_WARN_UNUSED_RESULT;
int __kernel_rem_pio2(double* x, double* y, int e0, int nx, int prec,
const int32_t* ipio2) V8_WARN_UNUSED_RESULT;
double __kernel_sin(double x, double y, int iy) V8_WARN_UNUSED_RESULT;
/* __ieee754_rem_pio2(x,y)
*
......
......@@ -150,10 +150,8 @@ V8_INLINE Dest bit_cast(Source const& source) {
#define INLINE(declarator) V8_INLINE declarator
#define NO_INLINE(declarator) V8_NOINLINE declarator
// Newly written code should use WARN_UNUSED_RESULT.
#define MUST_USE_RESULT WARN_UNUSED_RESULT
// Newly written code should use V8_WARN_UNUSED_RESULT.
#define MUST_USE_RESULT V8_WARN_UNUSED_RESULT
// Define V8_USE_ADDRESS_SANITIZER macros.
#if defined(__has_feature)
......
......@@ -57,7 +57,7 @@ class V8_BASE_EXPORT ConditionVariable final {
// spuriously. When unblocked, regardless of the reason, the lock on the mutex
// is reacquired and |WaitFor()| exits. Returns true if the condition variable
// was notified prior to the timeout.
bool WaitFor(Mutex* mutex, const TimeDelta& rel_time) WARN_UNUSED_RESULT;
bool WaitFor(Mutex* mutex, const TimeDelta& rel_time) V8_WARN_UNUSED_RESULT;
// The implementation-defined native handle type.
#if V8_OS_POSIX
......
......@@ -51,7 +51,7 @@ class V8_BASE_EXPORT Mutex final {
// Tries to lock the given mutex. Returns whether the mutex was
// successfully locked.
bool TryLock() WARN_UNUSED_RESULT;
bool TryLock() V8_WARN_UNUSED_RESULT;
// The implementation-defined native handle type.
#if V8_OS_POSIX
......@@ -150,7 +150,7 @@ class V8_BASE_EXPORT RecursiveMutex final {
// Tries to lock the given mutex. Returns whether the mutex was
// successfully locked.
bool TryLock() WARN_UNUSED_RESULT;
bool TryLock() V8_WARN_UNUSED_RESULT;
// The implementation-defined native handle type.
#if V8_OS_POSIX
......
......@@ -47,7 +47,7 @@ class V8_BASE_EXPORT Semaphore final {
// Like Wait() but returns after rel_time time has passed. If the timeout
// happens the return value is false and the counter is unchanged. Otherwise
// the semaphore counter is decremented and true is returned.
bool WaitFor(const TimeDelta& rel_time) WARN_UNUSED_RESULT;
bool WaitFor(const TimeDelta& rel_time) V8_WARN_UNUSED_RESULT;
#if V8_OS_MACOSX
typedef semaphore_t NativeHandle;
......
......@@ -50,9 +50,7 @@ class V8_BASE_EXPORT RandomNumberGenerator final {
// that one int value is pseudorandomly generated and returned.
// All 2^32 possible integer values are produced with (approximately) equal
// probability.
V8_INLINE int NextInt() WARN_UNUSED_RESULT {
return Next(32);
}
V8_INLINE int NextInt() V8_WARN_UNUSED_RESULT { return Next(32); }
// Returns a pseudorandom, uniformly distributed int value between 0
// (inclusive) and the specified max value (exclusive), drawn from this random
......@@ -60,30 +58,28 @@ class V8_BASE_EXPORT RandomNumberGenerator final {
// one int value in the specified range is pseudorandomly generated and
// returned. All max possible int values are produced with (approximately)
// equal probability.
int NextInt(int max) WARN_UNUSED_RESULT;
int NextInt(int max) V8_WARN_UNUSED_RESULT;
// Returns the next pseudorandom, uniformly distributed boolean value from
// this random number generator's sequence. The general contract of
// |NextBoolean()| is that one boolean value is pseudorandomly generated and
// returned. The values true and false are produced with (approximately) equal
// probability.
V8_INLINE bool NextBool() WARN_UNUSED_RESULT {
return Next(1) != 0;
}
V8_INLINE bool NextBool() V8_WARN_UNUSED_RESULT { return Next(1) != 0; }
// Returns the next pseudorandom, uniformly distributed double value between
// 0.0 and 1.0 from this random number generator's sequence.
// The general contract of |NextDouble()| is that one double value, chosen
// (approximately) uniformly from the range 0.0 (inclusive) to 1.0
// (exclusive), is pseudorandomly generated and returned.
double NextDouble() WARN_UNUSED_RESULT;
double NextDouble() V8_WARN_UNUSED_RESULT;
// Returns the next pseudorandom, uniformly distributed int64 value from this
// random number generator's sequence. The general contract of |NextInt64()|
// is that one 64-bit int value is pseudorandomly generated and returned.
// All 2^64 possible integer values are produced with (approximately) equal
// probability.
int64_t NextInt64() WARN_UNUSED_RESULT;
int64_t NextInt64() V8_WARN_UNUSED_RESULT;
// Fills the elements of a specified array of bytes with random numbers.
void NextBytes(void* buffer, size_t buflen);
......@@ -91,7 +87,8 @@ class V8_BASE_EXPORT RandomNumberGenerator final {
// Returns the next pseudorandom set of n unique uint64 values smaller than
// max.
// n must be less or equal to max.
std::vector<uint64_t> NextSample(uint64_t max, size_t n) WARN_UNUSED_RESULT;
std::vector<uint64_t> NextSample(uint64_t max,
size_t n) V8_WARN_UNUSED_RESULT;
// Returns the next pseudorandom set of n unique uint64 values smaller than
// max.
......@@ -103,7 +100,7 @@ class V8_BASE_EXPORT RandomNumberGenerator final {
std::vector<uint64_t> NextSampleSlow(
uint64_t max, size_t n,
const std::unordered_set<uint64_t>& excluded =
std::unordered_set<uint64_t>{}) WARN_UNUSED_RESULT;
std::unordered_set<uint64_t>{}) V8_WARN_UNUSED_RESULT;
// Override the current ssed.
void SetSeed(int64_t seed);
......@@ -136,7 +133,7 @@ class V8_BASE_EXPORT RandomNumberGenerator final {
static const int64_t kAddend = 0xb;
static const int64_t kMask = V8_2PART_UINT64_C(0xffff, ffffffff);
int Next(int bits) WARN_UNUSED_RESULT;
int Next(int bits) V8_WARN_UNUSED_RESULT;
static uint64_t MurmurHash3(uint64_t);
......
......@@ -87,7 +87,7 @@ class PropertyAccessInfo final {
PropertyAccessInfo();
bool Merge(PropertyAccessInfo const* that, AccessMode access_mode,
Zone* zone) WARN_UNUSED_RESULT;
Zone* zone) V8_WARN_UNUSED_RESULT;
bool IsNotFound() const { return kind() == kNotFound; }
bool IsDataConstant() const { return kind() == kDataConstant; }
......
......@@ -69,9 +69,9 @@ inline bool operator==(const BranchOperatorInfo& a,
}
V8_EXPORT_PRIVATE const BranchOperatorInfo& BranchOperatorInfoOf(
const Operator* const) WARN_UNUSED_RESULT;
const Operator* const) V8_WARN_UNUSED_RESULT;
V8_EXPORT_PRIVATE BranchHint BranchHintOf(const Operator* const)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
// Helper function for return nodes, because returns have a hidden value input.
int ValueInputCountOfReturn(Operator const* const op);
......@@ -107,9 +107,9 @@ size_t hast_value(DeoptimizeParameters p);
std::ostream& operator<<(std::ostream&, DeoptimizeParameters p);
DeoptimizeParameters const& DeoptimizeParametersOf(Operator const* const)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
IsSafetyCheck IsSafetyCheckOf(const Operator* op) WARN_UNUSED_RESULT;
IsSafetyCheck IsSafetyCheckOf(const Operator* op) V8_WARN_UNUSED_RESULT;
class SelectParameters final {
public:
......@@ -133,16 +133,16 @@ size_t hash_value(SelectParameters const& p);
std::ostream& operator<<(std::ostream&, SelectParameters const& p);
V8_EXPORT_PRIVATE SelectParameters const& SelectParametersOf(
const Operator* const) WARN_UNUSED_RESULT;
const Operator* const) V8_WARN_UNUSED_RESULT;
V8_EXPORT_PRIVATE CallDescriptor const* CallDescriptorOf(const Operator* const)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
V8_EXPORT_PRIVATE size_t ProjectionIndexOf(const Operator* const)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
V8_EXPORT_PRIVATE MachineRepresentation
PhiRepresentationOf(const Operator* const) WARN_UNUSED_RESULT;
PhiRepresentationOf(const Operator* const) V8_WARN_UNUSED_RESULT;
// The {IrOpcode::kParameter} opcode represents an incoming parameter to the
// function. This class bundles the index and a debug name for such operators.
......@@ -162,8 +162,9 @@ class ParameterInfo final {
std::ostream& operator<<(std::ostream&, ParameterInfo const&);
V8_EXPORT_PRIVATE int ParameterIndexOf(const Operator* const)
WARN_UNUSED_RESULT;
const ParameterInfo& ParameterInfoOf(const Operator* const) WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
const ParameterInfo& ParameterInfoOf(const Operator* const)
V8_WARN_UNUSED_RESULT;
struct ObjectStateInfo final : std::pair<uint32_t, int> {
ObjectStateInfo(uint32_t object_id, int size)
......@@ -340,19 +341,20 @@ size_t hash_value(RegionObservability);
std::ostream& operator<<(std::ostream&, RegionObservability);
RegionObservability RegionObservabilityOf(Operator const*) WARN_UNUSED_RESULT;
RegionObservability RegionObservabilityOf(Operator const*)
V8_WARN_UNUSED_RESULT;
std::ostream& operator<<(std::ostream& os,
const ZoneVector<MachineType>* types);
Type* TypeGuardTypeOf(Operator const*) WARN_UNUSED_RESULT;
Type* TypeGuardTypeOf(Operator const*) V8_WARN_UNUSED_RESULT;
int OsrValueIndexOf(Operator const*) WARN_UNUSED_RESULT;
int OsrValueIndexOf(Operator const*) V8_WARN_UNUSED_RESULT;
SparseInputMask SparseInputMaskOf(Operator const*) WARN_UNUSED_RESULT;
SparseInputMask SparseInputMaskOf(Operator const*) V8_WARN_UNUSED_RESULT;
ZoneVector<MachineType> const* MachineTypesOf(Operator const*)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
// The ArgumentsElementsState and ArgumentsLengthState can describe the layout
// for backing stores of arguments objects of various types:
......@@ -375,12 +377,12 @@ ZoneVector<MachineType> const* MachineTypesOf(Operator const*)
// type to carry a backing store of {kUnappedArguments} type when {K == 0}.
typedef CreateArgumentsType ArgumentsStateType;
ArgumentsStateType ArgumentsStateTypeOf(Operator const*) WARN_UNUSED_RESULT;
ArgumentsStateType ArgumentsStateTypeOf(Operator const*) V8_WARN_UNUSED_RESULT;
uint32_t ObjectIdOf(Operator const*);
MachineRepresentation DeadValueRepresentationOf(Operator const*)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
class IfValueParameters final {
public:
......@@ -404,11 +406,12 @@ V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&,
IfValueParameters const&);
V8_EXPORT_PRIVATE IfValueParameters const& IfValueParametersOf(
const Operator* op) WARN_UNUSED_RESULT;
const Operator* op) V8_WARN_UNUSED_RESULT;
const FrameStateInfo& FrameStateInfoOf(const Operator* op) WARN_UNUSED_RESULT;
const FrameStateInfo& FrameStateInfoOf(const Operator* op)
V8_WARN_UNUSED_RESULT;
Handle<HeapObject> HeapConstantOf(const Operator* op) WARN_UNUSED_RESULT;
Handle<HeapObject> HeapConstantOf(const Operator* op) V8_WARN_UNUSED_RESULT;
// Interface for building common operators that can be used at any level of IR,
// including JavaScript, mid-level, and low-level.
......
......@@ -58,7 +58,7 @@ class CallFrequency final {
std::ostream& operator<<(std::ostream&, CallFrequency);
CallFrequency CallFrequencyOf(Operator const* op) WARN_UNUSED_RESULT;
CallFrequency CallFrequencyOf(Operator const* op) V8_WARN_UNUSED_RESULT;
// Defines the flags for a JavaScript call forwarding parameters. This
// is used as parameter by JSConstructForwardVarargs operators.
......@@ -93,7 +93,7 @@ std::ostream& operator<<(std::ostream&,
ConstructForwardVarargsParameters const&);
ConstructForwardVarargsParameters const& ConstructForwardVarargsParametersOf(
Operator const*) WARN_UNUSED_RESULT;
Operator const*) V8_WARN_UNUSED_RESULT;
// Defines the arity and the feedback for a JavaScript constructor call. This is
// used as a parameter by JSConstruct and JSConstructWithSpread operators.
......@@ -154,7 +154,7 @@ class CallForwardVarargsParameters final {
std::ostream& operator<<(std::ostream&, CallForwardVarargsParameters const&);
CallForwardVarargsParameters const& CallForwardVarargsParametersOf(
Operator const*) WARN_UNUSED_RESULT;
Operator const*) V8_WARN_UNUSED_RESULT;
// Defines the arity and the call flags for a JavaScript function call. This is
// used as a parameter by JSCall and JSCallWithSpread operators.
......@@ -662,16 +662,16 @@ size_t hash_value(ForInMode);
std::ostream& operator<<(std::ostream&, ForInMode);
ForInMode ForInModeOf(Operator const* op) WARN_UNUSED_RESULT;
ForInMode ForInModeOf(Operator const* op) V8_WARN_UNUSED_RESULT;
BinaryOperationHint BinaryOperationHintOf(const Operator* op);
CompareOperationHint CompareOperationHintOf(const Operator* op);
int GeneratorStoreRegisterCountOf(const Operator* op) WARN_UNUSED_RESULT;
int RestoreRegisterIndexOf(const Operator* op) WARN_UNUSED_RESULT;
int GeneratorStoreRegisterCountOf(const Operator* op) V8_WARN_UNUSED_RESULT;
int RestoreRegisterIndexOf(const Operator* op) V8_WARN_UNUSED_RESULT;
Handle<ScopeInfo> ScopeInfoOf(const Operator* op) WARN_UNUSED_RESULT;
Handle<ScopeInfo> ScopeInfoOf(const Operator* op) V8_WARN_UNUSED_RESULT;
// Interface for building JavaScript-level operators, e.g. directly from the
// AST. Most operators have no parameters, thus can be globally shared for all
......
......@@ -46,7 +46,7 @@ class OptionalOperator final {
typedef MachineType LoadRepresentation;
V8_EXPORT_PRIVATE LoadRepresentation LoadRepresentationOf(Operator const*)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
// A Store needs a MachineType and a WriteBarrierKind in order to emit the
// correct write barrier.
......@@ -73,13 +73,13 @@ size_t hash_value(StoreRepresentation);
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, StoreRepresentation);
V8_EXPORT_PRIVATE StoreRepresentation const& StoreRepresentationOf(
Operator const*) WARN_UNUSED_RESULT;
Operator const*) V8_WARN_UNUSED_RESULT;
// An UnalignedStore needs a MachineType.
typedef MachineRepresentation UnalignedStoreRepresentation;
UnalignedStoreRepresentation const& UnalignedStoreRepresentationOf(
Operator const*) WARN_UNUSED_RESULT;
Operator const*) V8_WARN_UNUSED_RESULT;
class StackSlotRepresentation final {
public:
......@@ -104,12 +104,12 @@ V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&,
StackSlotRepresentation);
V8_EXPORT_PRIVATE StackSlotRepresentation const& StackSlotRepresentationOf(
Operator const* op) WARN_UNUSED_RESULT;
Operator const* op) V8_WARN_UNUSED_RESULT;
MachineRepresentation AtomicStoreRepresentationOf(Operator const* op)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
MachineType AtomicOpRepresentationOf(Operator const* op) WARN_UNUSED_RESULT;
MachineType AtomicOpRepresentationOf(Operator const* op) V8_WARN_UNUSED_RESULT;
// Interface for building machine-level operators. These operators are
// machine-level but machine-independent and thus define a language suitable
......
......@@ -77,7 +77,7 @@ size_t hash_value(FieldAccess const&);
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, FieldAccess const&);
V8_EXPORT_PRIVATE FieldAccess const& FieldAccessOf(const Operator* op)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
template <>
void Operator1<FieldAccess>::PrintParameter(std::ostream& os,
......@@ -119,13 +119,13 @@ size_t hash_value(ElementAccess const&);
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, ElementAccess const&);
V8_EXPORT_PRIVATE ElementAccess const& ElementAccessOf(const Operator* op)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
ExternalArrayType ExternalArrayTypeOf(const Operator* op) WARN_UNUSED_RESULT;
ExternalArrayType ExternalArrayTypeOf(const Operator* op) V8_WARN_UNUSED_RESULT;
// The ConvertReceiverMode is used as parameter by ConvertReceiver operators.
ConvertReceiverMode ConvertReceiverModeOf(Operator const* op)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
// A the parameters for several Check nodes. The {feedback} parameter is
// optional. If {feedback} references a valid CallIC slot and this MapCheck
......@@ -147,7 +147,7 @@ size_t hash_value(CheckParameters const&);
std::ostream& operator<<(std::ostream&, CheckParameters const&);
CheckParameters const& CheckParametersOf(Operator const*) WARN_UNUSED_RESULT;
CheckParameters const& CheckParametersOf(Operator const*) V8_WARN_UNUSED_RESULT;
enum class CheckFloat64HoleMode : uint8_t {
kNeverReturnHole, // Never return the hole (deoptimize instead).
......@@ -158,7 +158,8 @@ size_t hash_value(CheckFloat64HoleMode);
std::ostream& operator<<(std::ostream&, CheckFloat64HoleMode);
CheckFloat64HoleMode CheckFloat64HoleModeOf(const Operator*) WARN_UNUSED_RESULT;
CheckFloat64HoleMode CheckFloat64HoleModeOf(const Operator*)
V8_WARN_UNUSED_RESULT;
enum class CheckTaggedInputMode : uint8_t {
kNumber,
......@@ -184,7 +185,7 @@ class CheckTaggedInputParameters {
};
const CheckTaggedInputParameters& CheckTaggedInputParametersOf(const Operator*)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
std::ostream& operator<<(std::ostream&,
const CheckTaggedInputParameters& params);
......@@ -204,7 +205,8 @@ size_t hash_value(CheckForMinusZeroMode);
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&,
CheckForMinusZeroMode);
CheckForMinusZeroMode CheckMinusZeroModeOf(const Operator*) WARN_UNUSED_RESULT;
CheckForMinusZeroMode CheckMinusZeroModeOf(const Operator*)
V8_WARN_UNUSED_RESULT;
class CheckMinusZeroParameters {
public:
......@@ -221,7 +223,7 @@ class CheckMinusZeroParameters {
};
const CheckMinusZeroParameters& CheckMinusZeroParametersOf(const Operator* op)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
std::ostream& operator<<(std::ostream&, const CheckMinusZeroParameters& params);
......@@ -287,13 +289,13 @@ size_t hash_value(CheckMapsParameters const&);
std::ostream& operator<<(std::ostream&, CheckMapsParameters const&);
CheckMapsParameters const& CheckMapsParametersOf(Operator const*)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
MapsParameterInfo const& MapGuardMapsOf(Operator const*) WARN_UNUSED_RESULT;
MapsParameterInfo const& MapGuardMapsOf(Operator const*) V8_WARN_UNUSED_RESULT;
// Parameters for CompareMaps operator.
MapsParameterInfo const& CompareMapsParametersOf(Operator const*)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
// A descriptor for growing elements backing stores.
enum class GrowFastElementsMode : uint8_t {
......@@ -329,7 +331,7 @@ inline size_t hash_value(const GrowFastElementsParameters&);
std::ostream& operator<<(std::ostream&, const GrowFastElementsParameters&);
const GrowFastElementsParameters& GrowFastElementsParametersOf(const Operator*)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
// A descriptor for elements kind transitions.
class ElementsTransition final {
......@@ -359,16 +361,16 @@ size_t hash_value(ElementsTransition);
std::ostream& operator<<(std::ostream&, ElementsTransition);
ElementsTransition const& ElementsTransitionOf(const Operator* op)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
// Parameters for TransitionAndStoreElement, or
// TransitionAndStoreNonNumberElement, or
// TransitionAndStoreNumberElement.
Handle<Map> DoubleMapParameterOf(const Operator* op) WARN_UNUSED_RESULT;
Handle<Map> FastMapParameterOf(const Operator* op) WARN_UNUSED_RESULT;
Handle<Map> DoubleMapParameterOf(const Operator* op) V8_WARN_UNUSED_RESULT;
Handle<Map> FastMapParameterOf(const Operator* op) V8_WARN_UNUSED_RESULT;
// Parameters for TransitionAndStoreNonNumberElement.
Type* ValueTypeParameterOf(const Operator* op) WARN_UNUSED_RESULT;
Type* ValueTypeParameterOf(const Operator* op) V8_WARN_UNUSED_RESULT;
// A hint for speculative number operations.
enum class NumberOperationHint : uint8_t {
......@@ -384,7 +386,7 @@ size_t hash_value(NumberOperationHint);
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, NumberOperationHint);
V8_EXPORT_PRIVATE NumberOperationHint NumberOperationHintOf(const Operator* op)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
class NumberOperationParameters {
public:
......@@ -406,10 +408,10 @@ V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&,
bool operator==(NumberOperationParameters const&,
NumberOperationParameters const&);
const NumberOperationParameters& NumberOperationParametersOf(const Operator* op)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
int FormalParameterCountOf(const Operator* op) WARN_UNUSED_RESULT;
bool IsRestLengthOf(const Operator* op) WARN_UNUSED_RESULT;
int FormalParameterCountOf(const Operator* op) V8_WARN_UNUSED_RESULT;
bool IsRestLengthOf(const Operator* op) V8_WARN_UNUSED_RESULT;
class AllocateParameters {
public:
......@@ -432,17 +434,17 @@ V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, AllocateParameters);
bool operator==(AllocateParameters const&, AllocateParameters const&);
PretenureFlag PretenureFlagOf(const Operator* op) WARN_UNUSED_RESULT;
PretenureFlag PretenureFlagOf(const Operator* op) V8_WARN_UNUSED_RESULT;
Type* AllocateTypeOf(const Operator* op) WARN_UNUSED_RESULT;
Type* AllocateTypeOf(const Operator* op) V8_WARN_UNUSED_RESULT;
UnicodeEncoding UnicodeEncodingOf(const Operator*) WARN_UNUSED_RESULT;
UnicodeEncoding UnicodeEncodingOf(const Operator*) V8_WARN_UNUSED_RESULT;
AbortReason AbortReasonOf(const Operator* op) WARN_UNUSED_RESULT;
AbortReason AbortReasonOf(const Operator* op) V8_WARN_UNUSED_RESULT;
DeoptimizeReason DeoptimizeReasonOf(const Operator* op) WARN_UNUSED_RESULT;
DeoptimizeReason DeoptimizeReasonOf(const Operator* op) V8_WARN_UNUSED_RESULT;
int NewArgumentsElementsMappedCountOf(const Operator* op) WARN_UNUSED_RESULT;
int NewArgumentsElementsMappedCountOf(const Operator* op) V8_WARN_UNUSED_RESULT;
// Interface for building simplified operators, which represent the
// medium-level operations of V8, including adding numbers, allocating objects,
......
......@@ -206,7 +206,7 @@ class JSArrayBuffer : public JSObject {
static bool SetupAllocatingData(
Handle<JSArrayBuffer> array_buffer, Isolate* isolate,
size_t allocated_length, bool initialize = true,
SharedFlag shared = SharedFlag::kNotShared) WARN_UNUSED_RESULT;
SharedFlag shared = SharedFlag::kNotShared) V8_WARN_UNUSED_RESULT;
// Dispatched behavior.
DECL_PRINTER(JSArrayBuffer)
......
......@@ -626,7 +626,7 @@ class Map : public HeapObject {
// is found by re-transitioning from the root of the transition tree using the
// descriptor array of the map. Returns MaybeHandle<Map>() if no updated map
// is found.
static MaybeHandle<Map> TryUpdate(Handle<Map> map) WARN_UNUSED_RESULT;
static MaybeHandle<Map> TryUpdate(Handle<Map> map) V8_WARN_UNUSED_RESULT;
// Returns a non-deprecated version of the input. This method may deprecate
// existing maps along the way if encodings conflict. Not for use while
......
......@@ -56,7 +56,7 @@ class ValueSerializer {
/*
* Serializes a V8 object into the buffer.
*/
Maybe<bool> WriteObject(Handle<Object> object) WARN_UNUSED_RESULT;
Maybe<bool> WriteObject(Handle<Object> object) V8_WARN_UNUSED_RESULT;
/*
* Returns the stored data. This serializer should not be used once the buffer
......@@ -117,23 +117,24 @@ class ValueSerializer {
void WriteHeapNumber(HeapNumber* number);
void WriteBigInt(BigInt* bigint);
void WriteString(Handle<String> string);
Maybe<bool> WriteJSReceiver(Handle<JSReceiver> receiver) WARN_UNUSED_RESULT;
Maybe<bool> WriteJSObject(Handle<JSObject> object) WARN_UNUSED_RESULT;
Maybe<bool> WriteJSObjectSlow(Handle<JSObject> object) WARN_UNUSED_RESULT;
Maybe<bool> WriteJSArray(Handle<JSArray> array) WARN_UNUSED_RESULT;
Maybe<bool> WriteJSReceiver(Handle<JSReceiver> receiver)
V8_WARN_UNUSED_RESULT;
Maybe<bool> WriteJSObject(Handle<JSObject> object) V8_WARN_UNUSED_RESULT;
Maybe<bool> WriteJSObjectSlow(Handle<JSObject> object) V8_WARN_UNUSED_RESULT;
Maybe<bool> WriteJSArray(Handle<JSArray> array) V8_WARN_UNUSED_RESULT;
void WriteJSDate(JSDate* date);
Maybe<bool> WriteJSValue(Handle<JSValue> value) WARN_UNUSED_RESULT;
Maybe<bool> WriteJSValue(Handle<JSValue> value) V8_WARN_UNUSED_RESULT;
void WriteJSRegExp(JSRegExp* regexp);
Maybe<bool> WriteJSMap(Handle<JSMap> map) WARN_UNUSED_RESULT;
Maybe<bool> WriteJSSet(Handle<JSSet> map) WARN_UNUSED_RESULT;
Maybe<bool> WriteJSMap(Handle<JSMap> map) V8_WARN_UNUSED_RESULT;
Maybe<bool> WriteJSSet(Handle<JSSet> map) V8_WARN_UNUSED_RESULT;
Maybe<bool> WriteJSArrayBuffer(Handle<JSArrayBuffer> array_buffer)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
Maybe<bool> WriteJSArrayBufferView(JSArrayBufferView* array_buffer);
Maybe<bool> WriteWasmModule(Handle<WasmModuleObject> object)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
Maybe<bool> WriteWasmMemory(Handle<WasmMemoryObject> object)
WARN_UNUSED_RESULT;
Maybe<bool> WriteHostObject(Handle<JSObject> object) WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
Maybe<bool> WriteHostObject(Handle<JSObject> object) V8_WARN_UNUSED_RESULT;
/*
* Reads the specified keys from the object and writes key-value pairs to the
......@@ -141,7 +142,7 @@ class ValueSerializer {
* if some keys are not own properties when accessed.
*/
Maybe<uint32_t> WriteJSObjectPropertiesSlow(
Handle<JSObject> object, Handle<FixedArray> keys) WARN_UNUSED_RESULT;
Handle<JSObject> object, Handle<FixedArray> keys) V8_WARN_UNUSED_RESULT;
/*
* Asks the delegate to handle an error that occurred during data cloning, by
......@@ -187,7 +188,7 @@ class ValueDeserializer {
/*
* Runs version detection logic, which may fail if the format is invalid.
*/
Maybe<bool> ReadHeader() WARN_UNUSED_RESULT;
Maybe<bool> ReadHeader() V8_WARN_UNUSED_RESULT;
/*
* Reads the underlying wire format version. Likely mostly to be useful to
......@@ -199,7 +200,7 @@ class ValueDeserializer {
/*
* Deserializes a V8 object from the buffer.
*/
MaybeHandle<Object> ReadObject() WARN_UNUSED_RESULT;
MaybeHandle<Object> ReadObject() V8_WARN_UNUSED_RESULT;
/*
* Reads an object, consuming the entire buffer.
......@@ -209,7 +210,7 @@ class ValueDeserializer {
* deserializing, with the contents of objects and arrays provided first.
*/
MaybeHandle<Object> ReadObjectUsingEntireBufferForLegacyFormat()
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
/*
* Accepts the array buffer corresponding to the one passed previously to
......@@ -222,64 +223,64 @@ class ValueDeserializer {
* Publicly exposed wire format writing methods.
* These are intended for use within the delegate's WriteHostObject method.
*/
bool ReadUint32(uint32_t* value) WARN_UNUSED_RESULT;
bool ReadUint64(uint64_t* value) WARN_UNUSED_RESULT;
bool ReadDouble(double* value) WARN_UNUSED_RESULT;
bool ReadRawBytes(size_t length, const void** data) WARN_UNUSED_RESULT;
bool ReadUint32(uint32_t* value) V8_WARN_UNUSED_RESULT;
bool ReadUint64(uint64_t* value) V8_WARN_UNUSED_RESULT;
bool ReadDouble(double* value) V8_WARN_UNUSED_RESULT;
bool ReadRawBytes(size_t length, const void** data) V8_WARN_UNUSED_RESULT;
void set_expect_inline_wasm(bool expect_inline_wasm) {
expect_inline_wasm_ = expect_inline_wasm;
}
private:
// Reading the wire format.
Maybe<SerializationTag> PeekTag() const WARN_UNUSED_RESULT;
Maybe<SerializationTag> PeekTag() const V8_WARN_UNUSED_RESULT;
void ConsumeTag(SerializationTag peeked_tag);
Maybe<SerializationTag> ReadTag() WARN_UNUSED_RESULT;
Maybe<SerializationTag> ReadTag() V8_WARN_UNUSED_RESULT;
template <typename T>
Maybe<T> ReadVarint() WARN_UNUSED_RESULT;
Maybe<T> ReadVarint() V8_WARN_UNUSED_RESULT;
template <typename T>
Maybe<T> ReadZigZag() WARN_UNUSED_RESULT;
Maybe<double> ReadDouble() WARN_UNUSED_RESULT;
Maybe<Vector<const uint8_t>> ReadRawBytes(int size) WARN_UNUSED_RESULT;
Maybe<T> ReadZigZag() V8_WARN_UNUSED_RESULT;
Maybe<double> ReadDouble() V8_WARN_UNUSED_RESULT;
Maybe<Vector<const uint8_t>> ReadRawBytes(int size) V8_WARN_UNUSED_RESULT;
bool expect_inline_wasm() const { return expect_inline_wasm_; }
// Reads a string if it matches the one provided.
// Returns true if this was the case. Otherwise, nothing is consumed.
bool ReadExpectedString(Handle<String> expected) WARN_UNUSED_RESULT;
bool ReadExpectedString(Handle<String> expected) V8_WARN_UNUSED_RESULT;
// Like ReadObject, but skips logic for special cases in simulating the
// "stack machine".
MaybeHandle<Object> ReadObjectInternal() WARN_UNUSED_RESULT;
MaybeHandle<Object> ReadObjectInternal() V8_WARN_UNUSED_RESULT;
// Reads a string intended to be part of a more complicated object.
// Before v12, these are UTF-8 strings. After, they can be any encoding
// permissible for a string (with the relevant tag).
MaybeHandle<String> ReadString() WARN_UNUSED_RESULT;
MaybeHandle<String> ReadString() V8_WARN_UNUSED_RESULT;
// Reading V8 objects of specific kinds.
// The tag is assumed to have already been read.
MaybeHandle<BigInt> ReadBigInt() WARN_UNUSED_RESULT;
MaybeHandle<String> ReadUtf8String() WARN_UNUSED_RESULT;
MaybeHandle<String> ReadOneByteString() WARN_UNUSED_RESULT;
MaybeHandle<String> ReadTwoByteString() WARN_UNUSED_RESULT;
MaybeHandle<JSObject> ReadJSObject() WARN_UNUSED_RESULT;
MaybeHandle<JSArray> ReadSparseJSArray() WARN_UNUSED_RESULT;
MaybeHandle<JSArray> ReadDenseJSArray() WARN_UNUSED_RESULT;
MaybeHandle<JSDate> ReadJSDate() WARN_UNUSED_RESULT;
MaybeHandle<JSValue> ReadJSValue(SerializationTag tag) WARN_UNUSED_RESULT;
MaybeHandle<JSRegExp> ReadJSRegExp() WARN_UNUSED_RESULT;
MaybeHandle<JSMap> ReadJSMap() WARN_UNUSED_RESULT;
MaybeHandle<JSSet> ReadJSSet() WARN_UNUSED_RESULT;
MaybeHandle<BigInt> ReadBigInt() V8_WARN_UNUSED_RESULT;
MaybeHandle<String> ReadUtf8String() V8_WARN_UNUSED_RESULT;
MaybeHandle<String> ReadOneByteString() V8_WARN_UNUSED_RESULT;
MaybeHandle<String> ReadTwoByteString() V8_WARN_UNUSED_RESULT;
MaybeHandle<JSObject> ReadJSObject() V8_WARN_UNUSED_RESULT;
MaybeHandle<JSArray> ReadSparseJSArray() V8_WARN_UNUSED_RESULT;
MaybeHandle<JSArray> ReadDenseJSArray() V8_WARN_UNUSED_RESULT;
MaybeHandle<JSDate> ReadJSDate() V8_WARN_UNUSED_RESULT;
MaybeHandle<JSValue> ReadJSValue(SerializationTag tag) V8_WARN_UNUSED_RESULT;
MaybeHandle<JSRegExp> ReadJSRegExp() V8_WARN_UNUSED_RESULT;
MaybeHandle<JSMap> ReadJSMap() V8_WARN_UNUSED_RESULT;
MaybeHandle<JSSet> ReadJSSet() V8_WARN_UNUSED_RESULT;
MaybeHandle<JSArrayBuffer> ReadJSArrayBuffer(bool is_shared)
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
MaybeHandle<JSArrayBuffer> ReadTransferredJSArrayBuffer()
WARN_UNUSED_RESULT;
V8_WARN_UNUSED_RESULT;
MaybeHandle<JSArrayBufferView> ReadJSArrayBufferView(
Handle<JSArrayBuffer> buffer) WARN_UNUSED_RESULT;
MaybeHandle<JSObject> ReadWasmModule() WARN_UNUSED_RESULT;
MaybeHandle<JSObject> ReadWasmModuleTransfer() WARN_UNUSED_RESULT;
MaybeHandle<WasmMemoryObject> ReadWasmMemory() WARN_UNUSED_RESULT;
MaybeHandle<JSObject> ReadHostObject() WARN_UNUSED_RESULT;
Handle<JSArrayBuffer> buffer) V8_WARN_UNUSED_RESULT;
MaybeHandle<JSObject> ReadWasmModule() V8_WARN_UNUSED_RESULT;
MaybeHandle<JSObject> ReadWasmModuleTransfer() V8_WARN_UNUSED_RESULT;
MaybeHandle<WasmMemoryObject> ReadWasmMemory() V8_WARN_UNUSED_RESULT;
MaybeHandle<JSObject> ReadHostObject() V8_WARN_UNUSED_RESULT;
/*
* Reads key-value pairs into the object until the specified end tag is
......
......@@ -1373,7 +1373,7 @@ class ThreadImpl {
// Returns true if the call was successful, false if the stack check failed
// and the current activation was fully unwound.
bool DoCall(Decoder* decoder, InterpreterCode* target, pc_t* pc,
pc_t* limit) WARN_UNUSED_RESULT {
pc_t* limit) V8_WARN_UNUSED_RESULT {
frames_.back().pc = *pc;
PushFrame(target);
if (!DoStackCheck()) return false;
......@@ -1599,7 +1599,7 @@ class ThreadImpl {
// fully unwound.
// Do call this function immediately *after* pushing a new frame. The pc of
// the top frame will be reset to 0 if the stack check fails.
bool DoStackCheck() WARN_UNUSED_RESULT {
bool DoStackCheck() V8_WARN_UNUSED_RESULT {
// The goal of this stack check is not to prevent actual stack overflows,
// but to simulate stack overflows during the execution of compiled code.
// That is why this function uses FLAG_stack_size, even though the value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment