[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:
Franziska Hinkelmann 2017-04-13 11:17:53 +02:00 committed by Commit Bot
parent 57040734d8
commit b30503387f
3 changed files with 10 additions and 2 deletions

View File

@ -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();

View File

@ -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;

View 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");