[type feedback] Allow position 0.
In eval scripts, the source code position can be 0 rather than greater than 0. Add regression test. Drive-by fix: unrelated typo. Bug: 707223 Change-Id: If52c0736daac3ad42ac6d324eb8ec5f1798f6f5a Reviewed-on: https://chromium-review.googlesource.com/476630 Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Commit-Queue: Franziska Hinkelmann <franzih@chromium.org> Cr-Commit-Position: refs/heads/master@{#44637}
This commit is contained in:
parent
57040734d8
commit
b30503387f
@ -911,7 +911,7 @@ InlineCacheState CollectTypeProfileNexus::StateFromFeedback() const {
|
||||
}
|
||||
|
||||
void CollectTypeProfileNexus::Collect(Handle<String> type, int position) {
|
||||
DCHECK_GT(position, 0);
|
||||
DCHECK_GE(position, 0);
|
||||
Isolate* isolate = GetIsolate();
|
||||
|
||||
Object* const feedback = GetFeedback();
|
||||
|
@ -262,7 +262,7 @@ int SortedListBSearch(const List<T>& list, P cmp) {
|
||||
low = mid + 1;
|
||||
continue;
|
||||
}
|
||||
// Found the elememt.
|
||||
// Found the element.
|
||||
return mid;
|
||||
}
|
||||
return -1;
|
||||
|
8
test/mjsunit/type-profile/regress-707223.js
Normal file
8
test/mjsunit/type-profile/regress-707223.js
Normal file
@ -0,0 +1,8 @@
|
||||
// Copyright 2017 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --type-profile
|
||||
|
||||
let e;
|
||||
eval("e");
|
Loading…
Reference in New Issue
Block a user