Commit bfab4808 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[compiler] Update StringRef::ToNumber for an external strings case

ToNumber was already returning base::Optional but it still needed to be
updated for the internal external uncached string case.

As a note, both IsExternal and IsSeqString do not need to be updated
since they only look at the map.

Bug: v8:7790
Change-Id: Icb5ba7f40982c01cada2a9c2b96b824edce70d44
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2615422Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72005}
parent 950eae9a
......@@ -3102,6 +3102,14 @@ base::Optional<uint16_t> StringRef::GetFirstChar() {
base::Optional<double> StringRef::ToNumber() {
if (data_->should_access_heap()) {
if (data_->kind() == kNeverSerializedHeapObject &&
!this->IsInternalizedString()) {
TRACE_BROKER_MISSING(
broker(),
"number for kNeverSerialized non-internalized string " << *this);
return base::nullopt;
}
return TryStringToDouble(broker()->local_isolate(), object());
}
return data()->AsString()->to_number();
......
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