Skip to content

Commit 323d201

Browse files
committed
8275506: Rename allocated_on_stack to allocated_on_stack_or_embedded
Reviewed-by: stuefe
1 parent 96c396b commit 323d201

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

src/hotspot/share/asm/codeBuffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ CodeBuffer::~CodeBuffer() {
140140

141141
NOT_PRODUCT(clear_strings());
142142

143-
assert(_default_oop_recorder.allocated_on_stack(), "should be embedded object");
143+
assert(_default_oop_recorder.allocated_on_stack_or_embedded(), "should be embedded object");
144144
}
145145

146146
void CodeBuffer::initialize_oop_recorder(OopRecorder* r) {

src/hotspot/share/classfile/classFileParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ void ClassFileParser::parse_constant_pool_entries(const ClassFileStream* const s
161161
const ClassFileStream cfs1 = *stream;
162162
const ClassFileStream* const cfs = &cfs1;
163163

164-
assert(cfs->allocated_on_stack(), "should be local");
164+
assert(cfs->allocated_on_stack_or_embedded(), "should be local");
165165
debug_only(const u1* const old_current = stream->current();)
166166

167167
// Used for batching symbol allocations.

src/hotspot/share/memory/allocation.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,15 @@ void ResourceObj::initialize_allocation_info() {
191191
// Operator new() is not called for allocations
192192
// on stack and for embedded objects.
193193
set_allocation_type((address)this, STACK_OR_EMBEDDED);
194-
} else if (allocated_on_stack()) { // STACK_OR_EMBEDDED
194+
} else if (allocated_on_stack_or_embedded()) { // STACK_OR_EMBEDDED
195195
// For some reason we got a value which resembles
196196
// an embedded or stack object (operator new() does not
197197
// set such type). Keep it since it is valid value
198198
// (even if it was garbage).
199199
// Ignore garbage in other fields.
200200
} else if (is_type_set()) {
201201
// Operator new() was called and type was set.
202-
assert(!allocated_on_stack(),
202+
assert(!allocated_on_stack_or_embedded(),
203203
"not embedded or stack, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")",
204204
p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1]);
205205
} else {
@@ -220,7 +220,7 @@ ResourceObj::ResourceObj(const ResourceObj&) {
220220
}
221221

222222
ResourceObj& ResourceObj::operator=(const ResourceObj& r) {
223-
assert(allocated_on_stack(),
223+
assert(allocated_on_stack_or_embedded(),
224224
"copy only into local, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")",
225225
p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1]);
226226
// Keep current _allocation_t value;

src/hotspot/share/memory/allocation.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ class ResourceObj ALLOCATION_SUPER_CLASS_SPEC {
408408
void initialize_allocation_info();
409409
public:
410410
allocation_type get_allocation_type() const;
411-
bool allocated_on_stack() const { return get_allocation_type() == STACK_OR_EMBEDDED; }
411+
bool allocated_on_stack_or_embedded() const { return get_allocation_type() == STACK_OR_EMBEDDED; }
412412
bool allocated_on_res_area() const { return get_allocation_type() == RESOURCE_AREA; }
413413
bool allocated_on_C_heap() const { return get_allocation_type() == C_HEAP; }
414414
bool allocated_on_arena() const { return get_allocation_type() == ARENA; }

src/hotspot/share/utilities/growableArray.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -72,7 +72,7 @@ void GrowableArrayNestingCheck::on_stack_alloc() const {
7272

7373
void GrowableArrayMetadata::init_checks(const GrowableArrayBase* array) const {
7474
// Stack allocated arrays support all three element allocation locations
75-
if (array->allocated_on_stack()) {
75+
if (array->allocated_on_stack_or_embedded()) {
7676
return;
7777
}
7878

test/hotspot/gtest/utilities/test_growableArray.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -452,45 +452,45 @@ TEST_VM_F(GrowableArrayTest, where) {
452452
{
453453
ResourceMark rm;
454454
GrowableArray<int> a(0);
455-
ASSERT_TRUE(a.allocated_on_stack());
455+
ASSERT_TRUE(a.allocated_on_stack_or_embedded());
456456
ASSERT_TRUE(elements_on_stack(&a));
457457
}
458458

459459
// Stack/CHeap allocated
460460
{
461461
GrowableArray<int> a(0, mtTest);
462-
ASSERT_TRUE(a.allocated_on_stack());
462+
ASSERT_TRUE(a.allocated_on_stack_or_embedded());
463463
ASSERT_TRUE(elements_on_C_heap(&a));
464464
}
465465

466466
// Stack/Arena allocated
467467
{
468468
Arena arena(mtTest);
469469
GrowableArray<int> a(&arena, 0, 0, 0);
470-
ASSERT_TRUE(a.allocated_on_stack());
470+
ASSERT_TRUE(a.allocated_on_stack_or_embedded());
471471
ASSERT_TRUE(elements_on_arena(&a));
472472
}
473473

474474
// Embedded/Resource allocated
475475
{
476476
ResourceMark rm;
477477
WithEmbeddedArray w(0);
478-
ASSERT_TRUE(w._a.allocated_on_stack());
478+
ASSERT_TRUE(w._a.allocated_on_stack_or_embedded());
479479
ASSERT_TRUE(elements_on_stack(&w._a));
480480
}
481481

482482
// Embedded/CHeap allocated
483483
{
484484
WithEmbeddedArray w(0, mtTest);
485-
ASSERT_TRUE(w._a.allocated_on_stack());
485+
ASSERT_TRUE(w._a.allocated_on_stack_or_embedded());
486486
ASSERT_TRUE(elements_on_C_heap(&w._a));
487487
}
488488

489489
// Embedded/Arena allocated
490490
{
491491
Arena arena(mtTest);
492492
WithEmbeddedArray w(&arena, 0);
493-
ASSERT_TRUE(w._a.allocated_on_stack());
493+
ASSERT_TRUE(w._a.allocated_on_stack_or_embedded());
494494
ASSERT_TRUE(elements_on_arena(&w._a));
495495
}
496496
}
@@ -518,7 +518,7 @@ TEST(GrowableArrayCHeap, sanity) {
518518
{
519519
GrowableArrayCHeap<int, mtTest> a(0);
520520
#ifdef ASSERT
521-
ASSERT_TRUE(a.allocated_on_stack());
521+
ASSERT_TRUE(a.allocated_on_stack_or_embedded());
522522
#endif
523523
ASSERT_TRUE(a.is_empty());
524524

0 commit comments

Comments
 (0)