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

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

Issue 654853002: Fix de/serialization tests after r24592 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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/mksnapshot.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 2007-2010 the V8 project authors. All rights reserved. 1 // Copyright 2007-2010 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // can be loaded from v8natives.js and their addresses can be processed. This 193 // can be loaded from v8natives.js and their addresses can be processed. This
194 // will clear the pending fixups array, which would otherwise contain GC roots 194 // will clear the pending fixups array, which would otherwise contain GC roots
195 // that would confuse the serialization/deserialization process. 195 // that would confuse the serialization/deserialization process.
196 v8::Isolate::Scope isolate_scope(isolate); 196 v8::Isolate::Scope isolate_scope(isolate);
197 { 197 {
198 v8::HandleScope scope(isolate); 198 v8::HandleScope scope(isolate);
199 v8::Context::New(isolate); 199 v8::Context::New(isolate);
200 } 200 }
201 201
202 Isolate* internal_isolate = reinterpret_cast<Isolate*>(isolate); 202 Isolate* internal_isolate = reinterpret_cast<Isolate*>(isolate);
203 internal_isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, "serialize"); 203 internal_isolate->heap()->CollectAllAvailableGarbage("serialize");
204 WriteToFile(internal_isolate, FLAG_testing_serialization_file); 204 WriteToFile(internal_isolate, FLAG_testing_serialization_file);
205 } 205 }
206 206
207 207
208 // Test that the whole heap can be serialized. 208 // Test that the whole heap can be serialized.
209 UNINITIALIZED_TEST(Serialize) { 209 UNINITIALIZED_TEST(Serialize) {
210 if (!Snapshot::HaveASnapshotToStartFrom()) { 210 if (!Snapshot::HaveASnapshotToStartFrom()) {
211 v8::Isolate::CreateParams params; 211 v8::Isolate::CreateParams params;
212 params.enable_serializer = true; 212 params.enable_serializer = true;
213 v8::Isolate* isolate = v8::Isolate::New(params); 213 v8::Isolate* isolate = v8::Isolate::New(params);
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 { 1155 {
1156 DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate2)); 1156 DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate2));
1157 script = v8::ScriptCompiler::CompileUnbound( 1157 script = v8::ScriptCompiler::CompileUnbound(
1158 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache); 1158 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache);
1159 } 1159 }
1160 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); 1160 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run();
1161 CHECK(result->ToString()->Equals(v8_str("abcdef"))); 1161 CHECK(result->ToString()->Equals(v8_str("abcdef")));
1162 } 1162 }
1163 isolate2->Dispose(); 1163 isolate2->Dispose();
1164 } 1164 }
OLDNEW
« no previous file with comments | « src/mksnapshot.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698