Commit Graph

245 Commits

Author SHA1 Message Date
hpayer@chromium.org
fbaf016b6d Add a soft-deopt in keyed element access when current IC is pre-monomorphic and no type feedback was collected.
BUG=
R=danno@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17335 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-10-23 10:41:21 +00:00
bmeurer@chromium.org
ef12527b7c Revert "Add a soft-deopt in keyed element access when current IC is pre-monomorphic and no type feedback was collected."
This reverts commit r17288 for breaking the mjsunit/unbox-double-arrays
test on almost every platform.

TBR=hpayer@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17289 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-10-21 12:32:38 +00:00
hpayer@chromium.org
9667e1b30f Add a soft-deopt in keyed element access when current IC is pre-monomorphic and no type feedback was collected.
BUG=
R=danno@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17288 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-10-21 12:10:01 +00:00
rossberg@chromium.org
9fadd29544 Fix initial comparison combined_type
R=jkummerow@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17195 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-10-14 13:25:36 +00:00
rossberg@chromium.org
c806a2385d Unify handling of position info in AST, part 3
* Turn CaseClause into a proper AstNode

R=yangguo@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17187 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-10-14 11:06:15 +00:00
rossberg@chromium.org
19d716989e Unify handling of position info in AST, part 1
* AstNode now has a position info.
* Removed various ad-hoc position infos from subclasses (most of which had it).
* Position is always set with the constructor, instead of later.
* Take care to use kNoPosition in the right spots, to not crash the debugger.

Still to do:

* Eliminate Conditional::then/else_position and WhileStatement::condition_position.
* Make CaseClause a proper AstNode and eliminate its custom position.
* If possible, eliminate all uses of kNoPosition.

R=yangguo@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17183 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-10-14 09:24:58 +00:00
mstarzinger@chromium.org
6ab8977e73 Remove dead IsEqualString and IsEqualNumber method.
R=hpayer@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17160 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-10-11 13:40:08 +00:00
mstarzinger@chromium.org
b9b528e030 Defer allocation of native function literals.
R=dcarney@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17038 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-10-01 09:47:37 +00:00
jkummerow@chromium.org
85ae341b09 Revert "Defer allocation of native function literals."
This reverts r17017 for breaking LayoutTests.

R=mstarzinger@chromium.org
TBR=mstarzinger@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17024 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-09-30 17:42:58 +00:00
mstarzinger@chromium.org
c624141bf3 Defer allocation of native function literals.
R=dcarney@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17017 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-09-30 14:49:11 +00:00
verwaest@chromium.org
ea77a8edc0 Use regular map-checks to guard string-length loading.
R=ulan@chromium.org

Review URL: https://chromiumcodereview.appspot.com/23702039

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16709 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-09-13 09:57:48 +00:00
dcarney@chromium.org
47e86b889e Get rid of most uses of 'Temporary macro' HEAP
R=svenpanne@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16622 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-09-10 14:30:36 +00:00
verwaest@chromium.org
18f6577bad Properly filter types using the initial map from HAllocate.
R=mstarzinger@chromium.org

Review URL: https://chromiumcodereview.appspot.com/23615012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16572 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-09-06 11:32:46 +00:00
loislo@chromium.org
bbd26abedb Functions may not be optimized and we would like to know in cpu profiler what was the reason.
Current v8 implementation may disable optimization for a particular function or block it with help of dont_optimize flag.
The patch propagates the reason of that to the SharedFunctionInfo where cpu profiler can get it.

SharedFunctionInfo is a heap object so I extracted 8 bits from OptsCount for handling bailout reason code.

