Commit 60aa28ec authored by Dan Elphick's avatar Dan Elphick Committed by Commit Bot

[explicit isolates] Add Isolate to Oddball::ToNumber

Bug: v8:7786
Change-Id: Ifb866cbb2d02f1231b3706358930e0ace54b0db0
Reviewed-on: https://chromium-review.googlesource.com/1133158Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54387}
parent d9e78322
......@@ -983,7 +983,7 @@ Reduction JSTypedLowering::ReduceJSToNumberOrNumericInput(Node* input) {
Handle<Object> input_value = input_type.AsHeapConstant()->Value();
if (input_value->IsOddball()) {
return Replace(jsgraph()->Constant(
Oddball::ToNumber(Handle<Oddball>::cast(input_value))));
Oddball::ToNumber(isolate(), Handle<Oddball>::cast(input_value))));
}
}
if (input_type.Is(Type::Number())) {
......
......@@ -1447,8 +1447,8 @@ void Oddball::set_kind(byte value) {
// static
Handle<Object> Oddball::ToNumber(Handle<Oddball> input) {
return handle(input->to_number(), input->GetIsolate());
Handle<Object> Oddball::ToNumber(Isolate* isolate, Handle<Oddball> input) {
return handle(input->to_number(), isolate);
}
......
......@@ -200,7 +200,7 @@ MaybeHandle<Object> Object::ConvertToNumberOrNumeric(Isolate* isolate,
return String::ToNumber(isolate, Handle<String>::cast(input));
}
if (input->IsOddball()) {
return Oddball::ToNumber(Handle<Oddball>::cast(input));
return Oddball::ToNumber(isolate, Handle<Oddball>::cast(input));
}
if (input->IsSymbol()) {
THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kSymbolToNumber),
......@@ -646,14 +646,14 @@ Maybe<bool> Object::Equals(Isolate* isolate, Handle<Object> x,
y = String::ToNumber(isolate, Handle<String>::cast(y));
return Just(NumberEquals(Handle<Oddball>::cast(x)->to_number(), *y));
} else if (y->IsBigInt()) {
x = Oddball::ToNumber(Handle<Oddball>::cast(x));
x = Oddball::ToNumber(isolate, Handle<Oddball>::cast(x));
return Just(BigInt::EqualToNumber(Handle<BigInt>::cast(y), x));
} else if (y->IsJSReceiver()) {
if (!JSReceiver::ToPrimitive(Handle<JSReceiver>::cast(y))
.ToHandle(&y)) {
return Nothing<bool>();
}
x = Oddball::ToNumber(Handle<Oddball>::cast(x));
x = Oddball::ToNumber(isolate, Handle<Oddball>::cast(x));
} else {
return Just(false);
}
......@@ -679,7 +679,7 @@ Maybe<bool> Object::Equals(Isolate* isolate, Handle<Object> x,
} else if (y->IsUndetectable()) {
return Just(x->IsUndetectable());
} else if (y->IsBoolean()) {
y = Oddball::ToNumber(Handle<Oddball>::cast(y));
y = Oddball::ToNumber(isolate, Handle<Oddball>::cast(y));
} else if (!JSReceiver::ToPrimitive(Handle<JSReceiver>::cast(x))
.ToHandle(&x)) {
return Nothing<bool>();
......
......@@ -3846,7 +3846,7 @@ class Oddball: public HeapObject {
// ES6 section 7.1.3 ToNumber for Boolean, Null, Undefined.
V8_WARN_UNUSED_RESULT static inline Handle<Object> ToNumber(
Handle<Oddball> input);
Isolate* isolate, Handle<Oddball> input);
DECL_CAST(Oddball)
......
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