|
|
Chromium Code Reviews|
Created:
4 years, 4 months ago by yhirano Modified:
4 years, 3 months ago CC:
blink-reviews, blink-reviews-bindings_chromium.org, chromium-reviews, falken, gavinp+loader_chromium.org, horo+watch_chromium.org, Nate Chapin, jsbell+serviceworker_chromium.org, kinuko+serviceworker, loading-reviews+fetch_chromium.org, michaeln, nhiroki, serviceworker-reviews, tyoshino+watch_chromium.org, tzik Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionReserve Vector's capacity manually in CachedMetadata
As CachedMetaData::m_serializedData is set only at the initialization timing,
we can call Vector<char>::reserveCapacity to save memory consumption without
loosing performance.
This CL includes other cleanups:
- Renaming methods,
- Replacing error handling logic with DCHECKs,
- Replacing unsigned with uint32_t.
BUG=636462
Committed: https://crrev.com/2805c285bf5a0b681c2ad648c0d5506aa26985d1
Cr-Commit-Position: refs/heads/master@{#415544}
Patch Set 1 #Patch Set 2 : fix #Patch Set 3 : fix #Patch Set 4 : rebase #
Total comments: 6
Patch Set 5 : fix #Messages
Total messages: 50 (34 generated)
The CQ bit was checked by yhirano@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by yhirano@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by yhirano@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by yhirano@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #3 (id:40001) has been deleted
Description was changed from ========== Reserve Vector's capacity manually in CachedMetadata As CachedMetaData::m_serializedData is set only at the initialization timing, we can call Vector<char>::reserveCapacity to save memory consumption without loosing performance. This CL includes other cleanups: - Renamed methods, - Replaced error handling with DCHECKs, - Replaced unsigned with uint32_t. BUG=636462 ========== to ========== Reserve Vector's capacity manually in CachedMetadata As CachedMetaData::m_serializedData is set only at the initialization timing, we can call Vector<char>::reserveCapacity to save memory consumption without loosing performance. This CL includes other cleanups: - Renaming methods, - Replacing error handling logic with DCHECKs, - Replacing unsigned with uint32_t. BUG=636462 ==========
yhirano@chromium.org changed reviewers: + esprehn@chromium.org
LGTM
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by yhirano@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_chromeos_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by yhirano@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by yhirano@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by yhirano@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Failed to apply patch for
third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp:
While running git apply --index -3 -p1;
error: patch failed:
third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp:137
Falling back to three-way merge...
Applied patch to
'third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp' with conflicts.
U third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
Patch: third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
Index: third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
index
f7258b0a58a5c024c2a58b189e65bfc0ef3c2686..0d76057d3df2b88a28fc45c4c9e08432e68aa35a
100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
@@ -137,7 +137,7 @@ v8::MaybeLocal<v8::Script>
compileWithoutOptions(V8CompileHistogram::Cacheabilit
}
// Compile a script, and consume a V8 cache that was generated previously.
-v8::MaybeLocal<v8::Script> compileAndConsumeCache(CachedMetadataHandler*
cacheHandler, unsigned tag, v8::ScriptCompiler::CompileOptions compileOptions,
v8::Isolate* isolate, v8::Local<v8::String> code, v8::ScriptOrigin origin)
+v8::MaybeLocal<v8::Script> compileAndConsumeCache(CachedMetadataHandler*
cacheHandler, uint32_t tag, v8::ScriptCompiler::CompileOptions compileOptions,
v8::Isolate* isolate, v8::Local<v8::String> code, v8::ScriptOrigin origin)
{
V8CompileHistogram histogramScope(V8CompileHistogram::Cacheable);
CachedMetadata* cachedMetadata = cacheHandler->cachedMetadata(tag);
@@ -153,7 +153,7 @@ v8::MaybeLocal<v8::Script>
compileAndConsumeCache(CachedMetadataHandler* cacheHa
}
// Compile a script, and produce a V8 cache for future use.
-v8::MaybeLocal<v8::Script> compileAndProduceCache(CachedMetadataHandler*
cacheHandler, unsigned tag, v8::ScriptCompiler::CompileOptions compileOptions,
CachedMetadataHandler::CacheType cacheType, v8::Isolate* isolate,
v8::Local<v8::String> code, v8::ScriptOrigin origin)
+v8::MaybeLocal<v8::Script> compileAndProduceCache(CachedMetadataHandler*
cacheHandler, uint32_t tag, v8::ScriptCompiler::CompileOptions compileOptions,
CachedMetadataHandler::CacheType cacheType, v8::Isolate* isolate,
v8::Local<v8::String> code, v8::ScriptOrigin origin)
{
V8CompileHistogram histogramScope(V8CompileHistogram::Cacheable);
v8::ScriptCompiler::Source source(code, origin);
@@ -176,7 +176,7 @@ v8::MaybeLocal<v8::Script>
compileAndProduceCache(CachedMetadataHandler* cacheHa
// Compile a script, and consume or produce a V8 Cache, depending on whether
the
// given resource already has cached data available.
-v8::MaybeLocal<v8::Script> compileAndConsumeOrProduce(CachedMetadataHandler*
cacheHandler, unsigned tag, v8::ScriptCompiler::CompileOptions consumeOptions,
v8::ScriptCompiler::CompileOptions produceOptions,
CachedMetadataHandler::CacheType cacheType, v8::Isolate* isolate,
v8::Local<v8::String> code, v8::ScriptOrigin origin)
+v8::MaybeLocal<v8::Script> compileAndConsumeOrProduce(CachedMetadataHandler*
cacheHandler, uint32_t tag, v8::ScriptCompiler::CompileOptions consumeOptions,
v8::ScriptCompiler::CompileOptions produceOptions,
CachedMetadataHandler::CacheType cacheType, v8::Isolate* isolate,
v8::Local<v8::String> code, v8::ScriptOrigin origin)
{
return cacheHandler->cachedMetadata(tag)
? compileAndConsumeCache(cacheHandler, tag, consumeOptions, isolate,
code, origin)
@@ -192,11 +192,11 @@ enum CacheTagKind {
static const int kCacheTagKindSize = 2;
-unsigned cacheTag(CacheTagKind kind, CachedMetadataHandler* cacheHandler)
+uint32_t cacheTag(CacheTagKind kind, CachedMetadataHandler* cacheHandler)
{
static_assert((1 << kCacheTagKindSize) >= CacheTagLast, "CacheTagLast must
be large enough");
- static unsigned v8CacheDataVersion =
v8::ScriptCompiler::CachedDataVersionTag() << kCacheTagKindSize;
+ static uint32_t v8CacheDataVersion =
v8::ScriptCompiler::CachedDataVersionTag() << kCacheTagKindSize;
// A script can be (successfully) interpreted with different encodings,
// depending on the page it appears in. The cache doesn't know anything
@@ -210,7 +210,7 @@ unsigned cacheTag(CacheTagKind kind, CachedMetadataHandler*
cacheHandler)
bool isResourceHotForCaching(CachedMetadataHandler* cacheHandler, int hotHours)
{
const double cacheWithinSeconds = hotHours * 60 * 60;
- unsigned tag = cacheTag(CacheTagTimeStamp, cacheHandler);
+ uint32_t tag = cacheTag(CacheTagTimeStamp, cacheHandler);
CachedMetadata* cachedMetadata = cacheHandler->cachedMetadata(tag);
if (!cachedMetadata)
return false;
@@ -304,7 +304,7 @@ std::unique_ptr<CompileFn>
selectCompileFunction(V8CacheOptions cacheOptions, Ca
case V8CacheOptionsAlways: {
// Use code caching for recently seen resources.
// Use compression depending on the cache option.
- unsigned codeCacheTag = cacheTag(CacheTagCode, cacheHandler);
+ uint32_t codeCacheTag = cacheTag(CacheTagCode, cacheHandler);
CachedMetadata* codeCache = cacheHandler->cachedMetadata(codeCacheTag);
if (codeCache)
return bind(compileAndConsumeCache, wrapPersistent(cacheHandler),
codeCacheTag, v8::ScriptCompiler::kConsumeCodeCache);
@@ -563,12 +563,12 @@ v8::MaybeLocal<v8::Object>
V8ScriptRunner::instantiateObjectInDocument(v8::Isola
return result;
}
-unsigned V8ScriptRunner::tagForParserCache(CachedMetadataHandler* cacheHandler)
+uint32_t V8ScriptRunner::tagForParserCache(CachedMetadataHandler* cacheHandler)
{
return cacheTag(CacheTagParser, cacheHandler);
}
-unsigned V8ScriptRunner::tagForCodeCache(CachedMetadataHandler* cacheHandler)
+uint32_t V8ScriptRunner::tagForCodeCache(CachedMetadataHandler* cacheHandler)
{
return cacheTag(CacheTagCode, cacheHandler);
}
@@ -577,7 +577,7 @@ unsigned
V8ScriptRunner::tagForCodeCache(CachedMetadataHandler* cacheHandler)
void V8ScriptRunner::setCacheTimeStamp(CachedMetadataHandler* cacheHandler)
{
double now = WTF::currentTime();
- unsigned tag = cacheTag(CacheTagTimeStamp, cacheHandler);
+ uint32_t tag = cacheTag(CacheTagTimeStamp, cacheHandler);
cacheHandler->clearCachedMetadata(CachedMetadataHandler::CacheLocally);
cacheHandler->setCachedMetadata(tag, reinterpret_cast<char*>(&now),
sizeof(now), CachedMetadataHandler::SendToPlatform);
}
The CQ bit was checked by yhirano@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
esprehn@chromium.org changed reviewers: + haraken@chromium.org
https://codereview.chromium.org/2258743002/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/fetch/CachedMetadata.cpp (right): https://codereview.chromium.org/2258743002/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/fetch/CachedMetadata.cpp:14: DCHECK_GT(size, kDataStart); DCHECK(data) https://codereview.chromium.org/2258743002/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/fetch/CachedMetadata.cpp:15: m_serializedData.reserveCapacity(size); reserveInitialCapacity https://codereview.chromium.org/2258743002/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/fetch/CachedMetadata.cpp:25: m_serializedData.reserveCapacity(sizeof(uint32_t) + size); reserveInitialCapacity.
The CQ bit was checked by yhirano@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2258743002/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/fetch/CachedMetadata.cpp (right): https://codereview.chromium.org/2258743002/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/fetch/CachedMetadata.cpp:14: DCHECK_GT(size, kDataStart); On 2016/08/26 04:51:01, esprehn wrote: > DCHECK(data) Done. https://codereview.chromium.org/2258743002/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/fetch/CachedMetadata.cpp:15: m_serializedData.reserveCapacity(size); On 2016/08/26 04:51:01, esprehn wrote: > reserveInitialCapacity Done. https://codereview.chromium.org/2258743002/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/fetch/CachedMetadata.cpp:25: m_serializedData.reserveCapacity(sizeof(uint32_t) + size); On 2016/08/26 04:51:01, esprehn wrote: > reserveInitialCapacity. Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
lgtm
The CQ bit was checked by yhirano@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from haraken@chromium.org Link to the patchset: https://codereview.chromium.org/2258743002/#ps100001 (title: "fix")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Reserve Vector's capacity manually in CachedMetadata As CachedMetaData::m_serializedData is set only at the initialization timing, we can call Vector<char>::reserveCapacity to save memory consumption without loosing performance. This CL includes other cleanups: - Renaming methods, - Replacing error handling logic with DCHECKs, - Replacing unsigned with uint32_t. BUG=636462 ========== to ========== Reserve Vector's capacity manually in CachedMetadata As CachedMetaData::m_serializedData is set only at the initialization timing, we can call Vector<char>::reserveCapacity to save memory consumption without loosing performance. This CL includes other cleanups: - Renaming methods, - Replacing error handling logic with DCHECKs, - Replacing unsigned with uint32_t. BUG=636462 ==========
Message was sent while issue was closed.
Committed patchset #5 (id:100001)
Message was sent while issue was closed.
Description was changed from ========== Reserve Vector's capacity manually in CachedMetadata As CachedMetaData::m_serializedData is set only at the initialization timing, we can call Vector<char>::reserveCapacity to save memory consumption without loosing performance. This CL includes other cleanups: - Renaming methods, - Replacing error handling logic with DCHECKs, - Replacing unsigned with uint32_t. BUG=636462 ========== to ========== Reserve Vector's capacity manually in CachedMetadata As CachedMetaData::m_serializedData is set only at the initialization timing, we can call Vector<char>::reserveCapacity to save memory consumption without loosing performance. This CL includes other cleanups: - Renaming methods, - Replacing error handling logic with DCHECKs, - Replacing unsigned with uint32_t. BUG=636462 Committed: https://crrev.com/2805c285bf5a0b681c2ad648c0d5506aa26985d1 Cr-Commit-Position: refs/heads/master@{#415544} ==========
Message was sent while issue was closed.
Patchset 5 (id:??) landed as https://crrev.com/2805c285bf5a0b681c2ad648c0d5506aa26985d1 Cr-Commit-Position: refs/heads/master@{#415544} |
