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

Side by Side Diff: test/cctest/heap/test-heap.cc

Issue 2489933002: [heap] Fix -Wsign-compare warnings (Closed)
Patch Set: fix test 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 unified diff | Download patch
« no previous file with comments | « test/cctest/heap/heap-utils.cc ('k') | test/cctest/heap/test-spaces.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 5696 matching lines...) Expand 10 before | Expand all | Expand 10 after
5707 Heap* heap = isolate->heap(); 5707 Heap* heap = isolate->heap();
5708 5708
5709 Handle<Map> map1 = Map::Create(isolate, 1); 5709 Handle<Map> map1 = Map::Create(isolate, 1);
5710 Handle<String> name = factory->NewStringFromStaticChars("foo"); 5710 Handle<String> name = factory->NewStringFromStaticChars("foo");
5711 name = factory->InternalizeString(name); 5711 name = factory->InternalizeString(name);
5712 Handle<Map> map2 = 5712 Handle<Map> map2 =
5713 Map::CopyWithField(map1, name, FieldType::Any(isolate), NONE, 5713 Map::CopyWithField(map1, name, FieldType::Any(isolate), NONE,
5714 Representation::Tagged(), OMIT_TRANSITION) 5714 Representation::Tagged(), OMIT_TRANSITION)
5715 .ToHandleChecked(); 5715 .ToHandleChecked();
5716 5716
5717 int desired_offset = Page::kPageSize - map1->instance_size(); 5717 size_t desired_offset = Page::kPageSize - map1->instance_size();
5718 5718
5719 // Allocate padding objects in old pointer space so, that object allocated 5719 // Allocate padding objects in old pointer space so, that object allocated
5720 // afterwards would end at the end of the page. 5720 // afterwards would end at the end of the page.
5721 heap::SimulateFullSpace(heap->old_space()); 5721 heap::SimulateFullSpace(heap->old_space());
5722 int padding_size = desired_offset - Page::kObjectStartOffset; 5722 size_t padding_size = desired_offset - Page::kObjectStartOffset;
5723 heap::CreatePadding(heap, padding_size, TENURED); 5723 heap::CreatePadding(heap, static_cast<int>(padding_size), TENURED);
5724 5724
5725 Handle<JSObject> o = factory->NewJSObjectFromMap(map1, TENURED); 5725 Handle<JSObject> o = factory->NewJSObjectFromMap(map1, TENURED);
5726 o->set_properties(*factory->empty_fixed_array()); 5726 o->set_properties(*factory->empty_fixed_array());
5727 5727
5728 // Ensure that the object allocated where we need it. 5728 // Ensure that the object allocated where we need it.
5729 Page* page = Page::FromAddress(o->address()); 5729 Page* page = Page::FromAddress(o->address());
5730 CHECK_EQ(desired_offset, page->Offset(o->address())); 5730 CHECK_EQ(desired_offset, page->Offset(o->address()));
5731 5731
5732 // Now we have an object right at the end of the page. 5732 // Now we have an object right at the end of the page.
5733 5733
(...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after
7000 SlotSet::FREE_EMPTY_BUCKETS); 7000 SlotSet::FREE_EMPTY_BUCKETS);
7001 slots[chunk->area_end() - kPointerSize] = false; 7001 slots[chunk->area_end() - kPointerSize] = false;
7002 RememberedSet<OLD_TO_NEW>::Iterate(chunk, [&slots](Address addr) { 7002 RememberedSet<OLD_TO_NEW>::Iterate(chunk, [&slots](Address addr) {
7003 CHECK(slots[addr]); 7003 CHECK(slots[addr]);
7004 return KEEP_SLOT; 7004 return KEEP_SLOT;
7005 }); 7005 });
7006 } 7006 }
7007 7007
7008 } // namespace internal 7008 } // namespace internal
7009 } // namespace v8 7009 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/heap/heap-utils.cc ('k') | test/cctest/heap/test-spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698