[Webkit-unassigned] [Bug 89042] New: [V8] V8ArrayBufferViewCustom.cpp uses unnecessary v8::Script::Compile

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 13 15:14:42 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=89042

           Summary: [V8] V8ArrayBufferViewCustom.cpp uses unnecessary
                    v8::Script::Compile
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: arv at chromium.org
                CC: kbr at google.com


This code looks suspicious.

v8::Handle<v8::Value> installHiddenCopyMethod(v8::Handle<v8::Object> prototype) {
    v8::TryCatch tryCatch;
    tryCatch.SetVerbose(true);
    String source(reinterpret_cast<const char*>(V8ArrayBufferViewCustomScript_js),
                  sizeof(V8ArrayBufferViewCustomScript_js));
    v8::Handle<v8::Script> script = v8::Script::Compile(v8String(source));
    v8::Handle<v8::Value> value = script->Run();
    v8::Handle<v8::String> key = v8::String::New(hiddenCopyMethodName);
    prototype->SetHiddenValue(key, value);
    return value;
}

We should not invoke the compiler for this. We can just write the same code in C++.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list