BUG=none
TEST=test-profile-generator/BailoutReason
R=yangguo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16555 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-09-05 13:20:51 +00:00
dcarney@chromium.org
f4e16f24ec remove Isolate::Current from most files starting with 'a'
R=svenpanne@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16463 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-09-02 09:27:27 +00:00
jkummerow@chromium.org
9efb5cd23b Make VisitStatements() consistent among all AstVisitor implementations
R=yangguo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16443 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-30 10:51:37 +00:00
bmeurer@chromium.org
17ec357ac7 Fix crash due RegExpAtom method called on RegExpCharacterClass object.
In the RegExpUnparser::VisitText(RegExpText* that, void* data) function always RegExpUnparser::VisitAtom function called via that->elements()->at(i).data.u_atom->Accept(this, data); even if the type of the object is RegExpCharacterClass.

The problem shows using g++ 4.7(.2, .3) since r16232, since GCC optimizes virtual method calls to direct calls based on __final/final hints. Tested on MIPS and x64:
Program received signal SIGSEGV, Segmentation fault.
0x0000000000588928 in v8::internal::RegExpUnparser::VisitAtom(v8::internal::RegExpAtom*, void*) ()

This cleans up the TextElement class to avoid the unsafe+unchecked union access, that caused the crash.

TEST=cctest/test-regexp/ParserRegression
R=jkummerow@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16289 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-23 11:06:16 +00:00
bmeurer@chromium.org
c2c6b2813d Reland "Use V8_FINAL and V8_OVERRIDE in various places, fixing bugs revealed by them.".
- Use V8_FINAL and V8_OVERRIDE in Ast classes.
- Use V8_FINAL and V8_OVERRIDE in Lithium mips backend.
- Use V8_FINAL and V8_OVERRIDE in Lithium arm backend.
- Use V8_FINAL and V8_OVERRIDE in Lithium x64 backend.
- Use V8_FINAL and V8_OVERRIDE in Lithium ia32 backend.
- Use V8_FINAL and V8_OVERRIDE in Lithium classes.
- Use V8_FINAL and V8_OVERRIDE in Hydrogen classes.

TBR=dslomov@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16244 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-20 11:10:24 +00:00
bmeurer@chromium.org
60e7d4b1e3 Revert "Use V8_FINAL and V8_OVERRIDE in various places, fixing bugs revealed by them."
This reverts commit r16232 for breaking the
tools/gen-postmortem-metadata.py script. Will reland without the
objects.{cc,h} changes.

TBR=svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16243 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-20 10:52:23 +00:00
bmeurer@chromium.org
9929a9cd12 Use V8_FINAL and V8_OVERRIDE in various places, fixing bugs revealed by them.
- Use V8_FINAL and V8_OVERRIDE in objects.
- Use V8_FINAL and V8_OVERRIDE in Ast classes.
- Use V8_FINAL and V8_OVERRIDE in Lithium mips backend.
- Use V8_FINAL and V8_OVERRIDE in Lithium arm backend.
- Use V8_FINAL and V8_OVERRIDE in Lithium x64 backend.
- Use V8_FINAL and V8_OVERRIDE in Lithium ia32 backend.
- Use V8_FINAL and V8_OVERRIDE in Lithium classes.
- Use V8_FINAL and V8_OVERRIDE in Hydrogen classes.

R=dslomov@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16232 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-20 07:27:06 +00:00
jkummerow@chromium.org
b3b99969b0 Fix overwriting order of object literal properties for MATERIALIZED_LITERALs
R=mstarzinger@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16179 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-13 17:27:58 +00:00
svenpanne@chromium.org
bc6fe88030 Desugar bitwise negation into XOR and kill all UnaryOp stuff.
R=mstarzinger@chromium.org, verwaest@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16073 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-06 13:34:51 +00:00
svenpanne@chromium.org
d5b9616991 Clean some unuse code of unary negation
R=svenpanne@chromium.org

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

Patch from Weiliang Lin <weiliang.lin2@gmail.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16036 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-05 06:34:26 +00:00
verwaest@chromium.org
6b83c868f0 Convert CONSTANT_FUNCTION to CONSTANT
R=yangguo@chromium.org

