[Temporal] Remove unnecessary -0 code

Bug: v8:11544
Change-Id: I1f8fa01ece950addac048c5ae94d8c961666f720
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3384241
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78594}
This commit is contained in:
Frank Tang 2022-01-12 15:33:55 -08:00 committed by V8 LUCI CQ
parent 0f294a8fef
commit 8dfe2d4156

View File

@ -603,15 +603,6 @@ TO_BE_IMPLEMENTED(TemporalZonedDateTimePrototypeToLocaleString)
return obj->field(); \
}
#define TEMPORAL_GET_NO_NEG_ZERO(T, METHOD, field) \
BUILTIN(Temporal##T##Prototype##METHOD) { \
HandleScope scope(isolate); \
const char* method = "get Temporal." #T ".prototype." #field; \
CHECK_RECEIVER(JSTemporal##T, obj, method); \
if (obj->field().IsMinusZero()) return Smi::zero(); \
return obj->field(); \
}
// PlainDate
BUILTIN(TemporalPlainDateConstructor) {
HandleScope scope(isolate);
@ -729,16 +720,16 @@ BUILTIN(TemporalDurationConstructor) {
args.atOrUndefined(isolate, 9), // microseconds
args.atOrUndefined(isolate, 10))); // nanoseconds
}
TEMPORAL_GET_NO_NEG_ZERO(Duration, Years, years)
TEMPORAL_GET_NO_NEG_ZERO(Duration, Months, months)
TEMPORAL_GET_NO_NEG_ZERO(Duration, Weeks, weeks)
TEMPORAL_GET_NO_NEG_ZERO(Duration, Days, days)
TEMPORAL_GET_NO_NEG_ZERO(Duration, Hours, hours)
TEMPORAL_GET_NO_NEG_ZERO(Duration, Minutes, minutes)
TEMPORAL_GET_NO_NEG_ZERO(Duration, Seconds, seconds)
TEMPORAL_GET_NO_NEG_ZERO(Duration, Milliseconds, milliseconds)
TEMPORAL_GET_NO_NEG_ZERO(Duration, Microseconds, microseconds)
TEMPORAL_GET_NO_NEG_ZERO(Duration, Nanoseconds, nanoseconds)
TEMPORAL_GET(Duration, Years, years)
TEMPORAL_GET(Duration, Months, months)
TEMPORAL_GET(Duration, Weeks, weeks)
TEMPORAL_GET(Duration, Days, days)
TEMPORAL_GET(Duration, Hours, hours)
TEMPORAL_GET(Duration, Minutes, minutes)
TEMPORAL_GET(Duration, Seconds, seconds)
TEMPORAL_GET(Duration, Milliseconds, milliseconds)
TEMPORAL_GET(Duration, Microseconds, microseconds)
TEMPORAL_GET(Duration, Nanoseconds, nanoseconds)
TEMPORAL_PROTOTYPE_METHOD0(Duration, Sign, sign)
TEMPORAL_PROTOTYPE_METHOD0(Duration, Blank, blank)
TEMPORAL_VALUE_OF(Duration)