1. 31 Jan, 2019 31 commits
  2. 30 Jan, 2019 9 commits
    • Sven Sauleau's avatar
      [wasm] merge js constants file in module-builder · 5bdb1329
      Sven Sauleau authored
      We noticed that almost every call site were loading both files,
      the split isn't necessary anymore.
      
      In some message tests, removed the absolute line number to allow future
      changes.
      
      Bug: v8:8726
      Change-Id: I8527f0a1ecfa685aa01a5e2f5f47ddf1cb13a545
      Reviewed-on: https://chromium-review.googlesource.com/c/1446452
      Commit-Queue: Sven Sauleau <ssauleau@igalia.com>
      Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#59220}
      5bdb1329
    • Jakob Gruber's avatar
      [builtins] Remove canonicalization during serialization · 9592b043
      Jakob Gruber authored
      Now that we generate the embedded blob and off-heap trampolines
      directly after builtin generation, the heap should not contain any
      remaining references to full on-heap builtin Code objects.
      
      The one exception is the interpreter entry trampoline copy for
      profiling. This mechanism was actually broken by canonicalization; we
      intended to store a full copy of the IET on the root list, but
      serialization replaced it with the canonicalized builtin. This CL
      fixes that as a side-effect.
      
      Bug: v8:8716
      Change-Id: Ib37c4004560d67de46b1f8ebe75156361134f57d
      Reviewed-on: https://chromium-review.googlesource.com/c/1421037
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#59219}
      9592b043
    • Junliang Yan's avatar
      PPC/s390: Explicitly store the code layout in CodeDesc · ba75052e
      Junliang Yan authored
      Port ad3546ab
      
      Original Commit Message:
      
          This is an initial step towards clarifying the layout of the
          instruction area. As follow-ups, we should remove additional
          safepoint and handler table offset parameters, and perhaps alter
          Code::safepoint_table_offset (handler_table) semantics to always
          contain a real offset and avoid the magic 0 signifying nonexistent
          tables.
      
      R=jgruber@chromium.org, joransiu@ca.ibm.com, michael_dawson@ca.ibm.com
      BUG=
      LOG=N
      
      Change-Id: I6c2d3244710f8f3f33bcceb3988e19547f55fba0
      Reviewed-on: https://chromium-review.googlesource.com/c/1446138Reviewed-by: 's avatarMilad Farazmand <miladfar@ca.ibm.com>
      Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
      Cr-Commit-Position: refs/heads/master@{#59218}
      ba75052e
    • Igor Sheludko's avatar
      [cleanup][x32] Remove x32 leftovers from x64 assembler, pt.1 · 0243ba80
      Igor Sheludko authored
      addp, andp, cmpp, decp, incp, leap, negp, orp, subp, testp, xorp,
      shrp, sarp, shlp are replaced with respective quad-word instructions.
      
      Some wrongly-used xxxp instructions in regexp code are replaced with xxxl.
      
      Bug: v8:8621, v8:8562
      Change-Id: If5fe3229a35805b8ef84d3e1ffa05cf9ed91ceef
      Reviewed-on: https://chromium-review.googlesource.com/c/1446451Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Commit-Queue: Igor Sheludko <ishell@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#59217}
      0243ba80
    • Clemens Hammacher's avatar
      [wasm] Do not pass the error to callbacks · d928d25c
      Clemens Hammacher authored
      Instead of passing the error explicitly, make the callbacks get the
      error from the CompilationState. This prepares a change to call the
      callbacks asynchronously, because from the background we cannot
      construct the final error message (because this requires access to the
      wire bytes). Thus the callbacks will have to get the actual compile
      error from the CompilationState from a foreground task if they need it.
      
      R=mstarzinger@chromium.org
      
      Bug: v8:8689
      Change-Id: I22accabf895bf21fa7492e2f5cb8bac93237c765
      Reviewed-on: https://chromium-review.googlesource.com/c/1445975
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#59216}
      d928d25c
    • Takuto Ikuta's avatar
      Split torque generated files for faster build · be8c9e73
      Takuto Ikuta authored
      By using different namespace, generated code split into different files.
      
      By this CL, build time of torque_generated_initializers is improved from 80 seconds to 40 seconds on Z840 Linux measured by following command:
      
      # Remove generated code to re-compile all generated files.
      ~/v8/v8$ rm -rf out/x64.release/gen/
      # GOMA_STORE_ONLY=true disables goma's backend cache.
      ~/v8/v8$ time GOMA_STORE_ONLY=true autoninja -C out/x64.release/ torque_generated_initializers
      
      Bug: v8:8732
      Change-Id: I64545f9994aea7e4209ac3852aadf4e2e9f4bc93
      Reviewed-on: https://chromium-review.googlesource.com/c/1446331Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#59215}
      be8c9e73
    • Benedikt Meurer's avatar
      [runtime] Better instance pre-sizing with transpiled classes. · 4b9eb7f7
      Benedikt Meurer authored
      For instances created via constructors and `new` we try to pre-size
      the instances such that ideally all the data properties can be
      allocated as in-object properties (and we don't need to allocate the
      out-of-object PropertyArray backing store). This is accomplished with
      the helper of the Parser, which counts the property assignments to
      `this` in the constructor, and we use that as the starting point for
      pre-sizing logic (a mechanism called *slack tracking* is used to
      dynamically shrink the objects based on the real memory usage, and
      eventually compute the final starting size for instances of the
      individual constructors).
      
      This works well even with class hierarchies, since for a derived class
      constructor we just include the current constructor plus all the base
      constructors. I.e. with
      
      ```js
      class A {
        constructor() {
          this.x00 = null;
          this.x01 = null;
          this.x02 = null;
          this.x03 = null;
          this.x04 = null;
          this.x05 = null;
          this.x06 = null;
          this.x07 = null;
          this.x08 = null;
          this.x09 = null;
          this.x10 = null;
          this.x11 = null;
          this.x12 = null;
          this.x13 = null;
          this.x14 = null;
          this.x15 = null;
          this.x16 = null;
          this.x17 = null;
          this.x18 = null;
          this.x19 = null;
        }
      }
      
      class B extends A {
        constructor() {
          super();
        }
      }
      ```
      
      we will eventually learn that instances of `B` need 20 in-object
      properties. However this breaks with transpiled code (i.e. as
      generated via TypeScript or Babel), even when the constructors are
      properly chained.
      
      ```js
      function A() {
        this.x00 = null;
        this.x01 = null;
        this.x02 = null;
        this.x03 = null;
        this.x04 = null;
        this.x05 = null;
        this.x06 = null;
        this.x07 = null;
        this.x08 = null;
        this.x09 = null;
        this.x10 = null;
        this.x11 = null;
        this.x12 = null;
        this.x13 = null;
        this.x14 = null;
        this.x15 = null;
        this.x16 = null;
        this.x17 = null;
        this.x18 = null;
        this.x19 = null;
      }
      
      function B() {
        A.call(this);
      }
      Object.setPrototypeOf(B, A);
      ```
      
      Here we will always have 10 in-object properties for instances of
      `B` (due to the generic over-allocation logic), and the other 10
      properties have to be allocated in the out-of-object PropertyArray.
      
      This is unfortunate and actually not necessary. Instead we could just
      do the same [[Prototype]] walk on the constructor for regular function
      constructors that we perform for derived (native) class constructors.
      This CL changes that, such that we give the same treatment to transpiled
      class that we have for native classes.
      
      R=verwaest@chromium.org
      
      Bug: v8:8764, v8:8765
      Doc: https://bit.ly/v8-instance-presizing-with-transpiled-classes
      Change-Id: Iac54391e41c9a39101751a678b3a647269fb009d
      Reviewed-on: https://chromium-review.googlesource.com/c/1442643
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#59214}
      4b9eb7f7
    • Sven Sauleau's avatar
      [wasm] js module-builder and constants improvements · 3c3233e6
      Sven Sauleau authored
      Changes made to the Wasm module builder:
      - Create emit_u64v for emitting a LEB128 that conceptually represent
      an 64-bits integer.
      - Differentiate toBuffer and toUint8Array for returning respectively
      ArrayBuffer and a Uint8Array.
      - Moved wasmF32Const and wasmF64Const functions because we can take
      advantage of the existing cached conversion buffers. Also, declaring
      them in the constants file will collide with the module-builder since
      they are loaded in the same scope.
      - The byte_view buffer (used by some conversions to bytes) switched from
      Int8Array to Uint8Array.
      
      Changes made to the Wasm contants:
      - Add a new kSharedHasMaximumFlag flag for shared memory with a maximum
      value.
      
      Bug: v8:8726
      Change-Id: If16c59896cfa1d42008da413e2e144b73a0fa5ce
      Reviewed-on: https://chromium-review.googlesource.com/c/1443062Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Commit-Queue: Sven Sauleau <ssauleau@igalia.com>
      Cr-Commit-Position: refs/heads/master@{#59213}
      3c3233e6
    • Michael Starzinger's avatar
      [wasm] Fix interpreter exception stack height change. · 866d43e6
      Michael Starzinger authored
      This fixes how the interpreter modifies the operand stack in the case
      calls with non-zero parameter or return count throw an exception. The
      interpreter raises the exception before arguments are popped and before
      results are pushed onto the stack. This makes the control transfer
      analysis fit this model. It also makes the tests trigger this aspect.
      
      R=clemensh@chromium.org
      TEST=cctest/test-run-wasm-exceptions
      BUG=v8:8091
      
      Change-Id: I001fc4bc0030393d3c97be3fa9425bc540575071
      Reviewed-on: https://chromium-review.googlesource.com/c/1445972
      Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
      Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#59212}
      866d43e6