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

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

Issue 7285031: Remove unmarked entries from per context map caches. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/v8-counters.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 14641 matching lines...) Expand 10 before | Expand all | Expand 10 after
14652 CHECK_EQ(v8_str("DONT_CHANGE"), obj->Get(v8_str("1"))); 14652 CHECK_EQ(v8_str("DONT_CHANGE"), obj->Get(v8_str("1")));
14653 obj->Set(v8_num(2), v8_str("DONT_CHANGE"), v8::ReadOnly); 14653 obj->Set(v8_num(2), v8_str("DONT_CHANGE"), v8::ReadOnly);
14654 obj->Set(v8_num(2), v8_str("foobar")); 14654 obj->Set(v8_num(2), v8_str("foobar"));
14655 CHECK_EQ(v8_str("DONT_CHANGE"), obj->Get(v8_num(2))); 14655 CHECK_EQ(v8_str("DONT_CHANGE"), obj->Get(v8_num(2)));
14656 14656
14657 // Test non-smi case. 14657 // Test non-smi case.
14658 obj->Set(v8_str("2000000000"), v8_str("DONT_CHANGE"), v8::ReadOnly); 14658 obj->Set(v8_str("2000000000"), v8_str("DONT_CHANGE"), v8::ReadOnly);
14659 obj->Set(v8_str("2000000000"), v8_str("foobar")); 14659 obj->Set(v8_str("2000000000"), v8_str("foobar"));
14660 CHECK_EQ(v8_str("DONT_CHANGE"), obj->Get(v8_str("2000000000"))); 14660 CHECK_EQ(v8_str("DONT_CHANGE"), obj->Get(v8_str("2000000000")));
14661 } 14661 }
14662
14663
14664 THREADED_TEST(Regress1516) {
14665 v8::HandleScope scope;
14666
14667 LocalContext context;
14668 { v8::HandleScope temp_scope;
14669 CompileRun("({'a': 0})");
14670 }
14671
14672 int elements;
14673 { i::MapCache* map_cache =
14674 i::MapCache::cast(i::Isolate::Current()->context()->map_cache());
14675 elements = map_cache->NumberOfElements();
14676 CHECK_LE(1, elements);
14677 }
14678
14679 i::Isolate::Current()->heap()->CollectAllGarbage(true);
14680 { i::Object* raw_map_cache = i::Isolate::Current()->context()->map_cache();
14681 if (raw_map_cache != i::Isolate::Current()->heap()->undefined_value()) {
14682 i::MapCache* map_cache = i::MapCache::cast(raw_map_cache);
14683 CHECK_GT(elements, map_cache->NumberOfElements());
14684 }
14685 }
14686 }
OLDNEW
« no previous file with comments | « src/v8-counters.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698