Commit Graph

248 Commits

Author SHA1 Message Date
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
dslomov@chromium.org
e357ddc249 Replace ICStub for array.length with hydrogen stub
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14090 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-28 12:43:19 +00:00
danno@chromium.org
ffd0c712e8 Implement many KeyedStoreStubs using Crankshaft
- Addition of a compiled hydrogen stub for KeyedStores.
- Inlining of "grow" stubs into OPTIMIZED_FUNCTIONs
- Addition of new "ignore OOB" ic stub that silently swallows out-of-bounds stores to external typed arrays.
- Addition of new "copy-on-write" ic stub that inlines allocation and copying operations for cow array
- New stub are generated with Crankshaft, so they are automatically inlined into OPTIMIZED_FUNCTIONs

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14001 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-20 10:37:13 +00:00
mstarzinger@chromium.org
6e86d34ba9 Allow inlining of functions containing array literals.
R=jkummerow@chromium.org
BUG=v8:1322
TEST=mjsunit/compiler/inline-literals

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13947 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-14 15:15:37 +00:00
mstarzinger@chromium.org
9aa25ad1a0 Allow inlining of functions containing function literals.
R=yangguo@chromium.org
BUG=v8:1322
TEST=mjsunit/compiler/inline-literals

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13945 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-14 14:29:10 +00:00
mvstanton@chromium.org
c4caf766bf Allocation Info Tracking, continued.
Addresses missing cases for array literals.
Adds support for "new Array()" call sites. This isn't complete yet, I have to run with --noinline_new.

BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13790 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-01 16:06:34 +00:00
rossberg@chromium.org
55f93b5532 Renamed "symbols" to "internalized strings" throughout the code base,
in preparation of the introduction of ES6 'symbols' (aka private/unique names).

The SymbolTable became the StringTable. I also made sure to adapt all comments. The only remaining use of the term "symbol" (other than unrelated uses in the parser and such) is now 'NewSymbol' in the API and the 'V8.KeyedLoadGenericSymbol' counter, changing which might break embedders.

The one functional change in this CL is that I removed the former 'empty_string' constant, since it is redundant given the 'empty_symbol' constant that we also had (and both were used inconsistently).

R=yangguo@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13781 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-28 17:03:34 +00:00
verwaest@chromium.org
b79a927e74 Migrate FunctionPrototype (Keyed|Named)LoadIC to CodeStub
Review URL: https://chromiumcodereview.appspot.com/11941016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13459 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-21 17:54:36 +00:00
verwaest@chromium.org
f80379f3fb Migrate ArrayLength (Keyed|Named)LoadIC to CodeStub
Review URL: https://chromiumcodereview.appspot.com/11938013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13458 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-21 17:17:02 +00:00
verwaest@chromium.org
c3d45451f0 Replace special IC builtins and stubs in the map's cache by codestubs.
Review URL: https://chromiumcodereview.appspot.com/11973008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13453 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-21 14:53:29 +00:00
yangguo@chromium.org
45f20e366a Introduce ENABLE_LATIN_1 compile flag
Mostly a bunch of renaming when flag is disabled.

R=yangguo@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/11759008
Patch from Dan Carney <dcarney@google.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13340 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-09 10:30:54 +00:00
verwaest@chromium.org
c386538cd2 Use POLYMORPHIC for polymorphic Keyed(Load|Store)IC
Review URL: https://chromiumcodereview.appspot.com/11794045

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13332 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-08 12:01:51 +00:00
danno@chromium.org
1f4b4625ff Re-land Crankshaft-generated KeyedLoad stubs.
R=jkummerow@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13236 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-18 16:25:45 +00:00
danno@chromium.org
64fc1f99cb Revert 13157, 13145 and 13140: Crankshaft code stubs.
R=jkummerow@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13179 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-10 11:09:12 +00:00
danno@chromium.org
f19959cd22 Enable stub generation using Hydrogen/Lithium (again)
This initial implementation generates only KeyedLoadICs using the new Hydrogen stub infrastructure.

Committed: https://code.google.com/p/v8/source/detail?r=13105

Committed: https://code.google.com/p/v8/source/detail?r=13117

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13140 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-05 11:04:10 +00:00
danno@chromium.org
66f6a8182c Revert 13117: "Enable stub generation using Hydrogen/Lithium (again)"
TBR=mstarzinger@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13120 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-03 17:16:51 +00:00
danno@chromium.org
78b09625d5 Enable stub generation using Hydrogen/Lithium (again)
This initial implementation generates only KeyedLoadICs using the new Hydrogen stub infrastructure.

