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

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

Issue 813023002: Make sure backing store pointer in handles get cleared after use in factory. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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 | « src/factory.cc ('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 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 4988 matching lines...) Expand 10 before | Expand all | Expand 10 after
4999 // The following line will update the backing store. 4999 // The following line will update the backing store.
5000 CompileRun( 5000 CompileRun(
5001 "for (var i = 0; i < 50; i++) {" 5001 "for (var i = 0; i < 50; i++) {"
5002 " weak_map.set(future_keys[i], i);" 5002 " weak_map.set(future_keys[i], i);"
5003 "}"); 5003 "}");
5004 heap->incremental_marking()->set_should_hurry(true); 5004 heap->incremental_marking()->set_should_hurry(true);
5005 heap->CollectGarbage(OLD_POINTER_SPACE); 5005 heap->CollectGarbage(OLD_POINTER_SPACE);
5006 } 5006 }
5007 5007
5008 5008
5009 TEST(Regress442710) {
5010 CcTest::InitializeVM();
5011 Isolate* isolate = CcTest::i_isolate();
5012 Heap* heap = isolate->heap();
5013 Factory* factory = isolate->factory();
5014
5015 HandleScope sc(isolate);
5016 Handle<GlobalObject> global(CcTest::i_isolate()->context()->global_object());
5017 Handle<JSArray> array = factory->NewJSArray(2);
5018
5019 Handle<String> name = factory->InternalizeUtf8String("testArray");
5020 JSReceiver::SetProperty(global, name, array, SLOPPY).Check();
5021 CompileRun("testArray[0] = 1; testArray[1] = 2; testArray.shift();");
5022 heap->CollectGarbage(OLD_POINTER_SPACE);
5023 }
5024
5025
5009 #ifdef DEBUG 5026 #ifdef DEBUG
5010 TEST(PathTracer) { 5027 TEST(PathTracer) {
5011 CcTest::InitializeVM(); 5028 CcTest::InitializeVM();
5012 v8::HandleScope scope(CcTest::isolate()); 5029 v8::HandleScope scope(CcTest::isolate());
5013 5030
5014 v8::Local<v8::Value> result = CompileRun("'abc'"); 5031 v8::Local<v8::Value> result = CompileRun("'abc'");
5015 Handle<Object> o = v8::Utils::OpenHandle(*result); 5032 Handle<Object> o = v8::Utils::OpenHandle(*result);
5016 CcTest::i_isolate()->heap()->TracePathToObject(*o); 5033 CcTest::i_isolate()->heap()->TracePathToObject(*o);
5017 } 5034 }
5018 #endif // DEBUG 5035 #endif // DEBUG
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698