Changeset 61408 in webkit
- Timestamp:
- Jun 18, 2010 8:46:24 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r61406 r61408 1 2010-06-18 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r61405. 4 http://trac.webkit.org/changeset/61405 5 https://bugs.webkit.org/show_bug.cgi?id=40838 6 7 broke chromium mac compile (Requested by tonyg-cr1 on 8 #webkit). 9 10 * fast/js/parser-high-byte-character-expected.txt: Removed. 11 * fast/js/parser-high-byte-character.html: Removed. 12 * fast/js/script-tests/parser-high-byte-character.js: Removed. 13 1 14 2010-06-18 Zhenyao Mo <zmo@google.com> 2 15 -
trunk/WebCore/ChangeLog
r61406 r61408 1 2010-06-18 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r61405. 4 http://trac.webkit.org/changeset/61405 5 https://bugs.webkit.org/show_bug.cgi?id=40838 6 7 broke chromium mac compile (Requested by tonyg-cr1 on 8 #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-18 Zhenyao Mo <zmo@google.com> 2 18 -
trunk/WebCore/bindings/v8/ScriptSourceCode.h
r61405 r61408 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
r61405 r61408 33 33 34 34 #include "CSSMutableStyleDeclaration.h" 35 #include "CachedMetadata.h"36 35 #include "DateExtension.h" 37 36 #include "DocumentLoader.h" … … 71 70 #include <wtf/Assertions.h> 72 71 #include <wtf/OwnArrayPtr.h> 73 #include <wtf/OwnPtr.h>74 72 #include <wtf/StdLibExtras.h> 75 73 #include <wtf/StringExtras.h> … … 235 233 } 236 234 237 v8::Handle<v8::Script> V8Proxy::compileScript(v8::Handle<v8::String> code, const String& fileName, int baseLine , v8::ScriptData* scriptData)235 v8::Handle<v8::Script> V8Proxy::compileScript(v8::Handle<v8::String> code, const String& fileName, int baseLine) 238 236 { 239 237 const uint16_t* fileNameString = fromWebCoreString(fileName); … … 241 239 v8::Handle<v8::Integer> line = v8::Integer::New(baseLine); 242 240 v8::ScriptOrigin origin(name, line); 243 v8::Handle<v8::Script> script = v8::Script::Compile(code, &origin , scriptData);241 v8::Handle<v8::Script> script = v8::Script::Compile(code, &origin); 244 242 return script; 245 243 } … … 340 338 } 341 339 342 PassOwnPtr<v8::ScriptData> V8Proxy::precompileScript(v8::Handle<v8::String> code, CachedScript* cachedScript)343 {344 // A pseudo-randomly chosen ID used to store and retrieve V8 ScriptData from345 // the CachedScript. If the format changes, this ID should be changed too.346 static const unsigned dataTypeID = 0xECC13BD7;347 348 // Very small scripts are not worth the effort to preparse.349 static const unsigned minPreparseLength = 1024;350 351 if (!cachedScript || code->Length() < minPreparseLength)352 return 0;353 354 CachedMetadata* cachedMetadata = cachedScript->cachedMetadata(dataTypeID);355 if (cachedMetadata)356 return v8::ScriptData::New(cachedMetadata->data(), cachedMetadata->size());357 358 OwnPtr<v8::ScriptData> scriptData(v8::ScriptData::PreCompile(code));359 cachedScript->setCachedMetadata(dataTypeID, scriptData->Data(), scriptData->Length());360 361 return scriptData.release();362 }363 364 340 v8::Local<v8::Value> V8Proxy::evaluate(const ScriptSourceCode& source, Node* node) 365 341 { … … 387 363 PlatformBridge::traceEventBegin("v8.compile", node, ""); 388 364 #endif 389 OwnPtr<v8::ScriptData> scriptData = precompileScript(code, source.cachedScript());390 365 391 366 // NOTE: For compatibility with WebCore, ScriptSourceCode's line starts at 392 367 // 1, whereas v8 starts at 0. 393 v8::Handle<v8::Script> script = compileScript(code, source.url(), source.startLine() - 1 , scriptData.get());368 v8::Handle<v8::Script> script = compileScript(code, source.url(), source.startLine() - 1); 394 369 #if PLATFORM(CHROMIUM) 395 370 PlatformBridge::traceEventEnd("v8.compile", node, ""); -
trunk/WebCore/bindings/v8/V8Proxy.h
r61405 r61408 54 54 namespace WebCore { 55 55 56 class CachedScript;57 56 class DOMWindow; 58 57 class Frame; … … 287 286 static v8::Handle<v8::Value> checkNewLegal(const v8::Arguments&); 288 287 289 static v8::Handle<v8::Script> compileScript(v8::Handle<v8::String> code, const String& fileName, int baseLine , v8::ScriptData* = 0);288 static v8::Handle<v8::Script> compileScript(v8::Handle<v8::String> code, const String& fileName, int baseLine); 290 289 291 290 // If the exception code is different from zero, a DOM exception is … … 343 342 void resetIsolatedWorlds(); 344 343 345 PassOwnPtr<v8::ScriptData> precompileScript(v8::Handle<v8::String>, CachedScript*);346 347 344 // Returns false when we're out of memory in V8. 348 345 bool setInjectedScriptContextDebugId(v8::Handle<v8::Context> targetContext);
Note: See TracChangeset
for help on using the changeset viewer.