Commit 30e9e454 authored by Maya Lekova's avatar Maya Lekova Committed by Commit Bot

[builtins] Optimize valueOf for Number and Symbol

- Check for value map in favour of value instance type

Bug: v8:6557
Change-Id: I820267a87c169143d7a3c567d6c9508bae492350
Reviewed-on: https://chromium-review.googlesource.com/561358
Commit-Queue: Maya Lekova <mslekova@google.com>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46444}
parent 2638ba16
......@@ -3095,16 +3095,13 @@ Node* CodeStubAssembler::ToThisValue(Node* context, Node* value,
GotoIf(WordEqual(value_map, BooleanMapConstant()), &done_loop);
break;
case PrimitiveType::kNumber:
GotoIf(
Word32Equal(value_instance_type, Int32Constant(HEAP_NUMBER_TYPE)),
&done_loop);
GotoIf(WordEqual(value_map, HeapNumberMapConstant()), &done_loop);
break;
case PrimitiveType::kString:
GotoIf(IsStringInstanceType(value_instance_type), &done_loop);
break;
case PrimitiveType::kSymbol:
GotoIf(Word32Equal(value_instance_type, Int32Constant(SYMBOL_TYPE)),
&done_loop);
GotoIf(WordEqual(value_map, SymbolMapConstant()), &done_loop);
break;
}
Goto(&done_throw);
......
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