1. 20 May, 2016 1 commit
    • pgorszkowski's avatar
      Invalidate defaultObjects if timezone changes · 7afd712a
      pgorszkowski authored
      In case of calling 'toLocaleString', 'toLocaleTimeString' and
      'toLocaleDateString' functions of 'Date' with empty 'locales' and
      'options', DateTimeFormat is cached inside 'defaultObjects'.
      If we change the timezone the cache is not invalidated.
      
      BUG=v8:5022
      TEST=cctest:DateCacheVersion. See the bug
      CQ_INCLUDE_TRYBOTS=tryserver.v8:v8_linux_noi18n_rel_ng
      
      Review-Url: https://codereview.chromium.org/1985423003
      Cr-Commit-Position: refs/heads/master@{#36420}
      7afd712a
  2. 18 May, 2016 1 commit
  3. 12 May, 2016 1 commit
  4. 11 May, 2016 1 commit
    • jshin's avatar
      Use ICU case conversion/transliterator for case conversion · b348d47b
      jshin authored
      When I18N is enabled, use ICU's case conversion API and transliteration
      API [1] to implement String.prototype.to{Upper,Lower}Case and
      String.prototype.toLocale{Upper,Lower}Case.
      
      * ICU-based case conversion was implemented in runtime-i18n.cc/i18n.js
      * The above 4 functions are overridden with those in i18n.js when
        --icu_case_mapping flag is turned on. To control the override by the flag,
        they're overriden in icu-case-mapping.js
      
      Previously, toLocale{U,L}Case just called to{U,L}Case so that they didn't
      support locale-sensitive case conversion for Turkic languages (az, tr),
      Greek (el) and Lithuanian (lt).
      
      Before ICU APIs for the most general case are called, a fast-path for Latin-1
      is tried. It's taken from Blink and adopted as necessary. This fast path
      is always tried for to{U,L}Case. For toLocale{U,L}Case, it's only taken
      when a locale (explicitly specified or default) is not in {az, el, lt, tr}.
      
      With these changes, a build with --icu_case_mapping=true passes a bunch
      of tests in test262/intl402/Strings/* and intl/* that failed before.
      
      Handling of pure ASCII strings (aligned at word boundary) are not as fast
      as Unibrow's implementation that uses word-by-word case conversion. OTOH,
      Latin-1 input handling is faster than Unibrow. General Unicode input
      handling is slower but more accurate.
      
      See https://docs.google.com/spreadsheets/d/1KJCJxKc1FxFXjwmYqABS0_2cNdPetvnd8gY8_HGSbrg/edit?usp=sharing for the benchmark.
      
      This CL started with http://crrev.com/1544023002#ps200001 by littledan@,
      but has changed significantly since.
      
      [1] See why transliteration API is needed for uppercasing in Greek.
          http://bugs.icu-project.org/trac/ticket/10582
      
      R=yangguo
      BUG=v8:4476,v8:4477
      LOG=Y
      TEST=test262/{built-ins,intl402}/Strings/*, webkit/fast/js/*, mjsunit/string-case,
           intl/general/case*
      
      Review-Url: https://codereview.chromium.org/1812673005
      Cr-Commit-Position: refs/heads/master@{#36187}
      b348d47b
  5. 02 May, 2016 1 commit
    • littledan's avatar
      Use InternalArrays from certain Intl code · 4f374bbc
      littledan authored
      The ECMA 402 implementation previously pushed directly to real
      Arrays, which risks having observably incorrect behavior in the
      presence of monkey patching. This patch uses InternalArrays instead
      to avoid that hazard.
      
      R=jshin@chromium.org,yangguo@chromium.org
      BUG=chromium:604299
      LOG=N
      
      Review-Url: https://codereview.chromium.org/1923803002
      Cr-Commit-Position: refs/heads/master@{#35949}
      4f374bbc
  6. 25 Apr, 2016 1 commit
  7. 29 Mar, 2016 1 commit
  8. 28 Mar, 2016 1 commit
    • bmeurer's avatar
      [builtins] Provide Math.floor as TurboFan builtin. · 36ead519
      bmeurer authored
      This way we avoid the second deoptimization for the Math.floor and
      Math.ceil builtins when -0 is involved. We still deoptimize the inlined
      Crankshaft version in various cases, that's a separate issue.
      
      The algorithm used for implement CodeStubAssembler::Float64Floor is
      vaguely based on the fast math version used in the libm of various BSDs,
      but had to be reengineered to match the EcmaScript specification.
      
      R=epertoso@chromium.org
      BUG=v8:2890, v8:4059
      LOG=n
      
      Review URL: https://codereview.chromium.org/1828253002
      
      Cr-Commit-Position: refs/heads/master@{#35083}
      36ead519
  9. 24 Mar, 2016 1 commit
    • littledan's avatar
      Add ES2015 RegExp full subclassing semantics behind a flag · 92a571e5
      littledan authored
      This patch implements ES2015 RegExp subclassing semantics, namely the
      hardest part where RegExp.prototype.exec and certain flag getters can
      be overridden in order to provide different behavior. This change is
      hidden behind a new flag, --harmony-regexp-exec. The flag guards the
      behavior by installing entirely different implementations of the
      methods which follow the new semantics.
      
      Preliminary performance tests show a 3-4x regression in the Octane
      RegExp benchmark. The new code doesn't call out into several fast
      paths that the old code supported, so this is expected.
      
      The patch is tested mostly by test262, where most RegExp tests are fixed,
      with the exception of deliberate spec violations for web compatibility,
      and for the 'sticky' flag, which is not dynamically read by this patch
      in all cases but rather statically compiled into the RegExp. The latter
      will require a follow-on patch to implement. A small additional set of
      tests verifies one particular case, mostly to check whether the flag
      mechanism works.
      
      R=adamk,yangguo@chromium.org
      LOG=Y
      BUG=v8:4602
      
      Review URL: https://codereview.chromium.org/1596483005
      
      Cr-Commit-Position: refs/heads/master@{#35068}
      92a571e5
  10. 29 Feb, 2016 1 commit
  11. 26 Feb, 2016 3 commits
    • littledan's avatar
      Reland of Make Intl install properties more like how other builtins do... · 88d7c59c
      littledan authored
      Reland of Make Intl install properties more like how other builtins do (patchset #1 id:1 of https://codereview.chromium.org/1733293003/ )
      
      This reland fixes a bug by pulling properties off the utils object, so
      that it can be garbage collected in nosnap builds.
      Original commit message:
      
      Intl has been somewhat of an oddball for how it integrates with V8.
      One aspect is that it largely didn't use utils to install itself
      into the snapshot, which led to some missing names, which new
      test262 tests check for, and duplicated code. This patch brings
      Intl a bit closer to how the rest of the builtins do things, though
      not entirely as it is currently structured to do unusual things,
      such as creating new constructors from JavaScript rather than C++.
      New test262 tests check for some of the names that are added in
      this patch.
      
      R=adamk
      CC=jshin
      BUG=v8:4778
      LOG=Y
      
      Review URL: https://codereview.chromium.org/1745483002
      
      Cr-Commit-Position: refs/heads/master@{#34337}
      88d7c59c
    • littledan's avatar
      Revert of Make Intl install properties more like how other builtins do... · 829f951a
      littledan authored
      Revert of Make Intl install properties more like how other builtins do (patchset #1 id:1 of https://codereview.chromium.org/1733293003/ )
      
      Reason for revert:
      Breaks a bot: https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20nosnap/builds/6812
      
      Original issue's description:
      > Make Intl install properties more like how other builtins do
      >
      > Intl has been somewhat of an oddball for how it integrates with V8.
      > One aspect is that it largely didn't use utils to install itself
      > into the snapshot, which led to some missing names, which new
      > test262 tests check for, and duplicated code. This patch brings
      > Intl a bit closer to how the rest of the builtins do things, though
      > not entirely as it is currently structured to do unusual things,
      > such as creating new constructors from JavaScript rather than C++.
      > New test262 tests check for some of the names that are added in
      > this patch.
      >
      > R=adamk
      > CC=jshin
      > BUG=v8:4778
      > LOG=Y
      >
      > Committed: https://crrev.com/a40830577d80f699282dd83864619656b7a7966c
      > Cr-Commit-Position: refs/heads/master@{#34311}
      
      TBR=adamk@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG=v8:4778
      
      Review URL: https://codereview.chromium.org/1737873003
      
      Cr-Commit-Position: refs/heads/master@{#34314}
      829f951a
    • littledan's avatar
      Make Intl install properties more like how other builtins do · a4083057
      littledan authored
      Intl has been somewhat of an oddball for how it integrates with V8.
      One aspect is that it largely didn't use utils to install itself
      into the snapshot, which led to some missing names, which new
      test262 tests check for, and duplicated code. This patch brings
      Intl a bit closer to how the rest of the builtins do things, though
      not entirely as it is currently structured to do unusual things,
      such as creating new constructors from JavaScript rather than C++.
      New test262 tests check for some of the names that are added in
      this patch.
      
      R=adamk
      CC=jshin
      BUG=v8:4778
      LOG=Y
      
      Review URL: https://codereview.chromium.org/1733293003
      
      Cr-Commit-Position: refs/heads/master@{#34311}
      a4083057
  12. 24 Feb, 2016 1 commit
    • littledan's avatar
      Intl: Use private symbols to memoize bound functions · a59f62fc
      littledan authored
      The Intl object used to keep around functions which are bound to the
      receiver and memoized in the object (as required by the ECMA-402 spec)
      in ordinary properties with names like __boundformat__. This patch
      instead stores those methods in private symbol properties, so they are
      not exposed to users. A search in GitHub didn't find any uses of
      __boundformat__ (whereas the same search found plenty of usages of
      other V8 Intl features), so I think this should be fine in terms of
      web compatibility.
      
      BUG=v8:3785
      R=adamk
      LOG=Y
      
      Review URL: https://codereview.chromium.org/1728823002
      
      Cr-Commit-Position: refs/heads/master@{#34230}
      a59f62fc
  13. 04 Feb, 2016 1 commit
  14. 07 Jan, 2016 1 commit
  15. 04 Jan, 2016 1 commit
    • jshin's avatar
      Timezone name check fix · 4e18190e
      jshin authored
      1. Location names with more than one underscores (e.g. Ho_Chi_Minh)
         didn't work because of the way capturing works with repeated patterns
         in RE. It's now supported by changing the RE to capture the whole string
         and splitting on '_' in the next step.
      
      2. Adds support for location names with a hyphen
      
      3. Adds support for timezone ids with three parts (e.g.
         American/Argentina/Buenos_Aires)
      
      4. Adds special handling of 'au', 'es' and 'of' in zone ids. They need to be kept in lowercase. (see the full list at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones )
      
      5. Adds regression tests for all the above and make the existing tests
         more robust against future ICU changes. ICU canonicalizes zone names to
         deprecated names, but it may change. (
         http://bugs.icu-project.org/trac/ticket/12044 )
      
      BUG=364374
      LOG=Y
      
      Review URL: https://codereview.chromium.org/1529363005
      
      Cr-Commit-Position: refs/heads/master@{#33097}
      4e18190e
  16. 10 Dec, 2015 1 commit
    • littledan's avatar
      Allow ICU to normalize time zones · bff3074d
      littledan authored
      There's at least one case of a time zone alias: Asia/Kathmandu aliases
      Asia/Katmandu. ICU seems to normalize to the (deprecated) latter choice.
      V8 internationalization choked on this change; this patch interprets
      ICU's output more precisely and allows it.
      
      BUG=chromium:487322
      R=jungshik,adamk
      LOG=Y
      
      Review URL: https://codereview.chromium.org/1509273007
      
      Cr-Commit-Position: refs/heads/master@{#32769}
      bff3074d
  17. 01 Dec, 2015 1 commit
  18. 24 Nov, 2015 1 commit
  19. 12 Nov, 2015 1 commit
  20. 05 Nov, 2015 1 commit
  21. 02 Nov, 2015 1 commit
  22. 22 Oct, 2015 2 commits
  23. 13 Oct, 2015 1 commit
    • mstarzinger's avatar
      Move builtin JavaScript sources into own directory. · e5320d8a
      mstarzinger authored
      This moves JavaScript source files that are bundled with V8 into a
      separate directory. The goal is to improve code readability and also
      being able to formalize ideal reviewers by subsequently adding the
      OWNERS file. These files almost exclusively contain implementations
      of methods fully specified by ES6.
      
      Note that files in the "debug" directory as well as the "d8.js" file
      aren't affected by this change.
      
      R=rossberg@chromium.org
      
      Review URL: https://codereview.chromium.org/1398733002
      
      Cr-Commit-Position: refs/heads/master@{#31230}
      e5320d8a
  24. 01 Oct, 2015 1 commit
    • bmeurer's avatar
      [es6] Fix missing bits for full @@toPrimitive support. · 2a0759d3
      bmeurer authored
      Introduce %_ToNumber intrinsic, which just calls to the existing
      ToNumberStub, and remove all uses of our custom JavaScript plus
      intrinsics based ToNumber and friends.
      
      Also replace the TO_NUMBER_INLINE macro with TO_NUMBER,
      which is currently a wrapper for %_ToNumber. Newly written JS
      code should use TO_NUMBER (similar to TO_STRING, TO_INT32,
      and friends).
      
      Also finally remove the DefaultString/DefaultNumber builtins, which
      are basically the ES5 version of ToPrimitive. Now all code uses the
      ES6 version, which is implemented in Object::ToPrimitive and
      JSReceiver::ToPrimitive in C++.
      
      CQ_INCLUDE_TRYBOTS=tryserver.v8:v8_linux_layout_dbg,v8_linux_nosnap_dbg
      R=jarin@chromium.org
      BUG=v8:4307
      LOG=n
      
      Review URL: https://codereview.chromium.org/1384443002
      
      Cr-Commit-Position: refs/heads/master@{#31054}
      2a0759d3
  25. 23 Sep, 2015 1 commit
    • bmeurer's avatar
      [runtime] Replace %to_string_fun with %_ToString. · 7a7b692b
      bmeurer authored
      Introduce a new macro TO_STRING that maps to %_ToString and use that
      instead of calling into any of the ToString/NonStringToString JavaScript
      builtins. Also remove the TO_STRING_INLINE macro, which is basically
      obsolete with %_ToString. We still have a few uses of ToString left (via
      the utils export mechanism), where we need to investigate whether we
      will tank badly if we replace them with TO_STRING as well.
      
      CQ_INCLUDE_TRYBOTS=tryserver.v8:v8_linux_layout_dbg,v8_linux_nosnap_dbg
      R=yangguo@chromium.org
      BUG=v8:4307
      LOG=n
      
      Review URL: https://codereview.chromium.org/1323543002
      
      Cr-Commit-Position: refs/heads/master@{#30895}
      7a7b692b
  26. 28 Aug, 2015 1 commit
  27. 26 Aug, 2015 1 commit
  28. 19 Aug, 2015 2 commits
    • yangguo's avatar
      Native context: do not hold onto helper functions on the utils object. · 55a2f5a5
      yangguo authored
      This is to avoid holding onto the function context of prologue.js.
      
      R=cbruni@chromium.org
      
      Review URL: https://codereview.chromium.org/1285133009
      
      Cr-Commit-Position: refs/heads/master@{#30246}
      55a2f5a5
    • yangguo's avatar
      Native context: debug.js does not load from js builtins object anymore. · eb8c0928
      yangguo authored
      This mainly changes how we share ToBoolean, ToNumber and ToString between
      native scripts. Instead of putting them on the js builtins object, we now
      explicitly export and import those functions.
      
      I also had to change the import/export mechanism slightly. Previously,
      exports and imports are hooked up after all native scripts have been
      executed. This means that imported functions cannot be called at the time
      the native script is executed.
      
      However, since ToBoolean (and also e.g. ObjectDefineProperties) is called
      in v8natives.js, I changed the mechanism so that exports from previous
      native scripts (runtime.js for ToBoolean) is imported immediately and can
      be called.
      
      R=cbruni@chromium.org
      
      Review URL: https://codereview.chromium.org/1302533002
      
      Cr-Commit-Position: refs/heads/master@{#30244}
      eb8c0928
  29. 11 Aug, 2015 1 commit
  30. 05 Aug, 2015 1 commit
  31. 31 Jul, 2015 1 commit
    • bmeurer's avatar
      [stubs] Unify (and optimize) implementation of ToObject. · 4fc6f547
      bmeurer authored
      This is the initial (big) step towards a more uniform implementation of
      the ToObject abstract operation (ES6 7.1.13), where we have a fallback
      implementation in JSReceiver::ToObject() and a fast (hydrogen) CodeStub
      to deal with the fast case (we should be able to do more cleanup on this
      in a followup CL).  For natives we expose the abstract operation via a
      %_ToObject intrinsic, also exposed via a macro TO_OBJECT, that unifies
      the previous confusion with TO_OBJECT_INLINE, ToObject, TO_OBJECT,
      $toObject and %$toObject.  Now the whole implementation of the abstract
      operation is context independent, meaning we don't need any magic in the
      builtins object nor the native context.
      
      R=mvstanton@chromium.org,yangguo@chromium.org
      
      Review URL: https://codereview.chromium.org/1266013006
      
      Cr-Commit-Position: refs/heads/master@{#29953}
      4fc6f547
  32. 17 Jul, 2015 1 commit
    • hichris123's avatar
      Make NumberFormat use the ICU currency data, fix bug in NumberFormat · ddb5c2d9
      hichris123 authored
      NumberFormat previously just used a min of 0 digits after the decimal and a max of 3. This CL changes it so that we use the ICU currency data, and set the min and max to the number of numbers after the decimal point for each currency.
      
      This CL also fixes a small bug where if the minimum fraction digits is above 3 but the maximum fraction digits isn't set, then it returns with only three numbers after the decimal point.
      
      BUG=435465,473104,304722
      LOG=Y
      
      Review URL: https://codereview.chromium.org/1231613006
      
      Cr-Commit-Position: refs/heads/master@{#29734}
      ddb5c2d9
  33. 15 Jul, 2015 1 commit
  34. 24 Jun, 2015 1 commit
    • arv's avatar
      i18n.js was not using original functions · 51073d5f
      arv authored
      The i18n.js code was calling a lot of methods, which might have been
      removed or replaced by user code.
      
      Make sure we use the original functions.
      
      BUG=v8:4220
      LOG=N
      R=adamk, littledan
      CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel
      
      Review URL: https://codereview.chromium.org/1199813004
      
      Cr-Commit-Position: refs/heads/master@{#29268}
      51073d5f
  35. 26 May, 2015 1 commit
  36. 22 May, 2015 1 commit