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

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

Issue 671633004: Make block writes in the serializer more efficient. (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
« src/serialize.cc ('K') | « src/snapshot-source-sink.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 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 Isolate* isolate = CcTest::i_isolate(); 1047 Isolate* isolate = CcTest::i_isolate();
1048 isolate->compilation_cache()->Disable(); // Disable same-isolate code cache. 1048 isolate->compilation_cache()->Disable(); // Disable same-isolate code cache.
1049 1049
1050 Factory* f = isolate->factory(); 1050 Factory* f = isolate->factory();
1051 1051
1052 v8::HandleScope scope(CcTest::isolate()); 1052 v8::HandleScope scope(CcTest::isolate());
1053 1053
1054 // Create a huge external internalized string to use as variable name. 1054 // Create a huge external internalized string to use as variable name.
1055 Vector<const uint8_t> string = 1055 Vector<const uint8_t> string =
1056 ConstructSource(STATIC_CHAR_VECTOR(""), STATIC_CHAR_VECTOR("abcdef"), 1056 ConstructSource(STATIC_CHAR_VECTOR(""), STATIC_CHAR_VECTOR("abcdef"),
1057 STATIC_CHAR_VECTOR(""), 1000000); 1057 STATIC_CHAR_VECTOR(""), 999999);
vogelheim 2014/10/23 16:48:44 What's the significance of this change? Is this me
Yang 2014/10/24 07:14:24 yes.
1058 Handle<String> name = f->NewStringFromOneByte(string).ToHandleChecked(); 1058 Handle<String> name = f->NewStringFromOneByte(string).ToHandleChecked();
1059 SerializerOneByteResource one_byte_resource( 1059 SerializerOneByteResource one_byte_resource(
1060 reinterpret_cast<const char*>(string.start()), string.length()); 1060 reinterpret_cast<const char*>(string.start()), string.length());
1061 name = f->InternalizeString(name); 1061 name = f->InternalizeString(name);
1062 name->MakeExternal(&one_byte_resource); 1062 name->MakeExternal(&one_byte_resource);
1063 CHECK(name->IsExternalOneByteString()); 1063 CHECK(name->IsExternalOneByteString());
1064 CHECK(name->IsInternalizedString()); 1064 CHECK(name->IsInternalizedString());
1065 CHECK(isolate->heap()->InSpace(*name, LO_SPACE)); 1065 CHECK(isolate->heap()->InSpace(*name, LO_SPACE));
1066 1066
1067 // Create the source, which is "var <literal> = 42; <literal>". 1067 // Create the source, which is "var <literal> = 42; <literal>".
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 { 1266 {
1267 DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate2)); 1267 DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate2));
1268 script = v8::ScriptCompiler::CompileUnbound( 1268 script = v8::ScriptCompiler::CompileUnbound(
1269 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache); 1269 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache);
1270 } 1270 }
1271 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); 1271 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run();
1272 CHECK(result->ToString()->Equals(v8_str("XY"))); 1272 CHECK(result->ToString()->Equals(v8_str("XY")));
1273 } 1273 }
1274 isolate2->Dispose(); 1274 isolate2->Dispose();
1275 } 1275 }
OLDNEW
« src/serialize.cc ('K') | « src/snapshot-source-sink.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698