Commit 03f52964 authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

Revert "[heap] Make Heap::MaxRegularHeapObjectSize an inlineable constexpr"

This reverts commit 2a09af7e.

Reason for revert: Breaks gcc (https://logs.chromium.org/logs/v8/buildbucket/cr-buildbucket.appspot.com/8849798091364623904/+/u/build/compile/stdout?format=raw)

Original change's description:
> [heap] Make Heap::MaxRegularHeapObjectSize an inlineable constexpr
>
> Bug: v8:11263
> Change-Id: Ia86ae814434aed9795f98d80e987a1ed10fa9a1f
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2821540
> Reviewed-by: Michael Stanton <mvstanton@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Camillo Bruni <cbruni@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#73991}

Bug: v8:11263
Change-Id: Iae78ae9df689e3a4653171dc34cd5fa84afc1ba0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2831476
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#73992}
parent 2a09af7e
......@@ -7,7 +7,6 @@
#include "src/compiler/access-builder.h"
#include "src/compiler/allocation-builder.h"
#include "src/heap/heap-inl.h"
#include "src/objects/arguments-inl.h"
#include "src/objects/map-inl.h"
......@@ -15,16 +14,6 @@ namespace v8 {
namespace internal {
namespace compiler {
void AllocationBuilder::Allocate(int size, AllocationType allocation,
Type type) {
DCHECK_LE(size, Heap::MaxRegularHeapObjectSize(allocation));
effect_ = graph()->NewNode(
common()->BeginRegion(RegionObservability::kNotObservable), effect_);
allocation_ = graph()->NewNode(simplified()->Allocate(type, allocation),
jsgraph()->Constant(size), effect_, control_);
effect_ = allocation_;
}
void AllocationBuilder::AllocateContext(int variadic_part_length, MapRef map) {
DCHECK(base::IsInRange(map.instance_type(), FIRST_CONTEXT_TYPE,
LAST_CONTEXT_TYPE));
......
......@@ -25,9 +25,16 @@ class AllocationBuilder final {
control_(control) {}
// Primitive allocation of static size.
inline void Allocate(int size,
AllocationType allocation = AllocationType::kYoung,
Type type = Type::Any());
void Allocate(int size, AllocationType allocation = AllocationType::kYoung,
Type type = Type::Any()) {
DCHECK_LE(size, Heap::MaxRegularHeapObjectSize(allocation));
effect_ = graph()->NewNode(
common()->BeginRegion(RegionObservability::kNotObservable), effect_);
allocation_ =
graph()->NewNode(simplified()->Allocate(type, allocation),
jsgraph()->Constant(size), effect_, control_);
effect_ = allocation_;
}
// Primitive store into a field.
void Store(const FieldAccess& access, Node* value) {
......
......@@ -85,15 +85,6 @@ BytecodeFlushMode Heap::GetBytecodeFlushMode(Isolate* isolate) {
return BytecodeFlushMode::kDoNotFlushBytecode;
}
// static
constexpr int Heap::MaxRegularHeapObjectSize(AllocationType allocation) {
if (!V8_ENABLE_THIRD_PARTY_HEAP_BOOL &&
(allocation == AllocationType::kCode)) {
return MemoryChunkLayout::MaxRegularCodeObjectSize();
}
return kMaxRegularHeapObjectSize;
}
Isolate* Heap::isolate() {
return reinterpret_cast<Isolate*>(
reinterpret_cast<intptr_t>(this) -
......
......@@ -4851,6 +4851,15 @@ bool Heap::AllocationLimitOvershotByLargeMargin() {
return v8_overshoot >= v8_margin || global_overshoot >= global_margin;
}
// static
int Heap::MaxRegularHeapObjectSize(AllocationType allocation) {
if (!V8_ENABLE_THIRD_PARTY_HEAP_BOOL &&
(allocation == AllocationType::kCode)) {
return MemoryChunkLayout::MaxRegularCodeObjectSize();
}
return kMaxRegularHeapObjectSize;
}
bool Heap::ShouldOptimizeForLoadTime() {
return isolate()->rail_mode() == PERFORMANCE_LOAD &&
!AllocationLimitOvershotByLargeMargin() &&
......
......@@ -1390,7 +1390,7 @@ class Heap {
// which the size of the allocatable space per V8 page may depend on the OS
// page size at runtime. You may use kMaxRegularHeapObjectSize as a constant
// instead if you know the allocation isn't in the code spaces.
V8_EXPORT_PRIVATE static constexpr int MaxRegularHeapObjectSize(
V8_EXPORT_PRIVATE static int MaxRegularHeapObjectSize(
AllocationType allocation);
// ===========================================================================
......
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