Committed: https://code.google.com/p/v8/source/detail?r=13105

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13117 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-03 15:51:05 +00:00
danno@chromium.org
0a3bcc8c05 Revert 13105: "Enable stub generation using Hydrogen/Lithium."
TBR=jkummerow@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13106 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-30 17:45:45 +00:00
danno@chromium.org
c115ff4e33 Enable stub generation using Hydrogen/Lithium.
This initial implementation generates only KeyedLoadICs using the new Hydrogen stub infrastructure.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13105 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-30 17:31:30 +00:00
rossberg@chromium.org
ce05280bfc Get rid of static module allocation, do it in code.
Modules now have their own local scope, represented by their own context.
Module instance objects have an accessor for every export that forwards
access to the respective slot from the module's context. (Exports that are
modules themselves, however, are simple data properties.)

All modules have a _hosting_ scope/context, which (currently) is the
(innermost) enclosing global scope. To deal with recursion, nested modules
are hosted by the same scope as global ones.

For every (global or nested) module literal, the hosting context has an
internal slot that points directly to the respective module context. This
enables quick access to (statically resolved) module members by 2-dimensional
access through the hosting context. For example,

  module A {
    let x;
    module B { let y; }
  }
  module C { let z; }

allocates contexts as follows:

[header| .A | .B | .C | A | C ]  (global)
          |    |    |
          |    |    +-- [header| z ]  (module)
          |    |
          |    +------- [header| y ]  (module)
          |
          +------------ [header| x | B ]  (module)

Here, .A, .B, .C are the internal slots pointing to the hosted module
contexts, whereas A, B, C hold the actual instance objects (note that every
module context also points to the respective instance object through its
extension slot in the header).

To deal with arbitrary recursion and aliases between modules,
they are created and initialized in several stages. Each stage applies to
all modules in the hosting global scope, including nested ones.

1. Allocate: for each module _literal_, allocate the module contexts and
   respective instance object and wire them up. This happens in the
   PushModuleContext runtime function, as generated by AllocateModules
   (invoked by VisitDeclarations in the hosting scope).

2. Bind: for each module _declaration_ (i.e. literals as well as aliases),
   assign the respective instance object to respective local variables. This
   happens in VisitModuleDeclaration, and uses the instance objects created
   in the previous stage.
   For each module _literal_, this phase also constructs a module descriptor
   for the next stage. This happens in VisitModuleLiteral.

3. Populate: invoke the DeclareModules runtime function to populate each
   _instance_ object with accessors for it exports. This is generated by
   DeclareModules (invoked by VisitDeclarations in the hosting scope again),
   and uses the descriptors generated in the previous stage.

4. Initialize: execute the module bodies (and other code) in sequence. This
   happens by the separate statements generated for module bodies. To reenter
   the module scopes properly, the parser inserted ModuleStatements.

R=mstarzinger@chromium.org,svenpanne@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13033 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-22 10:25:22 +00:00
jkummerow@chromium.org
1c086d1202 Lattice-based representation inference, powered by left/right specific type feedback for BinaryOps and comparisons
Review URL: https://chromiumcodereview.appspot.com/10837165

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12961 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-14 15:59:45 +00:00
verwaest@chromium.org
36dd23aa1b Do not go to slow mode and back to fast in initializer blocks.
Review URL: https://chromiumcodereview.appspot.com/10905308

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12534 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-17 17:18:27 +00:00
svenpanne@chromium.org
5deec59302 Unify handling of bailout IDs for property loads.
Renamed Property::ReturnId to Property::LoadId, which describes its use more
accurately. Compound assignments and CountOperations now consistently use
Property::LoadId() instead of their own CompoundLoadId/CountId.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12268 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-07 14:06:25 +00:00
svenpanne@chromium.org
b5da7279b1 Introduced TypeFeedbackId and BailoutId types.
This is a refactoring-only CL which improves the typing of IDs associated with
AST nodes. The interesting parts are in utils.h and ast.h, the rest of the CL
basically follows mechanically.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12263 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-06 14:13:09 +00:00
svenpanne@chromium.org
59cd98cf07 Cleaned up AST nodes a bit.
* Made AST IDs constant. Making this explicit helps understanding the code.

* Removed a few dead functions.

* Be honest by making node_type() pure virtual.

All these changes have been checked to be performance-neutral.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12153 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-20 09:39:27 +00:00
rossberg@chromium.org
ec042177d7 Incorporate constness into inferred interfaces
(in preparation for handling imports).

