Changeset 49756 in webkit


Ignore:
Timestamp:
Oct 18, 2009 12:55:49 PM (15 years ago)
Author:
eric@webkit.org
Message:

2009-10-18 Anton Muhin <antonm@chromium.org>

Reviewed by Adam Barth.

Use v8::Integer::NewFromUnsigned when converting unsigneds into V8's numbers.
That is notably faster for small numbers (most common case).
https://bugs.webkit.org/show_bug.cgi?id=30493

  • bindings/scripts/CodeGeneratorV8.pm:
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r49755 r49756  
     12009-10-18  Anton Muhin  <antonm@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Use v8::Integer::NewFromUnsigned when converting unsigneds into V8's numbers.
     6        That is notably faster for small numbers (most common case).
     7        https://bugs.webkit.org/show_bug.cgi?id=30493
     8
     9        * bindings/scripts/CodeGeneratorV8.pm:
     10
    1112009-10-18  Jan Michael Alonzo  <jmalonzo@webkit.org>
    212
  • trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r49510 r49756  
    21232123    # For all the types where we use 'int' as the representation type,
    21242124    # we use Integer::New which has a fast Smi conversion check.
    2125     return "return v8::Integer::New($value)" if GetNativeType($type) eq "int";
     2125    my $nativeType = GetNativeType($type);
     2126    return "return v8::Integer::New($value)" if $nativeType eq "int";
     2127    return "return v8::Integer::NewFromUnsigned($value)" if $nativeType eq "unsigned";
    21262128
    21272129    return "return v8::Number::New($value)" if $codeGenerator->IsPrimitiveType($type) or $type eq "SVGPaintType";
Note: See TracChangeset for help on using the changeset viewer.