Commit c97c01b2 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[assembler] Don't look at max_old_generation_size when growing buffer.

TF will instantiate the Assembler when we're already on a background
thread, so it's not safe to read out the heap's max_old_generation_size
(it can change). This CL simply removes the use of that value from the
assembler. If the buffer gets too large we will fail when creating the
actual code object.

Bug: v8:6048
Change-Id: Ifb8a64c90222e4516117d237b001779fae060d28
Reviewed-on: https://chromium-review.googlesource.com/567921Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46581}
parent 0d910860
......@@ -5037,9 +5037,7 @@ void Assembler::GrowBuffer() {
// Some internal data structures overflow for very large buffers,
// they must ensure that kMaximalBufferSize is not too large.
if (desc.buffer_size > kMaximalBufferSize ||
static_cast<size_t>(desc.buffer_size) >
isolate_data().max_old_generation_size_) {
if (desc.buffer_size > kMaximalBufferSize) {
V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
}
......
......@@ -4715,9 +4715,7 @@ void Assembler::GrowBuffer() {
// Some internal data structures overflow for very large buffers,
// they must ensure that kMaximalBufferSize is not too large.
if (desc.buffer_size > kMaximalBufferSize ||
static_cast<size_t>(desc.buffer_size) >
isolate_data().max_old_generation_size_) {
if (desc.buffer_size > kMaximalBufferSize) {
V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
}
......
......@@ -145,8 +145,7 @@ const char* const RelocInfo::kFillerCommentString = "DEOPTIMIZATION PADDING";
// Implementation of AssemblerBase
AssemblerBase::IsolateData::IsolateData(Isolate* isolate)
: serializer_enabled_(isolate->serializer_enabled()),
max_old_generation_size_(isolate->heap()->MaxOldGenerationSize())
: serializer_enabled_(isolate->serializer_enabled())
#if V8_TARGET_ARCH_X64
,
code_range_start_(
......
......@@ -72,7 +72,6 @@ class AssemblerBase: public Malloced {
IsolateData(const IsolateData&) = default;
bool serializer_enabled_;
size_t max_old_generation_size_;
#if V8_TARGET_ARCH_X64
Address code_range_start_;
#endif
......
......@@ -3143,9 +3143,7 @@ void Assembler::GrowBuffer() {
// Some internal data structures overflow for very large buffers,
// they must ensure that kMaximalBufferSize is not too large.
if (desc.buffer_size > kMaximalBufferSize ||
static_cast<size_t>(desc.buffer_size) >
isolate_data().max_old_generation_size_) {
if (desc.buffer_size > kMaximalBufferSize) {
V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
}
......
......@@ -3645,9 +3645,7 @@ void Assembler::GrowBuffer() {
// Some internal data structures overflow for very large buffers,
// they must ensure that kMaximalBufferSize is not too large.
if (desc.buffer_size > kMaximalBufferSize ||
static_cast<size_t>(desc.buffer_size) >
isolate_data().max_old_generation_size_) {
if (desc.buffer_size > kMaximalBufferSize) {
V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
}
......
......@@ -3977,9 +3977,7 @@ void Assembler::GrowBuffer() {
// Some internal data structures overflow for very large buffers,
// they must ensure that kMaximalBufferSize is not too large.
if (desc.buffer_size > kMaximalBufferSize ||
static_cast<size_t>(desc.buffer_size) >
isolate_data().max_old_generation_size_) {
if (desc.buffer_size > kMaximalBufferSize) {
V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
}
......
......@@ -1984,9 +1984,7 @@ void Assembler::GrowBuffer(int needed) {
// Some internal data structures overflow for very large buffers,
// they must ensure that kMaximalBufferSize is not too large.
if (desc.buffer_size > kMaximalBufferSize ||
static_cast<size_t>(desc.buffer_size) >
isolate_data().max_old_generation_size_) {
if (desc.buffer_size > kMaximalBufferSize) {
V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
}
......
......@@ -2101,9 +2101,7 @@ void Assembler::GrowBuffer(int needed) {
// Some internal data structures overflow for very large buffers,
// they must ensure that kMaximalBufferSize is not too large.
if (desc.buffer_size > kMaximalBufferSize ||
static_cast<size_t>(desc.buffer_size) >
isolate_data().max_old_generation_size_) {
if (desc.buffer_size > kMaximalBufferSize) {
V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
}
......
......@@ -436,9 +436,7 @@ void Assembler::GrowBuffer() {
// Some internal data structures overflow for very large buffers,
// they must ensure that kMaximalBufferSize is not too large.
if (desc.buffer_size > kMaximalBufferSize ||
static_cast<size_t>(desc.buffer_size) >
isolate_data().max_old_generation_size_) {
if (desc.buffer_size > kMaximalBufferSize) {
V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
}
......
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