Changeset 60728 in webkit


Ignore:
Timestamp:
Jun 4, 2010 6:28:34 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-06-04 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r60684.
http://trac.webkit.org/changeset/60684
https://bugs.webkit.org/show_bug.cgi?id=40196

This patch broke chromium reliability tests (Requested by
tonyg-cr on #webkit).

  • bindings/v8/ScriptSourceCode.h: (WebCore::ScriptSourceCode::ScriptSourceCode):
  • bindings/v8/V8Proxy.cpp: (WebCore::V8Proxy::compileScript): (WebCore::V8Proxy::evaluate):
  • bindings/v8/V8Proxy.h:
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r60727 r60728  
     12010-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
    1172010-06-04  Chris Fleizach  <cfleizach@apple.com>
    218
  • trunk/WebCore/bindings/v8/ScriptSourceCode.h

    r60684 r60728  
    3232#define ScriptSourceCode_h
    3333
    34 #include "CachedResourceHandle.h"
    3534#include "CachedScript.h"
    3635#include "KURL.h"
     
    4342    ScriptSourceCode(const String& source, const KURL& url = KURL(), int startLine = 1)
    4443        : m_source(source)
    45         , m_cachedScript(0)
    4644        , m_url(url)
    4745        , m_startLine(startLine)
     
    5351    ScriptSourceCode(CachedScript* cs)
    5452        : m_source(cs->script())
    55         , m_cachedScript(cs)
    5653        , m_url(ParsedURLString, cs->url())
    5754        , m_startLine(1)
     
    6259
    6360    const String& source() const { return m_source; }
    64     CachedScript* cachedScript() const { return m_cachedScript.get(); }
    6561    const KURL& url() const { return m_url; }
    6662    int startLine() const { return m_startLine; }
     
    6864private:
    6965    String m_source;
    70     CachedResourceHandle<CachedScript> m_cachedScript;
    7166    KURL m_url;
    7267    int m_startLine;
  • trunk/WebCore/bindings/v8/V8Proxy.cpp

    r60684 r60728  
    3232#include "V8Proxy.h"
    3333
    34 #include "CachedMetadata.h"
    3534#include "CSSMutableStyleDeclaration.h"
    3635#include "DateExtension.h"
     
    7271#include <wtf/Assertions.h>
    7372#include <wtf/OwnArrayPtr.h>
    74 #include <wtf/OwnPtr.h>
    7573#include <wtf/StdLibExtras.h>
    7674#include <wtf/StringExtras.h>
     
    236234}
    237235
    238 v8::Handle<v8::Script> V8Proxy::compileScript(v8::Handle<v8::String> code, const String& fileName, int baseLine, v8::ScriptData* scriptData)
     236v8::Handle<v8::Script> V8Proxy::compileScript(v8::Handle<v8::String> code, const String& fileName, int baseLine)
    239237{
    240238    const uint16_t* fileNameString = fromWebCoreString(fileName);
     
    242240    v8::Handle<v8::Integer> line = v8::Integer::New(baseLine);
    243241    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);
    245243    return script;
    246244}
     
    341339}
    342340
    343 PassOwnPtr<v8::ScriptData> V8Proxy::precompileScript(const ScriptSourceCode& source)
    344 {
    345     // A pseudo-randomly chosen ID used to store and retrieve V8 ScriptData from
    346     // 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 
    370341v8::Local<v8::Value> V8Proxy::evaluate(const ScriptSourceCode& source, Node* node)
    371342{
     
    393364        PlatformBridge::traceEventBegin("v8.compile", node, "");
    394365#endif
    395         OwnPtr<v8::ScriptData> scriptData = precompileScript(source);
    396366
    397367        // NOTE: For compatibility with WebCore, ScriptSourceCode's line starts at
    398368        // 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);
    400370#if PLATFORM(CHROMIUM)
    401371        PlatformBridge::traceEventEnd("v8.compile", node, "");
  • trunk/WebCore/bindings/v8/V8Proxy.h

    r60684 r60728  
    286286        static v8::Handle<v8::Value> checkNewLegal(const v8::Arguments&);
    287287
    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);
    289289
    290290        // If the exception code is different from zero, a DOM exception is
     
    338338        void resetIsolatedWorlds();
    339339
    340         PassOwnPtr<v8::ScriptData> precompileScript(const ScriptSourceCode& source);
    341 
    342340        // Returns false when we're out of memory in V8.
    343341        bool setInjectedScriptContextDebugId(v8::Handle<v8::Context> targetContext);
Note: See TracChangeset for help on using the changeset viewer.