Commit Graph

1688 Commits

Author SHA1 Message Date
ager@google.com 0d14ec42be Guard against integer overflow in process constructor.
I have set an arbitrary limit of around one million arguments. I
see no reasonable use of the Process API where that would be a
problem.

R=whesse@google.com,turnidge@google.com
BUG=dartbug.com/1751
TEST=None, can't happen right now but might in the future.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9583 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 08:35:10 +00:00
srdjan@google.com 9b391ef9cf Add some missing x64 instruction variations.
Review URL: https://chromiumcodereview.appspot.com//10696183

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9578 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 00:41:45 +00:00
srdjan@google.com e74f5a721b Implement more intrinisification for x64 (not as inlined code but as header of the target).
Review URL: https://chromiumcodereview.appspot.com//10701147

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9573 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 22:37:41 +00:00
vegorov@google.com 1bd5a9b414 Skeleton of a linear scan register allocator.
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9563 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 18:52:17 +00:00
srdjan@google.com 94192b98a1 Use class id instead of class in subtype test cache.
Review URL: https://chromiumcodereview.appspot.com//10695136

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9559 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 18:16:30 +00:00
turnidge@google.com 9cbae35238 Don't allow OS::SNPrint or OS::VSNPrint to return negative values.
If we encounter conditions that would have caused vsnprintf to return
a negative value, then something pretty wild is going on.  We choose
to terminate the vm when this occurs.

This fixes security bug 1745.
Review URL: https://chromiumcodereview.appspot.com//10696165

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9558 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 17:54:24 +00:00
vegorov@google.com 1ae72fbd8b Change comparison-to-branch fusion to actually remove comparison from the graph.
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9556 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 17:41:54 +00:00
asiva@google.com 08c662b1c0 Represent tokens as a compressed stream instead of an array.
On x86:

Original sizes:
Size of isolate snapshot = 925655
New space (0k of 32768k) Old space (1700k of 1792k) Code space (0k of 0k)
out/ReleaseIA32/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 80944
CorelibIsolateStartup(RunTime): 5636
UseDartApi(RunTime): 404620
Dart2JSCompileAll(RunTime): 1379683
FrameLookup(RunTime): 45

Size with the new TokenStream implementation:
Size of isolate snapshot = 851352
New space (0k of 32768k) Old space (1368k of 1536k) Code space (0k of 0k)
out/ReleaseIA32/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 76918
CorelibIsolateStartup(RunTime): 4056
UseDartApi(RunTime): 502111
Dart2JSCompileAll(RunTime): 1251646
FrameLookup(RunTime): 45

(saves about 332k out of the original TokenStream size of 410k)

On x64:

Original sizes:
Size of isolate snapshot = 924865
New space (0k of 32768k) Old space (3234k of 3444k) Code space (0k of 0k)
out/ReleaseX64/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 109660
CorelibIsolateStartup(RunTime): 3985
UseDartApi(RunTime): 463009
Dart2JSCompileAll(RunTime): 2170309
FrameLookup(RunTime): 35

Size with the new TokenStream implementation:
Size of isolate snapshot = 849675
New space (0k of 32768k) Old space (2436k of 2560k) Code space (0k of 0k)
out/ReleaseX64/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 98716
CorelibIsolateStartup(RunTime): 2938
UseDartApi(RunTime): 509149
Dart2JSCompileAll(RunTime): 2042273
FrameLookup(RunTime): 39

(saves about 798k out of the original TokenStream size of 810k)

Token stats:
Number of tokens:   101470
  Literal tokens:   4550
    Ident tokens:   33020
