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

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

Issue 146973005: Don't access stack-allocated variable when it is out of scope. Enable Isolate cleanup in cctests ag… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 | « test/cctest/cctest.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 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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 // Create a sliced string that will land in old pointer space. 730 // Create a sliced string that will land in old pointer space.
731 Local<String> slice = Local<String>::Cast(CompileRun( 731 Local<String> slice = Local<String>::Cast(CompileRun(
732 "slice('abcdefghijklmnopqrstuvwxyz');")); 732 "slice('abcdefghijklmnopqrstuvwxyz');"));
733 733
734 // Trigger GCs so that the newly allocated string moves to old gen. 734 // Trigger GCs so that the newly allocated string moves to old gen.
735 SimulateFullSpace(CcTest::heap()->old_pointer_space()); 735 SimulateFullSpace(CcTest::heap()->old_pointer_space());
736 CcTest::heap()->CollectGarbage(i::NEW_SPACE); // in survivor space now 736 CcTest::heap()->CollectGarbage(i::NEW_SPACE); // in survivor space now
737 CcTest::heap()->CollectGarbage(i::NEW_SPACE); // in old gen now 737 CcTest::heap()->CollectGarbage(i::NEW_SPACE); // in old gen now
738 738
739 // Turn into external string with unaligned resource data. 739 // Turn into external string with unaligned resource data.
740 int dispose_count = 0;
741 const char* c_cons = "_abcdefghijklmnopqrstuvwxyz"; 740 const char* c_cons = "_abcdefghijklmnopqrstuvwxyz";
742 bool success = cons->MakeExternal( 741 bool success = cons->MakeExternal(
743 new TestAsciiResource(i::StrDup(c_cons), &dispose_count, 1)); 742 new TestAsciiResource(i::StrDup(c_cons), NULL, 1));
744 CHECK(success); 743 CHECK(success);
745 const char* c_slice = "_bcdefghijklmnopqrstuvwxyz"; 744 const char* c_slice = "_bcdefghijklmnopqrstuvwxyz";
746 success = slice->MakeExternal( 745 success = slice->MakeExternal(
747 new TestAsciiResource(i::StrDup(c_slice), &dispose_count, 1)); 746 new TestAsciiResource(i::StrDup(c_slice), NULL, 1));
748 CHECK(success); 747 CHECK(success);
749 748
750 // Trigger GCs and force evacuation. 749 // Trigger GCs and force evacuation.
751 CcTest::heap()->CollectAllGarbage(i::Heap::kNoGCFlags); 750 CcTest::heap()->CollectAllGarbage(i::Heap::kNoGCFlags);
752 CcTest::heap()->CollectAllGarbage(i::Heap::kReduceMemoryFootprintMask); 751 CcTest::heap()->CollectAllGarbage(i::Heap::kReduceMemoryFootprintMask);
753 } 752 }
754 753
755 754
756 THREADED_TEST(UsingExternalString) { 755 THREADED_TEST(UsingExternalString) {
757 i::Factory* factory = CcTest::i_isolate()->factory(); 756 i::Factory* factory = CcTest::i_isolate()->factory();
(...skipping 21218 matching lines...) Expand 10 before | Expand all | Expand 10 after
21976 21975
21977 21976
21978 TEST(TestFunctionCallOptimization) { 21977 TEST(TestFunctionCallOptimization) {
21979 i::FLAG_allow_natives_syntax = true; 21978 i::FLAG_allow_natives_syntax = true;
21980 ApiCallOptimizationChecker checker; 21979 ApiCallOptimizationChecker checker;
21981 checker.Run(true, true); 21980 checker.Run(true, true);
21982 checker.Run(false, true); 21981 checker.Run(false, true);
21983 checker.Run(true, false); 21982 checker.Run(true, false);
21984 checker.Run(false, false); 21983 checker.Run(false, false);
21985 } 21984 }
OLDNEW
« no previous file with comments | « test/cctest/cctest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698