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

Side by Side Diff: Source/bindings/core/v8/V8ScriptRunner.cpp

Issue 1112793002: Removing blink::prefix (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing buildIssues Created 5 years, 7 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
« no previous file with comments | « Source/bindings/core/v8/V8PerIsolateData.cpp ('k') | Source/bindings/core/v8/WindowProxy.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 V8CompileHistogram::V8CompileHistogram(V8CompileHistogram::Cacheability cacheabi lity) 69 V8CompileHistogram::V8CompileHistogram(V8CompileHistogram::Cacheability cacheabi lity)
70 : m_cacheability(cacheability) 70 : m_cacheability(cacheability)
71 , m_timeStamp(WTF::currentTime()) 71 , m_timeStamp(WTF::currentTime())
72 { 72 {
73 } 73 }
74 74
75 V8CompileHistogram::~V8CompileHistogram() 75 V8CompileHistogram::~V8CompileHistogram()
76 { 76 {
77 int64_t elapsedMicroSeconds = static_cast<int64_t>((WTF::currentTime() - m_t imeStamp) * 1000000); 77 int64_t elapsedMicroSeconds = static_cast<int64_t>((WTF::currentTime() - m_t imeStamp) * 1000000);
78 const char* name = (m_cacheability == Cacheable) ? "V8.CompileCacheableMicro Seconds" : "V8.CompileNoncacheableMicroSeconds"; 78 const char* name = (m_cacheability == Cacheable) ? "V8.CompileCacheableMicro Seconds" : "V8.CompileNoncacheableMicroSeconds";
79 blink::Platform::current()->histogramCustomCounts(name, elapsedMicroSeconds, 0, 1000000, 50); 79 Platform::current()->histogramCustomCounts(name, elapsedMicroSeconds, 0, 100 0000, 50);
80 } 80 }
81 81
82 // In order to make sure all pending messages to be processed in 82 // In order to make sure all pending messages to be processed in
83 // v8::Function::Call, we don't call throwStackOverflowException 83 // v8::Function::Call, we don't call throwStackOverflowException
84 // directly. Instead, we create a v8::Function of 84 // directly. Instead, we create a v8::Function of
85 // throwStackOverflowException and call it. 85 // throwStackOverflowException and call it.
86 void throwStackOverflowException(const v8::FunctionCallbackInfo<v8::Value>& info ) 86 void throwStackOverflowException(const v8::FunctionCallbackInfo<v8::Value>& info )
87 { 87 {
88 V8ThrowException::throwRangeError(info.GetIsolate(), "Maximum call stack siz e exceeded."); 88 V8ThrowException::throwRangeError(info.GetIsolate(), "Maximum call stack siz e exceeded.");
89 } 89 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 int length = cachedData->length; 159 int length = cachedData->length;
160 std::string compressedOutput; 160 std::string compressedOutput;
161 if (compressed) { 161 if (compressed) {
162 snappy::Compress(data, length, &compressedOutput); 162 snappy::Compress(data, length, &compressedOutput);
163 data = compressedOutput.data(); 163 data = compressedOutput.data();
164 length = compressedOutput.length(); 164 length = compressedOutput.length();
165 } 165 }
166 if (length > 1024) { 166 if (length > 1024) {
167 // Omit histogram samples for small cache data to avoid outliers. 167 // Omit histogram samples for small cache data to avoid outliers.
168 int cacheSizeRatio = static_cast<int>(100.0 * length / code->Length( )); 168 int cacheSizeRatio = static_cast<int>(100.0 * length / code->Length( ));
169 blink::Platform::current()->histogramCustomCounts("V8.CodeCacheSizeR atio", cacheSizeRatio, 0, 10000, 50); 169 Platform::current()->histogramCustomCounts("V8.CodeCacheSizeRatio", cacheSizeRatio, 0, 10000, 50);
170 } 170 }
171 cacheHandler->clearCachedMetadata(CachedMetadataHandler::CacheLocally); 171 cacheHandler->clearCachedMetadata(CachedMetadataHandler::CacheLocally);
172 cacheHandler->setCachedMetadata(tag, data, length, cacheType); 172 cacheHandler->setCachedMetadata(tag, data, length, cacheType);
173 } 173 }
174 return script; 174 return script;
175 } 175 }
176 176
177 // Compile a script, and consume or produce a V8 Cache, depending on whether the 177 // Compile a script, and consume or produce a V8 Cache, depending on whether the
178 // given resource already has cached data available. 178 // given resource already has cached data available.
179 v8::MaybeLocal<v8::Script> compileAndConsumeOrProduce(CachedMetadataHandler* cac heHandler, unsigned tag, v8::ScriptCompiler::CompileOptions consumeOptions, v8:: ScriptCompiler::CompileOptions produceOptions, bool compressed, CachedMetadataHa ndler::CacheType cacheType, v8::Isolate* isolate, v8::Local<v8::String> code, v8 ::ScriptOrigin origin) 179 v8::MaybeLocal<v8::Script> compileAndConsumeOrProduce(CachedMetadataHandler* cac heHandler, unsigned tag, v8::ScriptCompiler::CompileOptions consumeOptions, v8:: ScriptCompiler::CompileOptions produceOptions, bool compressed, CachedMetadataHa ndler::CacheType cacheType, v8::Isolate* isolate, v8::Local<v8::String> code, v8 ::ScriptOrigin origin)
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 { 538 {
539 return cacheTag(CacheTagParser, cacheHandler); 539 return cacheTag(CacheTagParser, cacheHandler);
540 } 540 }
541 541
542 unsigned V8ScriptRunner::tagForCodeCache(CachedMetadataHandler* cacheHandler) 542 unsigned V8ScriptRunner::tagForCodeCache(CachedMetadataHandler* cacheHandler)
543 { 543 {
544 return cacheTag(CacheTagCode, cacheHandler); 544 return cacheTag(CacheTagCode, cacheHandler);
545 } 545 }
546 546
547 } // namespace blink 547 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8PerIsolateData.cpp ('k') | Source/bindings/core/v8/WindowProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698