1. 20 Dec, 2016 5 commits
    • littledan's avatar
      Use a different map to distinguish eval contexts · 53fdf9d1
      littledan authored
      eval() may introduce a scope which needs to be represented as a context at
      runtime, e.g.,
      
        eval('var x; let y; ()=>y')
      
      introduces a variable y which needs to have a context allocated for it. However,
      when traversing upwards to find the declaration context for a variable which leaks,
      as the declaration of x does above, this context has to be understood to not be
      a declaration context in sloppy mode.
      
      This patch makes that distinction by introducing a different map for eval-introduced
      contexts. A dynamic search for the appropriate context will continue past an eval
      context to find the appropriate context. Marking contexts as eval contexts rather
      than function contexts required updates in each compiler backend.
      
      BUG=v8:5295, chromium:648719
      
      Review-Url: https://codereview.chromium.org/2435023002
      Cr-Commit-Position: refs/heads/master@{#41869}
      53fdf9d1
    • titzer's avatar
      [wasm] Implement correct 2-level namespace for imports. · 6e833886
      titzer authored
      R=clemensh@chromium.org
      CC=rossberg@chromium.org
      BUG=chromium:575167
      
      Review-Url: https://codereview.chromium.org/2591753002
      Cr-Commit-Position: refs/heads/master@{#41866}
      6e833886
    • clemensh's avatar
      [wasm] Introduce WasmSharedModuleData and refactor other objects · 081ac370
      clemensh authored
      The new object will hold information which is shared by all clones of a
      WasmCompiledModule, e.g. the decoded asm.js offset table, and in the
      future also breakpoints. From there, we can set them on each new
      instantiation of any clone.
      
      While already changing lots of the code base, I also renamed all
      getters from "get_foo" to "foo", to conform to the style guide.
      
      R=titzer@chromium.org, yangguo@chromium.org
      BUG=v8:5732
      
      Review-Url: https://codereview.chromium.org/2591653002
      Cr-Commit-Position: refs/heads/master@{#41862}
      081ac370
    • yangguo's avatar
      [api] add API for Promise status and result. · 28432588
      yangguo authored
      Currently, to find out a Promise's status and result, one has to use the
      debug context. This is for example done in Node.js. This new API is a
      better replacement, also in the context of the debug context being
      deprecated eventually.
      
      R=franzih@chromium.org, gsathya@chromium.org, jochen@chromium.org
      BUG=v8:5764
      
      Review-Url: https://codereview.chromium.org/2589113002
      Cr-Commit-Position: refs/heads/master@{#41855}
      28432588
    • clemensh's avatar
      [wasm] Cleanup unneeded casts to WasmInstanceObject · fb430215
      clemensh authored
      Plus another minor refactoring.
      
      R=titzer@chromium.org
      
      Review-Url: https://codereview.chromium.org/2590563002
      Cr-Commit-Position: refs/heads/master@{#41853}
      fb430215
  2. 19 Dec, 2016 6 commits
  3. 16 Dec, 2016 4 commits
    • littledan's avatar
      Remove class fields desugaring · 61833f5b
      littledan authored
      This patch removes parser code implementing desugaring for ESnext
      public and private fields on classes. The desugaring should probably
      be implemented in the interpreter instead, and more work needs to go
      into optimization and debugger support. The actual parsing of class
      fields is left in, as the syntax is relatively stable, and there are
      strong cctests for the grammar.
      
      R=marja
      BUG=v8:5367
      
      Review-Url: https://codereview.chromium.org/2578893005
      Cr-Commit-Position: refs/heads/master@{#41776}
      61833f5b
    • gsathya's avatar
      [promisehook] Implement PromiseHook · b1c148b9
      gsathya authored
      This adds kInit, kResolve, kBefore and kAfter lifecycle hooks to promises.
      
      This also exposes an API to set the PromiseHook.
      
      BUG=v8:4643
      
      Review-Url: https://codereview.chromium.org/2575313002
      Cr-Commit-Position: refs/heads/master@{#41775}
      b1c148b9
    • cbruni's avatar
      [runtime] Port simple String.prototype.indexOf cases to TF Builtin · 89f159b0
      cbruni authored
      Many websites use simple calls to String.prototype.indexOf with either a
      one character ASCII needle or needles bigger than the search string. This
      CL adds a TFJ builtin for these simple cases, giving up to factor 5 speedup.
      
      Drive-by-fix: Add default Object type to Arguments.at
      
      BUG=
      
      Review-Url: https://codereview.chromium.org/2539093002
      Cr-Commit-Position: refs/heads/master@{#41760}
      89f159b0
    • mstarzinger's avatar
      Introduce {ConstantElementsPair} struct for type safety. · 92b370ee
      mstarzinger authored
      This introduces an explicit struct for the communication channel between
      the {ArrayLiteral} AST node and the corresponding runtime methods. Those
      methods take a pair of {ElementsKind} as well as an array (can either be
      a FixedArray or a FixedDoubleArray) of constant values.
      
      For bonus points it also reduces the size of the involved heap object by
      one word (i.e. length field of FixedArray not needed anymore).
      
      R=mvstanton@chromium.org
      
      Review-Url: https://codereview.chromium.org/2581683003
      Cr-Commit-Position: refs/heads/master@{#41752}
      92b370ee
  4. 15 Dec, 2016 4 commits
    • jochen's avatar
      Reland of "Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID" · 4f2cb8fe
      jochen authored
      Original CL description:
      > Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID
      >
      > Now that SharedFunctionInfos have a unique ID (and the IDs are dense),
      > we can use them as an index into an array, instead of using a
      > WeakFixedArray where we have to do a linear scan.
      >
      > Hooking up liveedit is a bit more involved, see
      > https://docs.google.com/presentation/d/1FtNa3U7WsF5bPhY9uGoJG5Y9hnz5VBDabfOWpb4unWI/edit
      > for an overview
      >
      > BUG=v8:5589
      > R=verwaest@chromium.org,jgruber@chromium.org
      >
      > Review-Url: https://codereview.chromium.org/2547483002
      
      BUG=v8:5589
      TBR=verwaest@chromium.org,jgruber@chromium.org
      
      Review-Url: https://codereview.chromium.org/2577063002
      Cr-Commit-Position: refs/heads/master@{#41734}
      4f2cb8fe
    • gsathya's avatar
      [promisehook] Store promise in PromiseReactionJob · b4aadaec
      gsathya authored
      This will be used in PromiseHook.
      
      BUG=v8:4643
      
      Review-Url: https://codereview.chromium.org/2581503003
      Cr-Commit-Position: refs/heads/master@{#41730}
      b4aadaec
    • franzih's avatar
      [runtime] Throw if re-declaring a non-configurable accessor. · 0e7a2ca0
      franzih authored
      If an accessor property is non-configurable, one should not be able
      to re-declare it as a function. This specifically applies to special properties like window.location.
      
      BUG=chromium:670596
      
      Review-Url: https://codereview.chromium.org/2582493002
      Cr-Commit-Position: refs/heads/master@{#41725}
      0e7a2ca0
    • ahaas's avatar
      [wasm] Introduce the TrapIf and TrapUnless operators to generate trap code. · 7bd61b60
      ahaas authored
      Some instructions in WebAssembly trap for some inputs, which means that the
      execution is terminated and (at least at the moment) a JavaScript exception is
      thrown. Examples for traps are out-of-bounds memory accesses, or integer
      divisions by zero.
      
      Without the TrapIf and TrapUnless operators trap check in WebAssembly introduces 5
      TurboFan nodes (branch, if_true, if_false, trap-reason constant, trap-position
      constant), in addition to the trap condition itself. Additionally, each
      WebAssembly function has four TurboFan nodes (merge, effect_phi, 2 phis) whose
      number of inputs is linear to the number of trap checks in the function.
      Especially for functions with high numbers of trap checks we observe a
      significant slowdown in compilation time, down to 0.22 MiB/s in the sqlite
      benchmark instead of the average of 3 MiB/s in other benchmarks. By introducing
      a TrapIf common operator only a single node is necessary per trap check, in
      addition to the trap condition. Also the nodes which are shared between trap
      checks (merge, effect_phi, 2 phis) would disappear. First measurements suggest a
      speedup of 30-50% on average.
      
      This CL only implements TrapIf and TrapUnless on x64. The implementation is also
      hidden behind the --wasm-trap-if flag.
      
      Please take a special look at how the source position is transfered from the
      instruction selector to the code generator, and at the context that is used for
      the runtime call.
      
      R=titzer@chromium.org
      
      Review-Url: https://codereview.chromium.org/2562393002
      Cr-Commit-Position: refs/heads/master@{#41720}
      7bd61b60
  5. 14 Dec, 2016 1 commit
  6. 09 Dec, 2016 2 commits
  7. 08 Dec, 2016 5 commits
  8. 07 Dec, 2016 3 commits
    • caitp's avatar
      [ignition] desugar GetIterator() via bytecode rather than via AST · b5f146a0
      caitp authored
      Introduces:
      - a new AST node representing the GetIterator() algorithm in the specification, to be used by ForOfStatement, YieldExpression (in the case of delegating yield*), and the future `for-await-of` loop proposed in http://tc39.github.io/proposal-async-iteration/#sec-async-iterator-value-unwrap-functions.
      - a new opcode (JumpIfJSReceiver), which is useful for `if Type(object) is not Object` checks which are common throughout the specification. This node is easily eliminated by TurboFan.
      
      The AST node is desugared specially in bytecode, rather than manually when building the AST. The benefit of this is that desugaring in the BytecodeGenerator is much simpler and easier to understand than desugaring the AST.
      
      This also reduces parse time very slightly, and allows us to use LoadIC rather than KeyedLoadIC, which seems to have  better baseline performance. This results in a ~20% improvement in test/js-perf-test/Iterators micro-benchmarks, which I believe owes to the use of the slightly faster LoadIC as opposed to the KeyedLoadIC in the baseline case. Both produce identical optimized code via TurboFan when the type check can be eliminated, and the load can be replaced with a constant value.
      
      BUG=v8:4280
      R=bmeurer@chromium.org, rmcilroy@chromium.org, adamk@chromium.org, neis@chromium.org, jarin@chromium.org
      TBR=rossberg@chromium.org
      
      Review-Url: https://codereview.chromium.org/2557593004
      Cr-Commit-Position: refs/heads/master@{#41555}
      b5f146a0
    • henrique.ferreiro's avatar
      Install the 'name' property in classes at runtime · afd5ff55
      henrique.ferreiro authored
      This allows to detect a static property also named 'name', and also makes sure 'name' is added last, to be standards-compliant.
      
      BUG=v8:4199
      
      Review-Url: https://codereview.chromium.org/2423053002
      Cr-Commit-Position: refs/heads/master@{#41546}
      afd5ff55
    • petermarshall's avatar
      [Ignition/turbo] Add a NewWithSpread bytecode. · a25e7688
      petermarshall authored
      This just calls into a runtime function for implementation currently.
      
      Intermediate step in speeding up constructor calls containing a spread.
      
      The NewWithSpread bytecode will probably end up having different arguments with future CLs - the constructor and the new.target should have their own regs. For now we are calling into the runtime function, so we need the regs together.
      
      BUG=v8:5659
      
      Review-Url: https://codereview.chromium.org/2541113004
      Cr-Commit-Position: refs/heads/master@{#41542}
      a25e7688
  9. 06 Dec, 2016 5 commits
  10. 05 Dec, 2016 2 commits
    • gsathya's avatar
      Object · 30b564c7
      gsathya authored
      -- New JSObject for promises: JSPromise
      
      Builtins
      -- PromiseThen TFJ
      -- PromiseCreateAndSet TFJ for internal use
      -- PerformPromiseThen TFJ for internal use
      -- PromiseInit for initial promise setup
      -- SpeciesConstructor for use in PromiseThen
      -- ThrowIfNotJSReceiver for use in SpeciesConstructor
      -- AppendPromiseCallback to update FixedArray with new callback
      -- InternalPerformPromiseThen
      
      Promises.js
      -- Cleanup unused symbols
      -- Remove PerformPromiseThen
      -- Remove PromiseThen
      -- Remove PromiseSet
      -- Remove PromiseAttachCallbacks
      
      Runtime
      -- PromiseSet to set promise inobject values
      -- Refactor functions to use FixedArrays for callbacks instead of
         JSArray
      -- Runtime_PromiseStatus to return promise status
      -- Runtime_PromiseResult to return promise result
      -- Runtime_PromiseDeferred to return deferred attached to promise
      -- Runtime_PromiseRejectReactions to return reject reactions attached
         to promise
      
      This CL results in a 13.07% improvement in the promises benchmark
      (over 5 runs).
      
      BUG=v8:5343
      
      Review-Url: https://codereview.chromium.org/2536463002
      Cr-Commit-Position: refs/heads/master@{#41503}
      30b564c7
    • jgruber's avatar
      [regexp] Migrate constructor and compile to CSA · 28cc20ee
      jgruber authored
      Microbenchmarks show 25% improvement over C++, 11% improvement over JS
      for the constructor. We don't have a microbenchmark covering the compile
      method.
      
      Locally, octane/regexp improved by 2%.
      
      BUG=v8:5339
      
      Review-Url: https://codereview.chromium.org/2551443002
      Cr-Commit-Position: refs/heads/master@{#41490}
      28cc20ee
  11. 01 Dec, 2016 3 commits