Commit Graph

9134 Commits

Author SHA1 Message Date
littledan
31b8018029 Revert of Add a separate scope for switch (patchset #7 id:120001 of https://codereview.chromium.org/1293283002/ )
Reason for revert:
Breaks cctest/test-cpu-profiler/SourceLocation on nosnap

Original issue's description:
> Add a separate scope for switch
>
> The ES2015 specification for switch statements 13.12.11 specifies that
> they get their own lexical scope. This patch introduces such a scope
> through a complex desugaring in terms of blocks, done so that Crankshaft
> does not have to be updated to support multiple constructs providing
> scopes.
>
> BUG=v8:4377
> LOG=Y
> R=adamk
>
> Committed: https://crrev.com/9edbc1f21eb1050cabbe3b8bc9aebf89ada7ebd7
> Cr-Commit-Position: refs/heads/master@{#30314}

TBR=adamk@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:4377

Review URL: https://codereview.chromium.org/1309043004

Cr-Commit-Position: refs/heads/master@{#30316}
2015-08-22 01:24:33 +00:00
littledan
9c79e69e6c Fix function scoping issue
The parser has special behavior with respect to the bindings
of inner functions in sloppy mode which are not at the top
level of scopes. This behavior should be turned off when the
--harmony-sloppy-function flag is set, as lexical scoping
rules are used instead. Previously, the incorrect flag
--harmony-sloppy was used, resulting in a crashing bug.

BUG=chromium:520029
LOG=Y
R=adamk

Review URL: https://codereview.chromium.org/1303033003

Cr-Commit-Position: refs/heads/master@{#30315}
2015-08-22 00:18:23 +00:00
littledan
9edbc1f21e Add a separate scope for switch
The ES2015 specification for switch statements 13.12.11 specifies that
they get their own lexical scope. This patch introduces such a scope
through a complex desugaring in terms of blocks, done so that Crankshaft
does not have to be updated to support multiple constructs providing
scopes.

BUG=v8:4377
LOG=Y
R=adamk

Review URL: https://codereview.chromium.org/1293283002

Cr-Commit-Position: refs/heads/master@{#30314}
2015-08-21 23:54:36 +00:00
binji
b7cf73271d Signal a blocked futex if the isolate is interrupted; don't busy-wait
FutexEmulation::Wait can potentially block forever on a condition variable. We
want to allow this to be interrupted (for a debugger, or to terminate the
thread, for example).

The previous implementation would periodically wake up the waiter to check for
interrupts. This CL modifies the StackGuard so it wakes the blocked futex if
the thread should be interrupted.

BUG=chromium:497295
R=jarin@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1230303005

Cr-Commit-Position: refs/heads/master@{#30311}
2015-08-21 16:42:02 +00:00
mstarzinger
ef2fd24e9f Deprecate semi-correct CompilationInfo::flags predicate.
R=titzer@chromium.org

Review URL: https://codereview.chromium.org/1304053004

Cr-Commit-Position: refs/heads/master@{#30308}
2015-08-21 15:10:55 +00:00
mlippautz
477f5a81f0 [heap,cctest] Get rid of protected-for-sake-of-testing scope.
BUG=

Review URL: https://codereview.chromium.org/1293283003

Cr-Commit-Position: refs/heads/master@{#30301}
2015-08-21 12:40:33 +00:00
hpayer
43f3303838 Record slots in large objects.
BUG=

Review URL: https://codereview.chromium.org/1296713007

Cr-Commit-Position: refs/heads/master@{#30299}
2015-08-21 11:41:52 +00:00
wingo
9271b0ccf9 Parse arrow functions at proper precedence level
BUG=v8:4211
LOG=Y
R=rossberg@chromium.org

Review URL: https://codereview.chromium.org/1286383005

Cr-Commit-Position: refs/heads/master@{#30298}
2015-08-21 11:33:42 +00:00
rossberg
365fd7bc35 [es6] Parameter scopes for sloppy eval
This CL is a nightmare! For the utterly irrelevant edge case of a sloppy function with non-simple parameters and a call to direct eval, like here,

  let x = 1;
  function f(g = () => x) {
    var y
    eval("var x = 2")
    return g() + x  // f() = 3
  }

we have to do all of the following, on top of the declaration block ("varblock") contexts we already introduce around the body:

- Introduce the ability for varblock contexts to have both a ScopeInfo and an extension object (e.g., the body varblock in the example will contain both a static var y and a dynamic var x). No other scope needs that. Since there are no context slots left, a special new struct is introduced that pairs up scope info and extension object.

- When declaring lookup slots in the runtime, this new struct is allocated in the case where an extension object has to be added to a block scope (at which point the block's extension slot still contains a plain ScopeInfo).

- While at it, introduce some abstraction to access context extension slots in a more controlled manner, in order to keep special-casing to a minimum.

- Make sure that even empty varblock contexts do not get optimised away when they contain a sloppy eval, so that they can host the potential extension object.

- Extend dynamic search for declaration contexts (used by sloppy direct eval) to recognize varblock contexts.

- In the parser, if a function has a sloppy direct eval, introduce an additional varblock scope around each non-simple (desugared) parameter, as required by the spec to contain possible dynamic var bindings.

- In the pattern rewriter, add the ability to hoist the named variables the pattern declares to an outer scope. That is required because the actual destructuring has to be evaluated inside the protecting varblock scope, but the bindings that the desugaring introduces are in the outer scope.

- ScopeInfos need to save the information whether a block is a varblock, to make sloppy eval calls work correctly that deserialise them as part of the scope chain.

- Add the ability to materialize block scopes with extension objects in the debugger. Likewise, enable setting extension variables in block scopes via the debugger interface.

- While at it, refactor and unify some respective code in the debugger.

Sorry, this CL is large. I could try to split it up, but everything is rather entangled.

@mstarzinger: Please review the changes to contexts.
@yangguo: Please have a look at the debugger stuff.

R=littledan@chromium.org, mstarzinger@chromium.org, yangguo@chromium.org
BUG=v8:811,v8:2160
LOG=N

Review URL: https://codereview.chromium.org/1292753007

Cr-Commit-Position: refs/heads/master@{#30295}
2015-08-21 10:58:47 +00:00
rossberg
a60f19220a [simd] Introduce SIMD types (as classes)
- Introduce a proper bit for SIMD primitive values.
- Introduce constructors for individual SIMD types. These are currently just classes, which seems good enough for now, given that we always have exactly one global map per SIMD type.

The only problem with using class types for SIMD is that a SIMD constant won't be a subtype of its specific type, only of the general SIMD type. But until we actually introduce SIMD constants into the compiler that shouldn't matter.

R=jarin@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1303863002

Cr-Commit-Position: refs/heads/master@{#30294}
2015-08-21 10:49:39 +00:00
mlippautz
7a21a70c4e [heap] Thread through GC flags in memory reducer and incremental marking.
BUG=chromium:520607
LOG=N

Review URL: https://codereview.chromium.org/1302273002

Cr-Commit-Position: refs/heads/master@{#30287}
2015-08-21 10:05:35 +00:00
wingo
bb43d6c032 Fix parsing of arrow function formal parameters
Not all parenthesized AssignmentExpressions whose components are valid
binding patterns are valid arrow function formal parameters.  In
particular (a,b,c)() is not valid, and in general the existing code
wasn't catching the tail productions of ConditionalExpression,
BinaryExpression, PostfixExpression, LeftHandSideExpression,
and MemberExpression.

Thanks to Adrian Perez for the test case.

BUG=v8:4211
LOG=Y
R=rossberg@chromium.org

Review URL: https://codereview.chromium.org/1306583002

Cr-Commit-Position: refs/heads/master@{#30286}
2015-08-21 09:29:08 +00:00
yangguo
4c5efa9961 Introduce SharedFunctionInfo::Iterator and Script::Iterator.
R=mvstanton@chromium.org

Review URL: https://codereview.chromium.org/1300333003

Cr-Commit-Position: refs/heads/master@{#30283}
2015-08-21 08:12:27 +00:00
mlippautz
a56f537381 [heap] Cleanup and fix GC flags
GC flags are now part of the {Heap} and should be respected by all
sub-components.

Also add a infrastructure to write tests accessing private methods.

Review URL: https://codereview.chromium.org/1301183002

Cr-Commit-Position: refs/heads/master@{#30281}
2015-08-21 07:09:19 +00:00
yangguo
a683f83dec Fix bug in Code::VerifyRecompiledCode.
The code should do what the comment says :)

R=mstarzinger@chromium.org
BUG=chromium:522895
LOG=N

Review URL: https://codereview.chromium.org/1300363002

Cr-Commit-Position: refs/heads/master@{#30278}
2015-08-20 17:20:02 +00:00
mstarzinger
1a3c7e2fb1 [heap] Hide GCTracer inside the heap component.
This prevents leakage of the gc-tracer.h declarations inside of the
heap and prevents it from being exposed to the world. Protects private
state from being inadvertently mocked with.

R=mlippautz@chromium.org

Review URL: https://codereview.chromium.org/1294763004

Cr-Commit-Position: refs/heads/master@{#30276}
2015-08-20 15:48:12 +00:00
cbruni
6d67f7db37 Revert of Moving ArraySplice Builtin to ElementsAccessor (patchset #6 id:100001 of https://codereview.chromium.org/1293683005/ )
Reason for revert:
failing bot http://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/builds/3827

Original issue's description:
> - remove the Backing-Store speficic code from builtins.cc and put it in elements.cc.
> - adding tests to improve coverage of the splice method
>
> BUG=
>
> Committed: https://crrev.com/8533d4b5433d3a9e9fb1015f206997bd6d869fe3
> Cr-Commit-Position: refs/heads/master@{#30269}

TBR=mvstanton@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/1305763002

Cr-Commit-Position: refs/heads/master@{#30271}
2015-08-20 13:51:15 +00:00
cbruni
8533d4b543 - remove the Backing-Store speficic code from builtins.cc and put it in elements.cc.
- adding tests to improve coverage of the splice method

BUG=

Review URL: https://codereview.chromium.org/1293683005

Cr-Commit-Position: refs/heads/master@{#30269}
2015-08-20 12:55:05 +00:00
mstarzinger
98a0fe0f32 Remove grab-bag includes of v8.h from everywhere.
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/1285183010

Cr-Commit-Position: refs/heads/master@{#30263}
2015-08-20 07:44:15 +00:00
domenic
6f582f088a Add experimental, non-snapshotted V8 extras
Embedders would use these for features which must be able to be turned
off at runtime, despite being compiled into V8. They can be turned on
and off by the embedder using the --experimental_extras flag, e.g. via
v8::SetFlagsFromString.

R=yangguo@chromium.org, mlippautz@chromium.org, hpayer@chromium.org
BUG=chromium:507137
LOG=Y

Review URL: https://codereview.chromium.org/1284413002

Cr-Commit-Position: refs/heads/master@{#30260}
2015-08-20 00:01:14 +00:00
adamk
de26ce051f [api] Relax CHECK for ArrayBuffer API abuse
Zero-length ArrayBuffers are allowed to have NULL backing stores.

BUG=522496
LOG=n

Review URL: https://codereview.chromium.org/1302803003

Cr-Commit-Position: refs/heads/master@{#30259}
2015-08-19 21:53:17 +00:00
Ben Smith
14495ba64a Re-enable regress-crbug-501711 and regress-4279 for --isolates tests
BUG=v8:4378
TBR=yangguo@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1305583002 .

Cr-Commit-Position: refs/heads/master@{#30258}
2015-08-19 20:59:59 +00:00
Ben Smith
7d706b6b74 Remove regress-crbug-518748. It's too hard to make this non-flaky
BUG=chromium:518748
R=mstarzinger@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1297403002 .

Cr-Commit-Position: refs/heads/master@{#30257}
2015-08-19 18:58:20 +00:00
Ben Smith
8f441181a5 Disable regress-crbug-518748. It is failing/flaking on many bots
BUG=chromium:518748
TBR=mstarzinger@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1306443002 .

Cr-Commit-Position: refs/heads/master@{#30256}
2015-08-19 17:48:49 +00:00
titzer
ac3e24c96f Rename ParserInfo::function() and CompilationInfo::function() to literal().
R=rossberg@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1301583005

Cr-Commit-Position: refs/heads/master@{#30254}
2015-08-19 16:51:51 +00:00
jarin
bb869374fe Fix variable decl register collision on ARM.
BUG=chromium:455207
LOG=n
R=ulan@chromium.org

Review URL: https://codereview.chromium.org/1040703003

Cr-Commit-Position: refs/heads/master@{#30249}
2015-08-19 12:50:14 +00:00
yangguo
22cf0b5919 Ignore test failure for mjsunit/for-in-opt in gc stress.
TBR=hablich@chromium.org
BUG=v8:4381

Review URL: https://codereview.chromium.org/1295513004

Cr-Commit-Position: refs/heads/master@{#30245}
2015-08-19 10:03:50 +00:00
ejcaruso
df999c9790 Only evaluate length once in %TypedArray%.prototype.set
The ES6 spec for this function declares that ToLength
should only be called once. We were evaluating it multiple
times, so if length was an object with a valueOf method,
we could see effects take place multiple times.

R=littledan@chromium.org
LOG=N
BUG=v8:4218

Review URL: https://codereview.chromium.org/1237583005

Cr-Commit-Position: refs/heads/master@{#30240}
2015-08-19 01:33:06 +00:00
Ben Smith
f644b71e75 Disable regress-crbug-518748 on ARM
BUG=chromium:518748
TBR=mstarzinger@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1290683004 .

Cr-Commit-Position: refs/heads/master@{#30238}
2015-08-18 18:55:58 +00:00
Ben L. Titzer
86439b3ae3 [test] Silence array bounds warning. GCC, I think you are wrong in this case.
TBR=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1295323003 .

Cr-Commit-Position: refs/heads/master@{#30237}
2015-08-18 18:51:34 +00:00
titzer
d0bacc61e6 [turbofan] Fix stack->stack double moves for pushing on ia32 and x64.
R=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1299023002

Cr-Commit-Position: refs/heads/master@{#30235}
2015-08-18 18:22:05 +00:00
Ben Smith
49d1004bfb Disable regress-crbug-518748 on debug
Seems to fail only on V8 Linux - debug - code serializer
(See http://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20debug%20-%20code%20serializer/builds/3762)

BUG=chromium:518748
TBR=mstarzinger@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1294163003 .

Cr-Commit-Position: refs/heads/master@{#30233}
2015-08-18 18:16:29 +00:00
binji
29e441422e [d8 Workers] Add max worker count, throw an exception if too many.
BUG=chromium:518748
R=mstarzinger@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1284683004

Cr-Commit-Position: refs/heads/master@{#30230}
2015-08-18 17:12:17 +00:00
rmcilroy
f36cc258ff [Interpreter] Add implementations for load immediate bytecodes.
Adds implementations and tests for the following bytecodes:
  - LdaZero
  - LdaSmi8
  - LdaUndefined
  - LdaNull
  - LdaTheHole
  - LdaTrue
  - LdaFalse
  - LdaLdar
  - LdaStar

Also adds  Smi tagging / untagging and OperandType typed
BytecodeOperand operations to InterpreterAssembler.

BUG=v8:4280
LOG=N

Review URL: https://codereview.chromium.org/1294793002

Cr-Commit-Position: refs/heads/master@{#30226}
2015-08-18 15:29:39 +00:00
bradnelson
a2462683b7 Allowing optional build of a WASM prototype behind a gyp define.
Place a copy of the v8-native-prototype in third_party/wasm.
GYP_DEFINES='v8_wasm=1' gclient runhooks

BUG=None
TEST=None
R=titzer@chromium.org
LOG=N

Review URL: https://codereview.chromium.org/1294543006

Cr-Commit-Position: refs/heads/master@{#30225}
2015-08-18 15:04:11 +00:00
yangguo
54f18db864 Skip regress-4279 for --isolates tests.
R=hablich@chromium.org
BUG=v8:4378
LOG=N

Review URL: https://codereview.chromium.org/1290383004

Cr-Commit-Position: refs/heads/master@{#30223}
2015-08-18 14:36:13 +00:00
oth
238397c108 [Interpreter] Minimal bytecode generator.
Bytecode generator for local assignment and basic binary operations.

Command-line flag for printing bytecodes.

BUG=v8:4280
LOG=N

Review URL: https://codereview.chromium.org/1294543002

Cr-Commit-Position: refs/heads/master@{#30221}
2015-08-18 13:46:57 +00:00
rmcilroy
00df60d1c6 [interpreter]: Changes to interpreter builtins for accumulator and register file registers.
Makes the following modifications to the interpreter builtins and
InterpreterAssembler:
 - Adds an accumulator register and initializes it to undefined()
 - Adds a register file pointer register and use it instead of FramePointer to
   access registers
 - Modifies builtin to support functions with 0 regiters in the register file
 - Modifies builtin to Call rather than TailCall to first bytecode handler.

BUG=v8:4280
LOG=N

Review URL: https://codereview.chromium.org/1289863003

Cr-Commit-Position: refs/heads/master@{#30219}
2015-08-18 12:41:58 +00:00
yangguo
1ecc6715bb Skip regress-crbug-501711 for --isolates tests.
TBR=hablich@chromium.org
BUG=v8:4378
LOG=N

Review URL: https://codereview.chromium.org/1295813006

Cr-Commit-Position: refs/heads/master@{#30216}
2015-08-18 11:14:43 +00:00
Adam Klein
780fe1873a Point @@isConcatSpreadable test failure line at the correct bug
BUG=v8:4317
LOG=n
TBR=littledan@chromium.org

Review URL: https://codereview.chromium.org/1285983004 .

Cr-Commit-Position: refs/heads/master@{#30207}
2015-08-17 21:47:08 +00:00
titzer
0492bb3291 [turbofan] Support unboxed float and double stack parameters and add tests.
R=jarin@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1291113003

Cr-Commit-Position: refs/heads/master@{#30203}
2015-08-17 17:35:51 +00:00
mstarzinger
26241740bb [heap] Unify MarkingDeque push and unshift operations.
R=hpayer@chromium.org

Review URL: https://codereview.chromium.org/1294093003

Cr-Commit-Position: refs/heads/master@{#30202}
2015-08-17 16:58:28 +00:00
rossberg
6dda11ff81 [es6] Implement default parameters
Based on caitp's https://codereview.chromium.org/1127063003/

R=adamk@chromium.org, littledan@chromium.org
BUG=v8:2160
LOG=N

Review URL: https://codereview.chromium.org/1287063004

Cr-Commit-Position: refs/heads/master@{#30192}
2015-08-17 12:02:08 +00:00
jianghua.yjh
94ee6b1ba2 fix StrDup memory leak in CcTest
BUG=

Review URL: https://codereview.chromium.org/1287023002

Cr-Commit-Position: refs/heads/master@{#30191}
2015-08-17 11:30:40 +00:00
yangguo
d281688ae5 Do not use js builtins object when constructing an error.
R=cbruni@chromium.org

Review URL: https://codereview.chromium.org/1295093002

Cr-Commit-Position: refs/heads/master@{#30189}
2015-08-17 11:02:38 +00:00
chunyang.dai
9fdbc1e25c X87: Realize IWYU pattern for frames-inl.h header.
port 19a49abf02 (r30127).

original commit message:

BUG=

Review URL: https://codereview.chromium.org/1286143009

Cr-Commit-Position: refs/heads/master@{#30185}
2015-08-17 00:40:41 +00:00
caitpotter88
9b15445e6d [parser] make kInvalidLhsInFor a SyntaxError
Second item in section 13.7.5.1 states that the error should be a
SyntaxError, when previously CheckAndRewriteReferenceExpression
would always emit a ReferenceError.

BUG=v8:4373
R=adamk, rossberg
LOG=N
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1292393002

Cr-Commit-Position: refs/heads/master@{#30184}
2015-08-15 17:57:16 +00:00
chunyang.dai
5d0e3b8b94 Add per-file OWNERS for x87-specific cctests.
BUG=

Review URL: https://codereview.chromium.org/1290963005

Cr-Commit-Position: refs/heads/master@{#30182}
2015-08-14 16:02:32 +00:00
vogelheim
c69e2eae54 Rework startup-data-util.
- Make the API look like v8::V8::InitializeICU.
  (That is: A static method call, not an object to be created on the stack.)
- Fix path separator on Windows, by calling base::OS::isPathSeparator.
- Move into API, so that it can be called by hello-world & friends.
- Actually call it from hello-world and friends.

R=jochen@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1292053002

Cr-Commit-Position: refs/heads/master@{#30174}
2015-08-14 12:11:46 +00:00
adamk
092b4317b2 Align PreParser for loop early error-checking with Parser
R=rossberg@chromium.org

Review URL: https://codereview.chromium.org/1290193003

Cr-Commit-Position: refs/heads/master@{#30168}
2015-08-13 19:11:10 +00:00