Review URL: https://chromiumcodereview.appspot.com//10697055

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9539 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 00:11:58 +00:00
regis@google.com 1e055acce8 Stop passing location argument to run time calls, since it is stored in the pc
descriptor.
Various cleanups.
Review URL: https://chromiumcodereview.appspot.com//10701131

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9538 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 23:59:09 +00:00
asiva@google.com 8269202ff2 Add quotes around strings when generating source from the token stream.
Review URL: https://chromiumcodereview.appspot.com//10765017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9536 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 23:19:57 +00:00
asiva@google.com 7ba3fa9503 Invoke 'Scavenge' in the weak handle processing unit tests and not 'CollectGarbage' in order to avoid triggering of old space mark sweep in certain situations.
Review URL: https://chromiumcodereview.appspot.com//10748006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9535 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 23:03:07 +00:00
cshapiro@google.com 0928c651e5 Implement a 2-pass heap verification algorithm.
The previous algorithm would visit each pointer in the heap and verify it
without regard for whether the pointer had already been visited.

The new algorithm computes the set of allocated objects and verifies each
object in the set.  In a second pass, each pointer is visited and tested
for membership in the set.

BUG=2606

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9532 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 22:07:40 +00:00
regis@google.com e6e70d7bb2 Allocate types in proper heap space.
Allow type finalization without canonicalization.
Review URL: https://chromiumcodereview.appspot.com//10696155

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9529 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 21:54:13 +00:00
srdjan@google.com f680c68a55 Cleanup usage of GrowableArrays in class Environment.
Review URL: https://chromiumcodereview.appspot.com//10692140

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9525 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 21:06:52 +00:00
srdjan@google.com b4e299e2c1 Improve code for checked instance calls (polymorphic calls) and expand printing of PolymorphicInstanceCall to include checked class names.
Review URL: https://chromiumcodereview.appspot.com//10698128

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9520 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 18:22:45 +00:00
ajohnsen@google.com acc78cebae Use native copy between internal/external bytearrays.
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9510 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 13:58:30 +00:00
srdjan@google.com 0273f70312 Intrinsify a couple of x64 methods (fix performance regression on Mandelbrot). Need to investigate Mandelbrot optimization next.
Review URL: https://chromiumcodereview.appspot.com//10753018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9495 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 01:09:32 +00:00
srdjan@google.com bfd52ec46a Rename Script's source to Source. Trace parser (--trace-parser) only if source is available (thus skipping all the 'noise' of bootstrap methods).
Review URL: https://chromiumcodereview.appspot.com//10752017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9494 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 00:14:25 +00:00
turnidge@google.com 22fb45f640 Implement method and variable reflection in dart:mirrors.
Review URL: https://chromiumcodereview.appspot.com//10687004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9493 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 23:57:08 +00:00
iposva@google.com dd800b6870 - On store buffer block overflow call a VM leaf function to
add the entries into the store buffer.
- Add a way to preserve and restore caller saved registers.
- Clean up the implementation of the stub for Assembler::Stop.
Review URL: https://chromiumcodereview.appspot.com//10758008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9490 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 22:58:27 +00:00
srdjan@google.com e801021a27 Cleanups.
Review URL: https://chromiumcodereview.appspot.com//10765007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9482 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 20:31:25 +00:00
regis@google.com 5919998308 Fix static type analysis of closure calls (issue 3959).
Add test.
Review URL: https://chromiumcodereview.appspot.com//10762003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9473 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 18:02:40 +00:00
regis@google.com 32c8564b0a Add --trace_type_check_elimination flag for debugging purposes.
Review URL: https://chromiumcodereview.appspot.com//10689099

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9471 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 16:59:15 +00:00
kmillikin@google.com ac0025ebd3 Use the instruction iterator rather than an explicit loop in more places.
R=vegorov@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9467 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 12:58:36 +00:00
kmillikin@google.com 6bd463ee85 Rename the successor field of instruction to next.
Renaming only change to use a name parallel to 'previous'.