Review URL: https://chromiumcodereview.appspot.com/19485008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15858 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-24 12:34:50 +00:00
jkummerow@chromium.org
9ed1fe1ac4 Better fix for LiteralCompareTypeof
This reverts r15725 and replaces it with the following one-liner
in hydrogen.cc's HandleLiteralCompareTypeof:

-  CHECK_ALIVE(VisitForValue(sub_expr));
+  CHECK_ALIVE(VisitForTypeOf(sub_expr));

R=danno@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15728 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-17 15:58:59 +00:00
jkummerow@chromium.org
f5cae51e20 Fix LiteralCompareTypeof breakage introduced in r15723
R=danno@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15725 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-17 14:58:00 +00:00
olivf@chromium.org
d75b34db33 There is no undefined Literal.
BUG=
R=rossberg@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15724 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-17 14:10:38 +00:00
verwaest@chromium.org
a9fd01d567 - Makes a common superclass for Load and Store stub compiler.
- Splits all non-normal Store ICs into handler and IC.
- Ensures monomorphic store ICs go polymorphic.
- Feeds polymorphic type feedback into count operation.

R=ulan@chromium.org

Review URL: https://chromiumcodereview.appspot.com/14142005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15566 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-09 08:22:41 +00:00
mvstanton@chromium.org
23695eb86e Rename AllocationSite::payload to AllocationSite::transition_info
BUG=
R=hpayer@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15556 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-08 15:00:12 +00:00
mvstanton@chromium.org
67d9051bcd Create AllocationSite objects, pointed to by AllocationSiteInfo.
This creates a platform where we can do additional things with allocation sites,
other than just aid in reducing array transitions.

BUG=
R=hpayer@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15545 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-08 10:02:16 +00:00
danno@chromium.org
345cc98a25 Generate StoreGlobal stubs with Hydrogen
- Constants globals are inlined into Hydrogen code using code dependencies that invalidate the Crankshafted code when global PropertyCells or the global object change.
- The more general case generates code that is just as good as the hand-written assembly stubs on all platforms.

R=rossberg@chromium.org, ulan@chromium.org

Committed: http://code.google.com/p/v8/source/detail?r=15419

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15512 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-05 10:34:02 +00:00
danno@chromium.org
77c20c30a3 Revert r15419: "Generate StoreGlobal stubs with Hydrogen"
TBR=mstarzinger@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15427 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-01 15:12:21 +00:00
danno@chromium.org
a3bce19868 Generate StoreGlobal stubs with Hydrogen
- Constants globals are inlined into Hydrogen code using code dependencies that invalidate the Crankshafted code when global PropertyCells or the global object change.
- The more general case generates code that is just as good as the hand-written assembly stubs on all platforms.

R=ulan@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15419 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-01 13:22:13 +00:00
olivf@chromium.org
eac9b2191b Fix to_boolean type feedback for unary and binary ops
BUG=
R=jkummerow@chromium.org, rossberg@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15319 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-25 11:49:46 +00:00
rossberg@chromium.org
007837365d Rename Literal::handle to Literal::value
Just a completely mechanical change...

R=svenpanne@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15280 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-24 10:37:59 +00:00
rossberg@chromium.org
0977c60984 Use AST's type field and merge types for unary, binary & compare ICs
R=jkummerow@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15264 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-21 11:10:06 +00:00
verwaest@chromium.org
b17e759dc1 Add soft-deopt for uninitialized assignment
R=hpayer@google.com

Review URL: https://chromiumcodereview.appspot.com/17071002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15241 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-20 13:09:43 +00:00
jkummerow@chromium.org
47ba2b2dd8 Migrate BinaryOpICs and UnaryOpICs to new type rep
R=rossberg@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15172 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-14 17:02:39 +00:00
rossberg@chromium.org
94f651bc1b Migrate Compare ICs to new type rep
(Does not yet use common AST expression type field.)

R=jkummerow@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15093 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-12 17:20:37 +00:00
danno@chromium.org
1b89cbf817 Separate Cell and PropertyCell spaces
This makes it possible to store additional information on property cells, for example Type and optimized Code dependencies.