R=svenpanne@chromium.org
BUG=v8:1569
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12078 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-13 09:29:43 +00:00
jkummerow@chromium.org
432576b7c8 Perform HasFastProperties check on prototypes when computing call targets in Crankshaft.
BUG=125148
TEST=mjsunit/regress/regress-crbug-125148

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12043 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-11 14:27:53 +00:00
rossberg@chromium.org
98db1a369d Implement proper module linking.
Specifically:

- In parser, check that all exports are defined.
- Move JSModule allocation from parser to scope resolution.
- Move JSModule linking from full codegen to scope resolution.
- Implement module accessors for exported value members.
- Allocate module contexts statically along with JSModules
  (to allow static linking), but chain them when module literal is evaluated.
- Make module contexts' extension slot refer to resp. JSModule
  (makes modules' ScopeInfo accessible from context).
- Some other tweaks to context handling in general.
- Make any code containing module literals (and thus embedding
  static references to JSModules) non-cacheable.

This enables accessing module instance objects as expected.
Import declarations are a separate feature and do not work yet.

R=mstarzinger@chromium.org
BUG=v8:1569
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12010 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-09 08:59:03 +00:00
verwaest@chromium.org
d7a5b7d5e2 Separating transitions from descriptors.
In this design maps contain descriptor arrays, which in turn can contain transition arrays. If transitions are needed when no descriptor array is present, a descriptor array without real descriptors is inserted just so it can point at the transition array.

The transition array does not contain details about the field it transitions to. In order to weed out transitions to FIELDs from CONSTANT_FUNCTION (what used to be MAP_TRANSITION vs CONSTANT_TRANSITION), the transition needs to be followed and the details need to be looked up in the target map. CALLBACKS transitions are still easy to recognize since the transition targets are stored as an AccessorPair containing the maps, rather than the maps directly.

Currently AccessorPairs containing a transition and an accessor are shared between the descriptor array and the transition array. This simplifies lookup since we only have to look in one of both arrays. This will change in subsequent revisions, when descriptor arrays will become shared between multiple maps, since transitions cannot be shared.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11994 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-05 13:54:20 +00:00
mstarzinger@chromium.org
fc3c94535d Disallow inlining of functions containing array literals.
This is disabled due to regressions in 3d-cube, but leaves the actual
code to allow inlining in place so it can easily be enabled again.

R=jkummerow@chromium.org
BUG=v8:1322

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11958 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-29 16:39:40 +00:00
mstarzinger@chromium.org
a90c023d5e Allow inlining of functions containing array literals.
R=yangguo@chromium.org
BUG=v8:1322
TEST=mjsunit/compiler/inline-literals

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11942 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-27 14:46:01 +00:00
mstarzinger@chromium.org
df35732ab2 Allow inlining of functions containing RegExp literals.
R=yangguo@chromium.org
BUG=v8:1322
TEST=mjsunit/compiler/inline-literals

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11940 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-27 11:49:37 +00:00
verwaest@chromium.org
68c944c265 In-place shrinking of descriptor arrays with non-live transitions.
Instead of overwriting non-live transitions with NULL_DESCRIPTORs, we remove them from the array by compacting the array (shifting live values to the left) and in-place trimming the array. If the final descriptor array contains no live values (only contained transitions which are now all cleared), we move bit_field3 back from the descriptor array to the map. The descriptor array itself will be collected in the next GC.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11922 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-25 13:10:54 +00:00
mstarzinger@chromium.org
a760b82cab Enable lazy compilation for non-trivial outer contexts.
This changes the compiler to be more aggressive about lazy compilation
of closures with non-trivial outer context. Compilation can only be
triggered with a valid outer context now. One exception is the debugger,
which can request compilation of arbitrary shared code, but it ensures
to trigger compilation only at points where no context is needed.

This relands r11782, r11783, r11790 and a minor fix.

R=ulan@chromium.org
TEST=mjsunit/debug-script-breakpoints-nested

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11866 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-19 14:29:48 +00:00
mstarzinger@chromium.org
9edaa1536b Revert r11782, r11783 and r11790 due to Webkit failures.
R=danno@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11796 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-13 11:26:34 +00:00
mstarzinger@chromium.org
19ece2bec8 Enable lazy compilation for non-trivial outer contexts.
This changes the compiler to be more aggressive about lazy compilation
of closures with non-trivial outer context. Compilation can only be
triggered with a valid outer context now. One exception is the debugger,
which can request compilation of arbitrary shared code, but it ensures
to trigger compilation only at points where no context is needed.

R=ulan@chromium.org
TEST=mjsunit/debug-script-breakpoints-nested

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11782 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-12 15:57:50 +00:00
sanjoy@chromium.org
6125718f37 Remove TLS access for current Zone.
By passing around a Zone object explicitly we no longer need to do a
TLS access at the sites that allocate memory from the current Zone.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11761 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-11 12:42:31 +00:00
verwaest@chromium.org
2b574ef580 Promoting elements transitions to their own field.
This is a first step towards separating all transitions from the property descriptions. If we link the property descriptions from the transition object, this will in allow the descriptor array (property descriptions) to become immutable.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11750 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-11 06:59:56 +00:00
erik.corry@gmail.com
681f2951c6 Regexp: Fix overflow in min-match-length calculation. Crbug=126412.
Review URL: https://chromiumcodereview.appspot.com/10384053

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11525 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-05-08 12:18:08 +00:00
svenpanne@chromium.org
18af012b74 Make functions with switch statements inlinable.
Review URL: https://chromiumcodereview.appspot.com/10083038

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11370 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-18 11:58:13 +00:00
rossberg@chromium.org
ab26fb6b21 Implement rudimentary module linking.
Constructs the (generally cyclic) graph of module instance objects
and populates their exports. Any exports other than nested modules
are currently set to 'undefined' (but already present as properties).

Details:
- Added new type JSModule for instance objects: a JSObject carrying a context.
- Statically allocate instance objects for all module literals (in parser 8-}).
- Extend interfaces to record and unify concrete instance objects,
  and to support iteration over members.
