Commit be03c645 authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[type-profiling] Fix CollectTypeProfile for lazy feedback vectors

This was written before lazy feedback vectors and expects that the
feedback vector is always present. Instead just return undefined and
do nothing if there is no feedback vector.

Change-Id: I1ffddd672576cb794eda2d5922b574a8be65d579
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2007492Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65840}
parent 1ff06cdf
...@@ -941,6 +941,11 @@ RUNTIME_FUNCTION(Runtime_CollectTypeProfile) { ...@@ -941,6 +941,11 @@ RUNTIME_FUNCTION(Runtime_CollectTypeProfile) {
DCHECK_EQ(3, args.length()); DCHECK_EQ(3, args.length());
CONVERT_ARG_HANDLE_CHECKED(Smi, position, 0); CONVERT_ARG_HANDLE_CHECKED(Smi, position, 0);
CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
CONVERT_ARG_HANDLE_CHECKED(HeapObject, maybe_vector, 2);
if (maybe_vector->IsUndefined()) {
return ReadOnlyRoots(isolate).undefined_value();
}
CONVERT_ARG_HANDLE_CHECKED(FeedbackVector, vector, 2); CONVERT_ARG_HANDLE_CHECKED(FeedbackVector, vector, 2);
Handle<String> type = Object::TypeOf(isolate, value); Handle<String> type = Object::TypeOf(isolate, value);
......
// Copyright 2020 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: --allow-natives-syntax
function f(a, b, c) {
return 'bye';
};
%CollectTypeProfile(0, f, undefined);
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