<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>89042</bug_id>
          
          <creation_ts>2012-06-13 15:14:41 -0700</creation_ts>
          <short_desc>[V8] V8ArrayBufferViewCustom.cpp uses unnecessary v8::Script::Compile</short_desc>
          <delta_ts>2012-06-13 16:37:43 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Erik Arvidsson">arv</reporter>
          <assigned_to name="Kenneth Russell">kbr</assigned_to>
          <cc>kbr</cc>
    
    <cc>ulan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>648504</commentid>
    <comment_count>0</comment_count>
    <who name="Erik Arvidsson">arv</who>
    <bug_when>2012-06-13 15:14:41 -0700</bug_when>
    <thetext>This code looks suspicious.

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

We should not invoke the compiler for this. We can just write the same code in C++.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>648527</commentid>
    <comment_count>1</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2012-06-13 15:42:43 -0700</bug_when>
    <thetext>This code inserts a JavaScript-side shim developed by Ulan Degenbaev which provides a large speedup for setting a typed array from a JavaScript array. The same code in C++ is hugely slower due to the need to go across the V8 API for every incoming array element.

I&apos;m closing this as WontFix. If I misunderstood why this bug was filed, please reopen it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>648576</commentid>
    <comment_count>2</comment_count>
    <who name="Erik Arvidsson">arv</who>
    <bug_when>2012-06-13 16:37:43 -0700</bug_when>
    <thetext>OK. Thanks for the clarification.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>