R=mstarzinger@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15089 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-12 15:03:44 +00:00
mvstanton@chromium.org
1fc6065b38 CallNewArray sites need the original feedback cell at crankshaft time.
This CL addresses a TODO in the hydrogen-based array constructor code,
to pass through the actual type feedback cell, rather than the contents
of the cell.

BUG=
R=danno@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15004 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-07 13:21:20 +00:00
wingo@igalia.com
cb0d146862 Add initial parser support for harmony iteration
This commit adds initial parser support for harmony iteration.
Specifically, it will parse:

  for (x of y) {}
  for (let x of y) {}
  for (var x of y) {}

The semantics are still unimplemented.

TEST=mjsunit/harmony/for-of-syntax
BUG=v8:2214
R=rossberg@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14984 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-06 14:38:26 +00:00
rossberg@chromium.org
919d64adce Add type field to AST expression nodes
More importantly, do a bunch of renamings of incidental existing "types" to avoid actual and potential name clashes (and also to improve consistency).

R=svenpanne@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14978 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-06 13:28:22 +00:00
mstarzinger@chromium.org
f8db2414f2 Deprecate FACTORY helper macro.
This removes the FACTORY helper macro to avoid accidental TLS access
when using the factory. Most internal code has access to the Isolate by
now whereas tests which are not performance critical still heavily use
TLS access through explicit Isolate::Current() calls.

R=svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14931 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-04 10:30:05 +00:00
svenpanne@chromium.org
b9e025a8dc Collect type feedback for power-of-2 right operands in BinaryOps.
Improved --trace-ic output for unary/binary ops a bit on the way. Moved int32_t/uint32_t conversion helpers around.

R=jkummerow@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14928 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-06-04 07:49:45 +00:00
rossberg@chromium.org
6fda4e4c28 Collect type feedback in separate pass and store it in AST
Notes:

- For now, just adds the missing type info fields to the AST nodes directly.
  I'd like to factor that out more nicely in a follow-up CL.

- All type feedback now is uniformly collected through AST nodes'
  RecordTypeFeedback functions. At some point, this logic should be moved
  out of ast.cc.

- The typing pass currently simulates the exact same conditions under
  which feedback was collected in Hydrogen before. That also should be
  made more generic in the future.

- Type information itself is unchanged. Making it more regular is
  yet more future work.

Some additional cleanups:

- Lifted out nested class ObjectLiteral::Property, to enable forward declaration.
- Moved around some auxiliary enums.

R=svenpanne@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14825 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-05-27 13:59:20 +00:00
danno@chromium.org
f8ddf3a262 Add monomorphic CompareNilICs and Crankshaft support
R=mvstanton@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14407 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-24 11:32:17 +00:00
danno@chromium.org
bc04544f02 Replace math.h with cmath
This will make it easier to use other STL headers in the future

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

Patch from Jochen Eisinger <jochen@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14352 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-19 13:26:47 +00:00
verwaest@chromium.org
79d18ea332 Let ComputeTarget fail if it skips over NORMAL objects.
BUG=v8:2595

Review URL: https://chromiumcodereview.appspot.com/13862008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14190 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-09 16:38:51 +00:00
mstarzinger@chromium.org
2816f19680 Add parser support for generators.
This patchset begins by adding support for "yield", which is unlike other tokens
in JS. In a generator, whether strict or classic, it is a syntactic keyword.
In classic mode it is an identifier. In strict mode it is reserved.

This patch adds YIELD as a token to the scanner, and adapts the preparser and
parser appropriately. It also parses "function*", indicating that a function is
actually a generator, for both eagerly and lazily parsed functions.

Currently "yield" just compiles as "return".

BUG=v8:2355
TEST=mjsunit/harmony/generators-parsing

Review URL: https://codereview.chromium.org/12646003
Patch from Andy Wingo <wingo@igalia.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14116 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-02 17:34:59 +00:00