R=vegorov@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9464 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 11:38:29 +00:00
floitsch@google.com 4a4532d205 Fix int.compareTo.
In particular we want:
 0.compareTo(-0.0) => 1

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9459 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 07:57:29 +00:00
fschneider@google.com a411bf5045 Add forward iterator to iterate instructions inside a basic block.
It is currently only used in SSA renaming.
Review URL: https://chromiumcodereview.appspot.com//10692107

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9438 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 12:31:37 +00:00
kmillikin@google.com 0b1f1323cd Remove the instruction pointer from computations.
Remove the back pointers from computations to instructions in favor of
passing the instruction explicitly when needed.

R=fschneider@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9435 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 11:10:53 +00:00
whesse@google.com 4e4104a3e1 [IO] Improve documentation for dart:io Socket.onWrite.
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9428 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 08:41:37 +00:00
kmillikin@google.com 5f541253ad Eliminate the type distinction between BindInstr and DoInstr.
Represent the distinction between computations whose value is used and
computations whose value is unused with a data member (instead of a
separate type).

R=fschneider@google.com,srdjan@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9416 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-05 10:06:28 +00:00
kmillikin@google.com ca7e5a9972 Fix broken build.
TBR=fschneider@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9408 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 13:48:26 +00:00
kmillikin@google.com 595aafa18e Simplify adding of computations to the flow graph.
In preparation for collapsing BindInstr/DoInstr and flattening
Computations into the Instruction hierarchy.

Add a pair of functions EffectGraphVisitor::Bind and
EffectGraphVisitor::Do for adding computations to the flow graph that
have respectively one and zero uses.  This creates a single site where
we construct new BindInstr and a single site where we construct new
DoInstr (also, a single site where we construct new UseVal during flow
graph construction).

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9407 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 13:43:28 +00:00
fschneider@google.com 7de785eaf4 Remove unused code for StringConcatNode from the AST and the graph builder.
Review URL: https://chromiumcodereview.appspot.com//10693092

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9405 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 13:07:22 +00:00
sgjesse@google.com 9f2a6f06a0 Fix HTTP client eviction timer bug
The HTTP client eviction timer should only be cancled and nulled out
when there are no client connections at all.

R=whesse@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9404 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 12:27:35 +00:00
fschneider@google.com 767b5d4439 Add support for fixed parameters in SSA builder and fix a bug in the pre-order graph traversal.
Each fixed parameter is initially defined by a ParameterInstr as definition. This
definition is not in the instruction stream, but just in the initial environment
at the graph entry so that the live range of all parameters start at the same point.

The pre-order spanning tree was computed in the wrong way which caused test failures
when building SSA because renaming relies on the dominator tree which depends on
the preorder spanning tree.

Also change the IL printing functions to be more compatible with the visualizer tool.
Review URL: https://chromiumcodereview.appspot.com//10735002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9391 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 10:24:19 +00:00
regis@google.com 09d3ecf285 Compile an instance setter call when a static getter is declared, but no field
or static setter are declared (issue 3941).
Add test.
Review URL: https://chromiumcodereview.appspot.com//10689083

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9376 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 20:40:02 +00:00
fschneider@google.com 3dcdc79ffe Add deoptimization environments to instructions.
Each instruction that can deoptimize need to have the values of the
non-optimizing code as uses. The values are stored in an environment
(GrowableArray<Value*>) attached to the instruction when constructing
SSA form.

For now every instructions gets a deoptimization environment. It contains
the values of all locals, parameters and expression stack elements at
the start of the instruction.

The environment is not used yet, but can be printed in the flow graph
with the flag --print-environments.
Review URL: https://chromiumcodereview.appspot.com//10696090

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9345 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 12:54:03 +00:00
whesse@google.com d05e40212a IO: Fix error in Process exit handling.
BUG=3639
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9336 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 10:16:25 +00:00
vegorov@google.com 2935029239 Implement ActivationFrame::GetLocalVarValue on x64.
R=iposva@google.com
BUG=3961
TEST=Debug_ExprClosureBreakpoint

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9334 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 09:31:44 +00:00
fschneider@google.com bece5d05c8 Fix a bug in SSA renaming introduced when using the RemoveFromGraph helper for removing instructions.
The helper function RemoveFromGraph resets previous and next instruction pointers to NULL
when deleting an instruction.

