Commit 94d9ffe7 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[bigint] Adapt Object::NoSideEffectsToString.

R=jkummerow@chromium.org

Bug: v8:6791
Change-Id: Ia46694ef236abd2fa037491a017eb825aa25162a
Reviewed-on: https://chromium-review.googlesource.com/732981Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48856}
parent f681e530
......@@ -265,6 +265,8 @@ bool HeapObject::IsExternalTwoByteString() const {
bool Object::IsNumber() const { return IsSmi() || IsHeapNumber(); }
bool Object::IsNumeric() const { return IsNumber() || IsBigInt(); }
bool HeapObject::IsFiller() const {
InstanceType instance_type = map()->instance_type();
return instance_type == FREE_SPACE_TYPE || instance_type == FILLER_TYPE;
......
......@@ -324,7 +324,7 @@ Handle<String> Object::NoSideEffectsToString(Isolate* isolate,
Handle<Object> input) {
DisallowJavascriptExecution no_js(isolate);
if (input->IsString() || input->IsNumber() || input->IsOddball()) {
if (input->IsString() || input->IsNumeric() || input->IsOddball()) {
return Object::ToString(isolate, input).ToHandleChecked();
} else if (input->IsFunction()) {
// -- F u n c t i o n
......
......@@ -964,7 +964,8 @@ template <class C> inline bool Is(Object* obj);
V(LayoutDescriptor) \
V(HeapObject) \
V(Primitive) \
V(Number)
V(Number) \
V(Numeric)
#define HEAP_OBJECT_ORDINARY_TYPE_LIST(V) \
V(AbstractCode) \
......
......@@ -57,6 +57,7 @@ TEST(NoSideEffectsToString) {
CheckBoolean(isolate, true, "true");
CheckBoolean(isolate, false, "false");
CheckBoolean(isolate, false, "false");
CheckObject(isolate, factory->NewBigIntFromInt(42), "42");
CheckObject(isolate, factory->undefined_value(), "undefined");
CheckObject(isolate, factory->null_value(), "null");
......
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