Changeset 60728 in webkit
- Timestamp:
- Jun 4, 2010 6:28:34 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r60727 r60728 1 2010-06-04 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r60684. 4 http://trac.webkit.org/changeset/60684 5 https://bugs.webkit.org/show_bug.cgi?id=40196 6 7 This patch broke chromium reliability tests (Requested by 8 tonyg-cr on #webkit). 9 10 * bindings/v8/ScriptSourceCode.h: 11 (WebCore::ScriptSourceCode::ScriptSourceCode): 12 * bindings/v8/V8Proxy.cpp: 13 (WebCore::V8Proxy::compileScript): 14 (WebCore::V8Proxy::evaluate): 15 * bindings/v8/V8Proxy.h: 16 1 17 2010-06-04 Chris Fleizach <cfleizach@apple.com> 2 18 -
trunk/WebCore/bindings/v8/ScriptSourceCode.h
r60684 r60728 32 32 #define ScriptSourceCode_h 33 33 34 #include "CachedResourceHandle.h"35 34 #include "CachedScript.h" 36 35 #include "KURL.h" … … 43 42 ScriptSourceCode(const String& source, const KURL& url = KURL(), int startLine = 1) 44 43 : m_source(source) 45 , m_cachedScript(0)46 44 , m_url(url) 47 45 , m_startLine(startLine) … … 53 51 ScriptSourceCode(CachedScript* cs) 54 52 : m_source(cs->script()) 55 , m_cachedScript(cs)56 53 , m_url(ParsedURLString, cs->url()) 57 54 , m_startLine(1) … … 62 59 63 60 const String& source() const { return m_source; } 64 CachedScript* cachedScript() const { return m_cachedScript.get(); }65 61 const KURL& url() const { return m_url; } 66 62 int startLine() const { return m_startLine; } … … 68 64 private: 69 65 String m_source; 70 CachedResourceHandle<CachedScript> m_cachedScript;71 66 KURL m_url; 72 67 int m_startLine; -
trunk/WebCore/bindings/v8/V8Proxy.cpp
r60684 r60728 32 32 #include "V8Proxy.h" 33 33 34 #include "CachedMetadata.h"35 34 #include "CSSMutableStyleDeclaration.h" 36 35 #include "DateExtension.h" … … 72 71 #include <wtf/Assertions.h> 73 72 #include <wtf/OwnArrayPtr.h> 74 #include <wtf/OwnPtr.h>75 73 #include <wtf/StdLibExtras.h> 76 74 #include <wtf/StringExtras.h> … … 236 234 } 237 235 238 v8::Handle<v8::Script> V8Proxy::compileScript(v8::Handle<v8::String> code, const String& fileName, int baseLine , v8::ScriptData* scriptData)236 v8::Handle<v8::Script> V8Proxy::compileScript(v8::Handle<v8::String> code, const String& fileName, int baseLine) 239 237 { 240 238 const uint16_t* fileNameString = fromWebCoreString(fileName); … … 242 240 v8::Handle<v8::Integer> line = v8::Integer::New(baseLine); 243 241 v8::ScriptOrigin origin(name, line); 244 v8::Handle<v8::Script> script = v8::Script::Compile(code, &origin , scriptData);242 v8::Handle<v8::Script> script = v8::Script::Compile(code, &origin); 245 243 return script; 246 244 } … … 341 339 } 342 340 343 PassOwnPtr<v8::ScriptData> V8Proxy::precompileScript(const ScriptSourceCode& source)344 {345 // A pseudo-randomly chosen ID used to store and retrieve V8 ScriptData from346 // the CachedScript. If the format changes, this ID should be changed too.347 static const unsigned dataTypeID = 0xECC13BD7;348 349 // Very small scripts are not worth the effort to preparse.350 static const unsigned minPreparseLength = 1024;351 352 CachedScript* cachedScript = source.cachedScript();353 if (!cachedScript)354 return 0;355 356 CachedMetadata* cachedMetadata = cachedScript->cachedMetadata(dataTypeID);357 if (cachedMetadata)358 return v8::ScriptData::New(cachedMetadata->data(), cachedMetadata->size());359 360 const CString& utf8Source = source.source().utf8();361 if (utf8Source.length() < minPreparseLength)362 return 0;363 364 v8::ScriptData* scriptData = v8::ScriptData::PreCompile(utf8Source.data(), utf8Source.length());365 cachedScript->setCachedMetadata(dataTypeID, scriptData->Data(), scriptData->Length());366 367 return scriptData;368 }369 370 341 v8::Local<v8::Value> V8Proxy::evaluate(const ScriptSourceCode& source, Node* node) 371 342 { … … 393 364 PlatformBridge::traceEventBegin("v8.compile", node, ""); 394 365 #endif 395 OwnPtr<v8::ScriptData> scriptData = precompileScript(source);396 366 397 367 // NOTE: For compatibility with WebCore, ScriptSourceCode's line starts at 398 368 // 1, whereas v8 starts at 0. 399 v8::Handle<v8::Script> script = compileScript(code, source.url(), source.startLine() - 1 , scriptData.get());369 v8::Handle<v8::Script> script = compileScript(code, source.url(), source.startLine() - 1); 400 370 #if PLATFORM(CHROMIUM) 401 371 PlatformBridge::traceEventEnd("v8.compile", node, ""); -
trunk/WebCore/bindings/v8/V8Proxy.h
r60684 r60728 286 286 static v8::Handle<v8::Value> checkNewLegal(const v8::Arguments&); 287 287 288 static v8::Handle<v8::Script> compileScript(v8::Handle<v8::String> code, const String& fileName, int baseLine , v8::ScriptData* scriptData = 0);288 static v8::Handle<v8::Script> compileScript(v8::Handle<v8::String> code, const String& fileName, int baseLine); 289 289 290 290 // If the exception code is different from zero, a DOM exception is … … 338 338 void resetIsolatedWorlds(); 339 339 340 PassOwnPtr<v8::ScriptData> precompileScript(const ScriptSourceCode& source);341 342 340 // Returns false when we're out of memory in V8. 343 341 bool setInjectedScriptContextDebugId(v8::Handle<v8::Context> targetContext);
Note: See TracChangeset
for help on using the changeset viewer.