I changed it to return the successor of the removed instruction so that the function is
more convenient to use while iterating over the list of instructions.
Review URL: https://chromiumcodereview.appspot.com//10692072

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9332 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 08:35:00 +00:00
iposva@google.com 65d96de4e8 - Separate store buffer data in the isolate into the StoreBufferBlock and
the actual StoreBuffer.
- Add a HashSet class to use for the StoreBuffer data.
- Fix allocation sites for definite old objects.
- Remove obsolete leaf runtime entry StoreBuffer.
Review URL: https://chromiumcodereview.appspot.com//10702067

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9323 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 00:10:23 +00:00
regis@google.com d95cbc8d7f Use VM type cast and save handles.
Review URL: https://chromiumcodereview.appspot.com//10693071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9317 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-02 21:42:53 +00:00
fschneider@google.com eba7136e7b Make IL instructions a doubly-linked list within basic blocks.
In order to be able to efficiently iterate backwards over instructions
and removing or replacing instructions in the graph we want them to
be a double-linked list inside basic blocks. The list has the following

1. Block entry instructions do not have a previous instruction.
2. The last instruction in a block may or may not have a next instruction:
   - Branches have a NULL-successor.
   - Normal block exits have a block entry instructions as successor.

This CL also makes the accessor for previous and next instruction in this
list non-virtual. This avoidis the current code duplication there.
Review URL: https://chromiumcodereview.appspot.com//10665022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9297 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-02 16:08:58 +00:00
fschneider@google.com 31dfb3d8da Fix bailing out of SSA compilation and enable --use-ssa on x64 by default.
We need to re-parse the function when retrying compilation after bailing out
because of the side-effects to the AST (break-, continue-labels).

To improve test coverage I'm enbabling building of SSA on x64 now.
Review URL: https://chromiumcodereview.appspot.com//10694053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9291 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-02 15:41:37 +00:00
ager@google.com 485bf8d10b Deal with special cmd.exe environment variables that have keys that start with an equals sign.
I have attempted to deal with them correctly instead of ignoring
them so that they can be passed on unchanged to subprocesses.

R=johnniwinther@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9284 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-02 10:58:24 +00:00
ager@google.com 52230ca22b Support posting of external data into dart as external uint8 arrays through the Dart API.
The native ports use the snapshot reader to create the dart objects. Added support for reading external arrays from snapshots but no support for writing them. The only way an external array is written to a snapshot is through the api message writer.

This allows dart:io to avoid one copy of data read from files and sockets. This change only contains one use of the new API.

R=asiva@google.com,iposva@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9281 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-02 07:22:32 +00:00
hausner@google.com 11d2c19fc4 Make sure breakpoints are enabled
With my previous checkin it became possible that internal
code breakpoints became disabled. Now make sure that when
one of these breakpoints is re-used, it becomes enabled.
Review URL: https://chromiumcodereview.appspot.com//10690053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9265 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-29 20:39:48 +00:00
cshapiro@google.com d0ce05d8b7 Enhance raw object validation check and enable checks in release builds.
BUG=3866

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9262 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-29 20:23:26 +00:00
hausner@google.com c4280b8b89 Fix Dart_RemoveBreakpoint
The debugger code assumed that breakpoints can only be removed
while the debugger is paused. That is not true. An embedder can
remove breakpoints while the isolate is idle and running any
Dart code.

Fix for issue 3781 (http://dartbug.com/3781)
Review URL: https://chromiumcodereview.appspot.com//10698051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9258 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-29 18:24:35 +00:00
fschneider@google.com da315f478e Revert r9253 because of dartium test failures
TBR=vegorov
Review URL: https://chromiumcodereview.appspot.com//10693048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9256 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-29 17:27:12 +00:00