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

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

Issue 2487943005: [stubs] Fix CodeStubAssembler::TrapAllocationMemento (Closed)
Patch Set: use a bigger hammer 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 | « no previous file | test/mjsunit/regress/regress-trap-allocation-memento.js » ('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 8838bc55870cd262573b304aeb951428cd0bda08..02e6a347acce8b0dc1a6bbe9841955f2493f858b 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -6887,23 +6887,23 @@ 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 kMementoMapOffset = JSArray::kSize;
const int kMementoLastWordOffset =
kMementoMapOffset + AllocationMemento::kSize - kPointerSize;
// Bail out if the object is not in new space.
Node* object_page = PageFromAddress(object);
{
- const int mask =
- (1 << MemoryChunk::IN_FROM_SPACE) | (1 << MemoryChunk::IN_TO_SPACE);
- Node* page_flags = Load(MachineType::IntPtr(), object_page);
- GotoIf(
- WordEqual(WordAnd(page_flags, IntPtrConstant(mask)), IntPtrConstant(0)),
- &no_memento_found);
+ Node* page_flags = Load(MachineType::IntPtr(), object_page,
+ IntPtrConstant(Page::kFlagsOffset));
+ GotoIf(WordEqual(WordAnd(page_flags,
+ IntPtrConstant(MemoryChunk::kIsInNewSpaceMask)),
+ IntPtrConstant(0)),
+ &no_memento_found);
}
- Node* memento_last_word =
- IntPtrAdd(object, IntPtrConstant(kMementoLastWordOffset));
+ Node* memento_last_word = IntPtrAdd(
+ object, IntPtrConstant(kMementoLastWordOffset - kHeapObjectTag));
Node* memento_last_word_page = PageFromAddress(memento_last_word);
Node* new_space_top = Load(MachineType::Pointer(), new_space_top_address);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-trap-allocation-memento.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698