Add missing FrameState for Runtime_CreateArrayLiteral.
R=jarin@chromium.org TEST=mjsunit/regress/regress-crbug-451013 BUG=chromium:451013 LOG=N Review URL: https://codereview.chromium.org/873973003 Cr-Commit-Position: refs/heads/master@{#26268}
This commit is contained in:
parent
c6ae373335
commit
00f3f99221
@ -1893,6 +1893,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
|||||||
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
|
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
|
||||||
__ CallStub(&stub);
|
__ CallStub(&stub);
|
||||||
}
|
}
|
||||||
|
PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG);
|
||||||
|
|
||||||
bool result_saved = false; // Is the result saved to the stack?
|
bool result_saved = false; // Is the result saved to the stack?
|
||||||
|
|
||||||
|
@ -1873,6 +1873,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
|||||||
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
|
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
|
||||||
__ CallStub(&stub);
|
__ CallStub(&stub);
|
||||||
}
|
}
|
||||||
|
PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG);
|
||||||
|
|
||||||
bool result_saved = false; // Is the result saved to the stack?
|
bool result_saved = false; // Is the result saved to the stack?
|
||||||
|
|
||||||
|
10
src/ast.h
10
src/ast.h
@ -1586,12 +1586,14 @@ class ArrayLiteral FINAL : public MaterializedLiteral {
|
|||||||
Handle<FixedArray> constant_elements() const { return constant_elements_; }
|
Handle<FixedArray> constant_elements() const { return constant_elements_; }
|
||||||
ZoneList<Expression*>* values() const { return values_; }
|
ZoneList<Expression*>* values() const { return values_; }
|
||||||
|
|
||||||
// Unlike other AST nodes, this number of bailout IDs allocated for an
|
BailoutId CreateLiteralId() const { return BailoutId(local_id(0)); }
|
||||||
// ArrayLiteral can vary, so num_ids() is not a static method.
|
|
||||||
int num_ids() const { return parent_num_ids() + values()->length(); }
|
|
||||||
|
|
||||||
// Return an AST id for an element that is used in simulate instructions.
|
// Return an AST id for an element that is used in simulate instructions.
|
||||||
BailoutId GetIdForElement(int i) { return BailoutId(local_id(i)); }
|
BailoutId GetIdForElement(int i) { return BailoutId(local_id(i + 1)); }
|
||||||
|
|
||||||
|
// Unlike other AST nodes, this number of bailout IDs allocated for an
|
||||||
|
// ArrayLiteral can vary, so num_ids() is not a static method.
|
||||||
|
int num_ids() const { return parent_num_ids() + 1 + values()->length(); }
|
||||||
|
|
||||||
// Populate the constant elements fixed array.
|
// Populate the constant elements fixed array.
|
||||||
void BuildConstantElements(Isolate* isolate);
|
void BuildConstantElements(Isolate* isolate);
|
||||||
|
@ -1199,6 +1199,8 @@ void AstGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
|
|||||||
const Operator* op =
|
const Operator* op =
|
||||||
javascript()->CallRuntime(Runtime::kCreateArrayLiteral, 4);
|
javascript()->CallRuntime(Runtime::kCreateArrayLiteral, 4);
|
||||||
Node* literal = NewNode(op, literals_array, literal_index, constants, flags);
|
Node* literal = NewNode(op, literals_array, literal_index, constants, flags);
|
||||||
|
PrepareFrameState(literal, expr->CreateLiteralId(),
|
||||||
|
OutputFrameStateCombine::Push());
|
||||||
|
|
||||||
// The array and the literal index are both expected on the operand stack
|
// The array and the literal index are both expected on the operand stack
|
||||||
// during computation of the element values.
|
// during computation of the element values.
|
||||||
|
@ -130,6 +130,7 @@ bool Linkage::NeedsFrameState(Runtime::FunctionId function) {
|
|||||||
case Runtime::kCompileLazy:
|
case Runtime::kCompileLazy:
|
||||||
case Runtime::kCompileOptimized:
|
case Runtime::kCompileOptimized:
|
||||||
case Runtime::kCompileString:
|
case Runtime::kCompileString:
|
||||||
|
case Runtime::kCreateArrayLiteral:
|
||||||
case Runtime::kCreateObjectLiteral:
|
case Runtime::kCreateObjectLiteral:
|
||||||
case Runtime::kDebugBreak:
|
case Runtime::kDebugBreak:
|
||||||
case Runtime::kDataViewSetInt8:
|
case Runtime::kDataViewSetInt8:
|
||||||
|
@ -1817,6 +1817,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
|||||||
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
|
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
|
||||||
__ CallStub(&stub);
|
__ CallStub(&stub);
|
||||||
}
|
}
|
||||||
|
PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG);
|
||||||
|
|
||||||
bool result_saved = false; // Is the result saved to the stack?
|
bool result_saved = false; // Is the result saved to the stack?
|
||||||
|
|
||||||
|
@ -1881,6 +1881,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
|||||||
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
|
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
|
||||||
__ CallStub(&stub);
|
__ CallStub(&stub);
|
||||||
}
|
}
|
||||||
|
PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG);
|
||||||
|
|
||||||
bool result_saved = false; // Is the result saved to the stack?
|
bool result_saved = false; // Is the result saved to the stack?
|
||||||
|
|
||||||
|
@ -1878,6 +1878,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
|||||||
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
|
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
|
||||||
__ CallStub(&stub);
|
__ CallStub(&stub);
|
||||||
}
|
}
|
||||||
|
PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG);
|
||||||
|
|
||||||
bool result_saved = false; // Is the result saved to the stack?
|
bool result_saved = false; // Is the result saved to the stack?
|
||||||
|
|
||||||
|
@ -1793,6 +1793,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
|||||||
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
|
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
|
||||||
__ CallStub(&stub);
|
__ CallStub(&stub);
|
||||||
}
|
}
|
||||||
|
PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG);
|
||||||
|
|
||||||
bool result_saved = false; // Is the result saved to the stack?
|
bool result_saved = false; // Is the result saved to the stack?
|
||||||
|
|
||||||
|
@ -1851,6 +1851,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
|||||||
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
|
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
|
||||||
__ CallStub(&stub);
|
__ CallStub(&stub);
|
||||||
}
|
}
|
||||||
|
PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG);
|
||||||
|
|
||||||
bool result_saved = false; // Is the result saved to the stack?
|
bool result_saved = false; // Is the result saved to the stack?
|
||||||
|
|
||||||
|
@ -1806,6 +1806,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
|||||||
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
|
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
|
||||||
__ CallStub(&stub);
|
__ CallStub(&stub);
|
||||||
}
|
}
|
||||||
|
PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG);
|
||||||
|
|
||||||
bool result_saved = false; // Is the result saved to the stack?
|
bool result_saved = false; // Is the result saved to the stack?
|
||||||
|
|
||||||
|
11
test/mjsunit/regress/regress-crbug-451013.js
Normal file
11
test/mjsunit/regress/regress-crbug-451013.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// Copyright 2015 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.
|
||||||
|
|
||||||
|
assertThrows(function testDeepArrayLiteral() {
|
||||||
|
testDeepArrayLiteral([], [], [[]]);
|
||||||
|
}, RangeError);
|
||||||
|
|
||||||
|
assertThrows(function testDeepObjectLiteral() {
|
||||||
|
testDeepObjectLiteral({}, {}, {x:[[]]});
|
||||||
|
}, RangeError);
|
Loading…
Reference in New Issue
Block a user