Skip to content

Commit fba03ab

Browse files
backesCommit Bot
authored andcommitted
Correctly handlify two frame {Summarize} methods
{JavaScriptFrame::GetParameters} allocates a new {FixedArray}, hence all object references need to be handified to survive that allocation. [email protected] Bug: chromium:1000635 Change-Id: I76df5ac109bdb6999fe897bdafaf2175344ecca4 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1787429 Reviewed-by: Michael Starzinger <[email protected]> Commit-Queue: Clemens Hammacher <[email protected]> Cr-Commit-Position: refs/heads/master@{#63583}
1 parent 470e685 commit fba03ab

2 files changed

Lines changed: 21 additions & 5 deletions

File tree

src/execution/frames.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,11 +1147,11 @@ void JavaScriptFrame::Summarize(std::vector<FrameSummary>* functions) const {
11471147
DCHECK(functions->empty());
11481148
Code code = LookupCode();
11491149
int offset = static_cast<int>(pc() - code.InstructionStart());
1150-
AbstractCode abstract_code = AbstractCode::cast(code);
1150+
Handle<AbstractCode> abstract_code(AbstractCode::cast(code), isolate());
11511151
Handle<FixedArray> params = GetParameters();
11521152
FrameSummary::JavaScriptFrameSummary summary(
1153-
isolate(), receiver(), function(), abstract_code, offset, IsConstructor(),
1154-
*params);
1153+
isolate(), receiver(), function(), *abstract_code, offset,
1154+
IsConstructor(), *params);
11551155
functions->push_back(summary);
11561156
}
11571157

@@ -1824,10 +1824,11 @@ void InterpretedFrame::WriteInterpreterRegister(int register_index,
18241824

18251825
void InterpretedFrame::Summarize(std::vector<FrameSummary>* functions) const {
18261826
DCHECK(functions->empty());
1827-
AbstractCode abstract_code = AbstractCode::cast(GetBytecodeArray());
1827+
Handle<AbstractCode> abstract_code(AbstractCode::cast(GetBytecodeArray()),
1828+
isolate());
18281829
Handle<FixedArray> params = GetParameters();
18291830
FrameSummary::JavaScriptFrameSummary summary(
1830-
isolate(), receiver(), function(), abstract_code, GetBytecodeOffset(),
1831+
isolate(), receiver(), function(), *abstract_code, GetBytecodeOffset(),
18311832
IsConstructor(), *params);
18321833
functions->push_back(summary);
18331834
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2019 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
//
5+
// Flags: --stress-compaction --detailed-error-stack-trace --gc-interval=1
6+
7+
function add(a, b) {
8+
throw new Error();
9+
}
10+
for (let i = 0; i < 100; ++i) {
11+
try {
12+
add(1, 2);
13+
} catch (e) {
14+
}
15+
}

0 commit comments

Comments
 (0)