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

Unified Diff: test/cctest/test-heap.cc

Issue 198383002: Reland "Enable Object.observe by default" again (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 months 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/runtime.cc ('k') | test/cctest/test-microtask-delivery.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index 887aef8a02b406f2d5787633ab8db5b0a5583bf0..07828a9a488143bd2d530ae13071a058b8ba78d6 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -2003,8 +2003,14 @@ TEST(PrototypeTransitionClearing) {
Factory* factory = isolate->factory();
v8::HandleScope scope(CcTest::isolate());
+ CompileRun("var base = {};");
+ Handle<JSObject> baseObject =
+ v8::Utils::OpenHandle(
+ *v8::Handle<v8::Object>::Cast(
+ CcTest::global()->Get(v8_str("base"))));
+ int initialTransitions = baseObject->map()->NumberOfProtoTransitions();
+
CompileRun(
- "var base = {};"
"var live = [];"
"for (var i = 0; i < 10; i++) {"
" var object = {};"
@@ -2013,25 +2019,22 @@ TEST(PrototypeTransitionClearing) {
" if (i >= 3) live.push(object, prototype);"
"}");
- Handle<JSObject> baseObject =
- v8::Utils::OpenHandle(
- *v8::Handle<v8::Object>::Cast(
- CcTest::global()->Get(v8_str("base"))));
-
// Verify that only dead prototype transitions are cleared.
- CHECK_EQ(10, baseObject->map()->NumberOfProtoTransitions());
+ CHECK_EQ(initialTransitions + 10,
+ baseObject->map()->NumberOfProtoTransitions());
CcTest::heap()->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
const int transitions = 10 - 3;
- CHECK_EQ(transitions, baseObject->map()->NumberOfProtoTransitions());
+ CHECK_EQ(initialTransitions + transitions,
+ baseObject->map()->NumberOfProtoTransitions());
// Verify that prototype transitions array was compacted.
FixedArray* trans = baseObject->map()->GetPrototypeTransitions();
- for (int i = 0; i < transitions; i++) {
+ for (int i = initialTransitions; i < initialTransitions + transitions; i++) {
int j = Map::kProtoTransitionHeaderSize +
i * Map::kProtoTransitionElementsPerEntry;
CHECK(trans->get(j + Map::kProtoTransitionMapOffset)->IsMap());
Object* proto = trans->get(j + Map::kProtoTransitionPrototypeOffset);
- CHECK(proto->IsTheHole() || proto->IsJSObject());
+ CHECK(proto->IsJSObject());
}
// Make sure next prototype is placed on an old-space evacuation candidate.
« no previous file with comments | « src/runtime.cc ('k') | test/cctest/test-microtask-delivery.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698