Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: src/code-stub-assembler.cc

Issue 2466573002: [stubs] Fix allocation memento detection. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm64/macro-assembler-arm64.cc ('k') | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index 4e18e34bbaaab4a567a44bbd3eed24ba97e2ebd8..aa07ba233eec6f2e5407f384d11710aaeaf33a17 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -6706,7 +6706,8 @@ void CodeStubAssembler::TrapAllocationMemento(Node* object,
Node* new_space_top_address = ExternalConstant(
ExternalReference::new_space_allocation_top_address(isolate()));
const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag;
- const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize;
+ const int kMementoLastWordOffset =
+ kMementoMapOffset + AllocationMemento::kSize - kPointerSize;
// Bail out if the object is not in new space.
Node* object_page = PageFromAddress(object);
@@ -6719,28 +6720,29 @@ void CodeStubAssembler::TrapAllocationMemento(Node* object,
&no_memento_found);
}
- Node* memento_end = IntPtrAdd(object, IntPtrConstant(kMementoEndOffset));
- Node* memento_end_page = PageFromAddress(memento_end);
+ Node* memento_last_word =
+ IntPtrAdd(object, IntPtrConstant(kMementoLastWordOffset));
+ Node* memento_last_word_page = PageFromAddress(memento_last_word);
Node* new_space_top = Load(MachineType::Pointer(), new_space_top_address);
Node* new_space_top_page = PageFromAddress(new_space_top);
- // If the object is in new space, we need to check whether it is and
- // respective potential memento object on the same page as the current top.
- GotoIf(WordEqual(memento_end_page, new_space_top_page), &top_check);
+ // If the object is in new space, we need to check whether respective
+ // potential memento object is on the same page as the current top.
+ GotoIf(WordEqual(memento_last_word_page, new_space_top_page), &top_check);
// The object is on a different page than allocation top. Bail out if the
// object sits on the page boundary as no memento can follow and we cannot
// touch the memory following it.
- Branch(WordEqual(object_page, memento_end_page), &map_check,
+ Branch(WordEqual(object_page, memento_last_word_page), &map_check,
&no_memento_found);
// If top is on the same page as the current object, we need to check whether
// we are below top.
Bind(&top_check);
{
- Branch(UintPtrGreaterThan(memento_end, new_space_top), &no_memento_found,
- &map_check);
+ Branch(UintPtrGreaterThanOrEqual(memento_last_word, new_space_top),
+ &no_memento_found, &map_check);
}
// Memento map check.
« no previous file with comments | « src/arm64/macro-assembler-arm64.cc ('k') | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698