- Introduce new runtime function for pushing module contexts.
- Generate code for allocating, initializing, and setting module contexts,
  and for populating instance objects from module literals.
  Currently, all non-module exports are still initialized with 'undefined'.
- Module aliases are resolved statically, so no special code is required.
- Make sure that code containing module constructs is never optimized
  (macrofy AST node construction flag setting while we're at it).
- Add test case checking linkage.

Baseline: http://codereview.chromium.org/9722043/

R=svenpanne@chromium.org,mstarzinger@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11336 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-16 14:43:27 +00:00
fschneider@chromium.org
e081a3bfba Insert explicit deoptimization for named loads that have "uninitialized" type feedback.
We already do this for binary-ops, unary-ops and comparisons. Typefeedback for named loads can now also
be in "uninitialized" state which means that the corresponding load IC was never executed.
Review URL: https://chromiumcodereview.appspot.com/9722041

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11087 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-19 15:54:37 +00:00
jkummerow@chromium.org
30ba119fa9 Mark Code objects as not optimizable if their FunctionLiteral contains unoptimizable AST nodes.
This ensures that we never try to optimize such functions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11077 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-19 08:44:44 +00:00
mstarzinger@chromium.org
0ab3fb8b00 Implement non-generic stores for object literals.
This uses the type feedback already present for computed value stores
into object literals to generate optimized stores in Crankshaft, thus
avoiding unnecessary generic stores with side effects.

R=svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11023 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-13 12:11:46 +00:00
svenpanne@chromium.org
0b2632fae8 Added support functions for using Literal keys in a HashMap.
This is a preparatory step for using the HashMap clas with Literal keys in the
full code generator. It removes some duplicated code already and removes the
need for 2 HashMaps at each use, which was overly complicated.

Removed one dead function on the way.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10973 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-09 08:34:35 +00:00
rossberg@chromium.org
448b620dad Basic interface inference for modules.
All module expressions, and all variables that might refer to modules,
are assigned interfaces (module types) that are resolved using
unification. This is necessary to deal with the highly recursive
nature of ES6 modules, which does not allow any kind of bottom-up
strategy for resolving module names and paths.

Error messages are rudimental right now. Probably need to track
more information to make them nicer.

R=svenpanne@chromium.org
BUG=v8:1569
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10966 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-08 13:03:07 +00:00
svenpanne@chromium.org
21e43e14eb Fixed presubmit error.
Review URL: https://chromiumcodereview.appspot.com/9584011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10907 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-02 14:15:28 +00:00
svenpanne@chromium.org
5033b9b6d1 Re-land CL 9466047.
Main change from the original CL: Call::ComputeTarget does not use IsProperty
anymore, because this would potentially need a holder, which we don't have
here. Using Map::LookupInDescriptors with a NULL holder is a bit fishy in
general, because one has to be *extremely* careful when using its LookupResult.

The original CL made Chrome's NetInternalsTest.netInternalsTourTabs browser test
fail, but it's a mystery how this could happen: We should never reach
Call::ComputeTarget via Call::RecordTypeFeedback with a CALLBACKS property,
because we never consider calls to them monomorphic, which is in turn because of
the stub cache leaving them in the pre-monomorphic state. Therefore, I don't
have a clue how to write a regression test for this...

As an additional tiny bonus, the --trace-opt output for deoptimizations has been
improved.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10906 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-02 14:03:59 +00:00
rossberg@chromium.org
b89c0a962c AST extensions and parsing for import & export declarations.
R=jkummerow@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10866 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-29 12:12:52 +00:00
svenpanne@chromium.org
22e66d395e Thread isolate through Property constructor, avoiding Isolate::Current.
This removes roughly 5k invocations of Isolate::Current from the string-tagcloud
benchmark.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10859 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-28 15:32:06 +00:00
rossberg@chromium.org
d809d17f5d Further refactoring of declarations in the AST:
Define modules as module declarations.
Separate function declarations from var declarations.

R=jkummerow@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10854 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-28 10:12:39 +00:00
mstarzinger@chromium.org
fb8eb04bfd Implement inlining of constructor calls.
R=vegorov@chromium.org,kmillikin@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10849 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-28 09:05:55 +00:00
mstarzinger@chromium.org
30dcdb6a36 Revert r10811 because of test flakiness.
TBR=vegorov@chromium.org
BUG=v8:1322

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10813 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-23 14:12:44 +00:00
mstarzinger@chromium.org
c1b97fe842 Allow inlining of functions containing function literals.
R=fschneider@chromium.org,vegorov@chromium.org
BUG=v8:1322
TEST=mjsunit/compiler/inline-literals

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10811 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-23 12:24:03 +00:00
fschneider@chromium.org
d1172448ad Make HashMap a template class to specify the allocation policy.
The old HashMap class had an explicit member to determine the allocation
policy. The template version matches the approach used already for
lists.

Cleanup some include dependencies and unnecessary forward declarations.

Cleanup some dead code from isolate.h and replace some HEAP macros
with GetHeap().
Review URL: https://chromiumcodereview.appspot.com/9372106

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10806 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-23 09:12:57 +00:00
jkummerow@chromium.org
4e0091bebb Profiler experiments: self-optimization for functions containing calls
Review URL: https://chromiumcodereview.appspot.com/9430042

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10787 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-22 10:48:58 +00:00
mstarzinger@chromium.org
15c368ce4c Revert r10721 because of test flakiness.
TBR=fschneider@chromium.org
BUG=v8:1322

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10733 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-16 17:13:37 +00:00
mstarzinger@chromium.org
acb83c06f4 Allow inlining of functions containing function literals.
R=fschneider@chromium.org
BUG=v8:1322
TEST=mjsunit/compiler/inline-literals

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10721 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-16 14:01:41 +00:00
mstarzinger@chromium.org
0db91d40e9 Allow inlining of functions containing object literals.
R=fschneider@chromium.org
BUG=v8:1322
TEST=mjsunit/compiler/inline-literals

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10689 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-14 08:57:10 +00:00
rossberg@chromium.org
5498a6345a Extend AST with basic module constructs (yet unused).
R=jkummerow@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10663 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-09 13:40:41 +00:00
rossberg@chromium.org
751508d6aa Split AST Declaration class, in preparation for new module declaration forms.
Turns Declaration into an abstract class, and introduces VariableDeclaration as a concrete subclass.

R=kmillikin@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10662 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-09 13:39:26 +00:00
jkummerow@chromium.org
aa2e842134 Count-based profiling for primitive functions (hidden behind a flag)
Review URL: https://chromiumcodereview.appspot.com/9361026

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10657 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-09 10:19:46 +00:00
jkummerow@chromium.org
d795b7c620 Collect AstNode type information
Review URL: https://chromiumcodereview.appspot.com/9221011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10631 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-08 09:56:33 +00:00
svenpanne@chromium.org
b34e202b20 Removed IsTransitionType predicate.
With the upcoming changes to CALLBACKS properties, a predicate on the transition
type alone doesn't make sense anymore: For CALLBACKS one has to look into the
property's value to decide, and there is even the possibility of having a an
accessor function *and* a transition in the same property.

I am not completely happy with some parts of this CL, because they contain
redundant code, but given the various representations we currently have for
property type/value pairs, I can see no easy way around that. Perhaps one can
improve this a bit in a different CL, the current diversity really, really hurts
productivity...

As a bonus, this CL includes a few minor things:

 * CaseClause::RecordTypeFeedback has been cleaned up and it handles the
   NULL_DESCRIPTOR case correctly now. Under some (very unlikely) circumstances,
   we previously missed some opportunities for monomorphic calls. In general, it
   is rather unfortunate that NULL_DESCRIPTOR "shines through", it is just a
   hack for the inability to remove a descriptor entry during GC, something
   callers shouldn't have to be aware of.

 * DescriptorArray::CopyInsert has been cleaned up a bit, preparing it for later
   CALLBACKS-related changes.

 * LookupResult::Print is now more informative for CONSTANT_TRANSITION.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10600 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-03 13:37:13 +00:00
kmillikin@chromium.org
cb876c25a4 Include what you use for allocation, api, assembler, and ast.
R=fschneider@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10505 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-25 16:31:25 +00:00
svenpanne@chromium.org
fd2731a7e6 Replaced LookupResult::IsProperty by LookupResult::IsFound where possible.
Yak shaving for map sharing with accessor properties contd.: When CALLBACKS can
have map transitions, simply looking at the property type is not sufficient
anymore to decide if a property is there or not. One has to look at the actual
contents of the descriptor entry then, but this breaks down sometimes when the
lookup is being done with a NULL holder. Luckily enough, we can oftren replace
IsProperty by the simpler IsFound, because we inspect the type immediately
afterwards, anyway.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10474 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-23 12:01:47 +00:00
fschneider@chromium.org
01979c70a8 Fix handling of named interceptors in optimized code.
When calling a constant function property from optimized code,
we need to check that there is no interceptor on the receiver map.

TEST=cctest/InterceptorCallICConstantFunctionNotNeededWrapped
Review URL: http://codereview.chromium.org/9240006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10425 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-17 16:06:03 +00:00
vegorov@chromium.org
fb24808c70 Allow call-known-global and call-constant-function to be used for call-sites with mismatched number of arguments.
Adjust InvokeFunction to avoid generating dead code when number when arity mismatch is detected in compile time.

R=fschneider@google.com

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10424 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-17 15:53:58 +00:00
vegorov@chromium.org
4907f424ad Filter transitions while searching for CONSTANT_FUNCTION property in Call::ComputeTarget.
Otherwise transition will hide CONSTANT_FUNCTION property with the same name residing on the prototype.

R=danno@chromium.org
BUG=v8:1883

Review URL: http://codereview.chromium.org/9064003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10312 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-02 08:54:01 +00:00
keuchel@chromium.org
08b4262512 Statically check for assignments to const in harmony mode.
The ES.next draft rev 4 in section 11.13 reads:
It is a Syntax Error if the AssignmentExpression is contained in extended code
and the LeftHandSideExpression is an Identifier that does not statically resolve
to a declarative environment record binding or if the resolved binding is an
immutable binding.

This CL adds corresponding static checks for the immutable binding case.

TEST=mjsunit/harmony/block-const-assign

Review URL: http://codereview.chromium.org/8688007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10156 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-05 14:43:28 +00:00
keuchel@chromium.org
1e9a7267ab Introduce extended mode.
This CL introduces a third mode next to the non-strict
(henceforth called 'classic mode') and 'strict mode'
which is called 'extended mode' as in the current
ES.next specification drafts. The extended mode is based on
the 'strict mode' and adds new functionality to it. This
means that most of the semantics of these two modes
coincide.

The 'extended mode' is entered instead of the 'strict mode'
during parsing when using the 'strict mode' directive
"use strict" and when the the harmony-scoping flag is
active. This should be changed once it is fully specified how the 'extended mode' is entered.

This change introduces a new 3 valued enum LanguageMode
(see globals.h) corresponding to the modes which is mostly
used by the frontend code. This includes the following
components:
* (Pre)Parser
* Compiler
* SharedFunctionInfo, Scope and ScopeInfo
* runtime functions: StoreContextSlot,
  ResolvePossiblyDirectEval, InitializeVarGlobal,
  DeclareGlobals

The old enum StrictModeFlag is still used in the backend
when the distinction between the 'strict mode' and the 'extended mode' does not matter. This includes:
* SetProperty runtime function, Delete builtin
* StoreIC and KeyedStoreIC
* StubCache

Review URL: http://codereview.chromium.org/8417035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10062 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-11-24 15:17:04 +00:00
yangguo@chromium.org
6551e8d47d Removing exit time destructors by leaking static members.
Note that some cctests and d8 still contain statical members with exit time destructors.

BUG=v8:1828

Review URL: http://codereview.chromium.org/8586025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10025 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-11-18 08:59:33 +00:00
fschneider@chromium.org
8fbf1d5017 Landing: [hydrogen] optimize switch with string clauses. Patch by Fedor Indutny <fedor.indutny@gmail.com>.
Original code review: http://codereview.chromium.org/8373029/
Review URL: http://codereview.chromium.org/8589019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10019 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-11-17 13:57:55 +00:00
kmillikin@chromium.org
de0db0f598 Remove ast-inl.h. This file is not necessary.
R=svenpanne@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/8509005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9924 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-11-09 11:32:54 +00:00
fschneider@chromium.org
4627023b38 Revert r9901 to make tree green again.
There was a test failure on x64 mozilla tests.

TBR=ricow@chromium.org
Review URL: http://codereview.chromium.org/8495011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9902 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-11-08 09:56:09 +00:00
fschneider@chromium.org
cac3008437 [hydrogen] optimize switch with string clauses
Hydrogen should optimize not only SMI clauses, but clauses with string literals
too.

Patch from fedor.indutny <fedor.indutny@gmail.com>.

R=vegorov@chromium.org
BUG=
TEST=
Review URL: http://codereview.chromium.org/8373029

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9901 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-11-08 09:08:33 +00:00
fschneider@chromium.org
a2240fc52b Eliminate some virtual function from AST classes.
1. Remove unused dead functions.

2. Replace the virtual As-* type cast functions with non-virtual version
that uses node_type().

Result is around 13K reduction in binary size.
Review URL: http://codereview.chromium.org/8335006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9841 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-31 11:11:26 +00:00
fschneider@chromium.org
2791cd5a2c Allow inlining of named function expressions containing ThisFunction reference.
Named function expression have an implicit local variable that
refers to the current function (ThisFunction). Before we only could inline
anonymous function expressions like:

A.prototype.foo = function() {}

as opposed to

A.prototype.foo = function foo() {}

This change enables inlining function of expressions like this.
Review URL: http://codereview.chromium.org/8346032

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9699 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-19 11:41:22 +00:00
kmillikin@chromium.org
56c763f023 Make the GC aware of JSReceiver pointers in LookupResults.
The LookupResult utility class is used in handlified code, but it can
contain a raw pointer to the lookup's holder object.  Create a per-thread
stack of live LookupResults and iterate all the live ones on GC.

R=vegorov@chromium.org,erik.corry@gmail.com
BUG=
TEST=

Review URL: http://codereview.chromium.org/8341009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9676 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-18 11:18:55 +00:00
keuchel@chromium.org
0706a98b2a Introduce with scope and rework variable resolution.
Review URL: http://codereview.chromium.org/7904008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9650 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-17 09:29:37 +00:00
kmillikin@chromium.org
bcb781d76a Record function call targets, use them for inlining.
Introduce a version of the CallFunctionStub that records monomorphic
call targets in a one-element cache in the instruction stream.  Use
the cache for inlining attempts in the optimizing backend.

R=fschneider@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/7966038

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9449 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-27 11:42:02 +00:00
svenpanne@chromium.org
cf63503cad Unify the handling of comparinsons against null and undefined.
Although this patch is not small, most parts of it are rather mechanical:

 * First of all, the concept of a 'nil-like' value is introduced, which can be
   null or undefined. They are treated symmetrically regarding comparisons, so
   it makes sense to handle them in a uniform manner. It is a mystery why
   JavaScript defines two of those beasts, when even *one* is a design wart...

 * Extended and renamed a few things which now handle undefined in addition to
   null.

 * Made the parts of the full code generator and the hydrogen generation which
   deal with comparisons a bit more similar regarding their handling of special
   cases.

 * Refactored the syntactical detection of special cases for comparisons,
   hopefully making them a bit more readable and less copy-n-paste-oriented.
   Things like this should really be a one-liner in any sane programming
   language... :-P

 * Cut down the length of the argument lists of a few functions to something
   less insane, making them more easily understandable locally. This involves
   minor code duplication, but this was a good tradeoff and can be remedied
   later if necessary.

 * Replaced some boolean arguments with more readable enums.

 * Fixed a TODO: Values which are definitely a Smi or unboxed can never be equal
   to null or undefined.
Review URL: http://codereview.chromium.org/7918012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9323 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-19 14:50:33 +00:00
fschneider@chromium.org
9e4663a8d9 Enable inlining of functions that reference context slots.
Review URL: http://codereview.chromium.org/7887038

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9294 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-15 10:57:47 +00:00
svenpanne@chromium.org
8c744768e2 Nuke CompareToNull AST node.
The Great Master Plan is to move the recognition of special cases for
comparisons further down the compilation pipeline where more information is
available. This is a first step into this direction: The special handling of
equality comparisons involving null is pushed from the parser to the code
generators, removing the need for a special AST node. (There are rumors from
usually well-informed sources that this node type is actually a relic of ancient
crankshaft days...)

The next steps will be the unification of null/undefined handling and pushing
the special case handling in crankshaft even further down the pipeline, enabling
the recognition of cases like "var foo=null; if (foo === bar) ...", but these
will be in separate CLs.
Review URL: http://codereview.chromium.org/7887037

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9293 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-15 09:09:40 +00:00
mikhail.naganov@gmail.com
f8e5c71e18 Rename SmartPointer to SmartArrayPointer.
As pointed out in: http://codereview.chromium.org/7754007/#msg5

"SmartPointer should have been named SmartArrayPointer as it expects an input
allocated using new[] and deallocates it using delete[]. Using it as a simple
scoped pointer for a single object is incorrect."

R=mnaganov@chromium.org

Review URL: http://codereview.chromium.org/7860011
Patch from Thiago Farina <tfarina@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9215 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-09 22:39:47 +00:00
kmillikin@chromium.org
5f1b39e0d5 Remove ExitContextStatement.
All the constructs that used it are now properly bracketed in the AST and we
handle abrupt exits without try/finally.  We can treat normal context exit
as occurring implicitly at the end of a body.

Review URL: http://codereview.chromium.org/7837025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9189 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-08 08:59:14 +00:00
kmillikin@chromium.org
94777e213d Remove variable rewrites and the unneccesary Slot class.
R=fschneider@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/7824038

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9162 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-07 11:02:31 +00:00
fschneider@chromium.org
b20f952e71 Remove unused code for AstSentinels and related stuff.
TEST=compiles
Review URL: http://codereview.chromium.org/7792097

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9118 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-02 12:59:05 +00:00
vitalyr@chromium.org
633e615b89 Improve memory usage of receiver type feedback.
Some AST nodes (Property, Call, etc.) store either a list of receiver
types or a monomorphic receiver type. This patch merges the two fields
using a small pointer list. GetMonomorphicReceiverType() is now a
purely convenience function returning the first and only recorded
type.

This saves about 500K (of about 39M) on average when compiling V8
benchmark as measured by a simple patch adding a zone allocation
counter (https://gist.github.com/1149397).

R=kmillikin@chromium.org

Review URL: http://codereview.chromium.org/7655017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8993 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-22 14:23:37 +00:00
kmillikin@chromium.org
91553bbacd Simplify handling of exits from with and catch.
Remove the try/finally used for with and catch.  Instead of using
try/finally to handle break and continue from with or catch,
statically track nesting dept and clean up when compiling break or
continue.

And instead of using try/finally to handle throw to handler in a frame
whose pc is inside a with or catch, store the context that the handler
should run in in the handler itself.

BUG=
TEST=

Review URL: http://codereview.chromium.org/7618007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8922 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-12 10:52:49 +00:00
vitalyr@chromium.org
bfd7c71954 Pass isolate to AST ID functions.
R=ager@chromium.org

Review URL: http://codereview.chromium.org/7399023

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8678 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-18 17:32:41 +00:00
vitalyr@chromium.org
3d323c691b Avoid TLS load in AstNode constructor.
R=ager@chromium.org

Review URL: http://codereview.chromium.org/7383013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8664 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-15 16:57:35 +00:00
keuchel@chromium.org
628a2e2a1f Better codegen for '<expression> === void <literal>'.
Detect the pattern in both, the full compiler and crankshaft and generate direct pointer
comparisons. Along the way I cleaned up 'typeof <expression> == <string literal>' comparisons
as well by lifting platform independent code and checking the symmetric case.

BUG=v8:1440
TEST=cctest/test-api.cc

Review URL: http://codereview.chromium.org/7216008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8420 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-24 14:30:10 +00:00
jkummerow@chromium.org
b789cb8c94 Crankshaft support for polymorphic array handling
Review URL: http://codereview.chromium.org/7170012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8325 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-20 10:19:00 +00:00
erik.corry@gmail.com
c95ecb1fcd Refix issue 1472. The previous fix worked for the example in the bug
report, but was not general enough to catch all cases.  This is a new
approach.  Includes regression test!
Review URL: http://codereview.chromium.org/7193007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8318 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-17 08:01:12 +00:00
karlklose@chromium.org
cc19d1e278 Revert "Merge arguments branch to bleeding merge."
This reverts commit ceb31498b9d69edca3260820fb4047045891ce6d.

TBR=kmillikin@chromium.org

Review URL: http://codereview.chromium.org/7172030

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8308 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-16 06:37:49 +00:00
erik.corry@gmail.com
dc66620251 Avoid OOM on regexps with nested quantifiers.
http://code.google.com/p/v8/issues/detail?id=1472
Review URL: http://codereview.chromium.org/7170014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8302 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-15 20:15:40 +00:00
karlklose@chromium.org
6cfeb2d400 Merge arguments branch to bleeding merge.
Review URL: http://codereview.chromium.org/7167006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8300 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-15 15:09:28 +00:00