Commit Graph

7138 Commits

Author SHA1 Message Date
johnniwinther@google.com 8637cfd322 Revert "Move dart2js from sdk/lib/_internal/compiler to pkg/compiler"
This reverts commit r41512.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41513 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-05 08:15:26 +00:00
johnniwinther@google.com 2b336e17f0 Move dart2js from sdk/lib/_internal/compiler to pkg/compiler
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41512 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-05 07:09:04 +00:00
zra@google.com 0219bdb81a Regularize naming to make BUILD.gn files easier to write.
Review URL: https://codereview.chromium.org//703693002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41510 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-04 22:03:57 +00:00
lrn@google.com e3d4226c63 Make JSON.fuse(UTF8) be more efficient by not creating intermediate string.
Adds JsonUtf8Encoder class that can be used directly, or through jsonEncoder.fuse(utf8Encoder) or jsonEncoder.startChunkedConversion(_Utf8EncoderSink).

R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41479 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-04 10:25:41 +00:00
regis@google.com 5c55e61647 Resubmit fix for Function::Clone() and Field::Clone() to adjust the class owner
of type parameters (issue 18630).
Make sure to clone the parameter type array as well.
Add regression tests.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41474 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-03 23:16:33 +00:00
zerny@google.com 94a510176b Copy irregexp related code from V8.
This "syntactic" change copies the irregexp code from V8 r24065 to Dart.
Compared to the V8 files the only changes are that the files have been
suitably renamed, headers and footers have been updated, and most of the
unneeded code has been replaced by a 'SNIP' marker. None of the files
are added to the build and they cannot compile. Integration with the
Dart VM is done in a follow-up CL [1].

[1]: https://codereview.chromium.org/683433003/

BUG=
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41455 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-03 10:00:31 +00:00
regis@google.com 30dce6a5d1 Fix issue 21474 in mirrors.
R=rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41453 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-31 23:16:11 +00:00
regis@google.com 1571d85271 Clarify comment explaining assert in Function::SetParameterTypeAt.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41447 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-31 20:14:56 +00:00
vegorov@google.com e6847ac17c IR refactoring: consolidate all boxing and unboxing instructions.
BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41437 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-31 12:17:12 +00:00
sgjesse@google.com 65e1149f8c Make stdout/stderr async
This makes stdout.write and stderr.write async.

This effectively reverts https://code.google.com/p/dart/source/detail?r=33645

Reapplies r41350 after the dart2js batch-runner have been changed to handle
async stdout/stderr.

R=ricow@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41436 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-31 12:11:53 +00:00
fschneider@google.com 7bec3edaef Remove saving/restoring of the context at function entry.
This is not needed anymore after I changed the current context
to always reside in a local variable.

Further simplifications and cleanup in the debugger.

This also fixes a bad memory retention problem with
non-capturing closures.

BUG=dartbug.com/18886
TEST=tests/language/vm/closure_memory_retention_test.dart
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41433 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-31 07:35:51 +00:00
regis@google.com 71c8b1b210 Revert mixin fix r41424 until mirrors issue 21474 is fixed.
Review URL: https://codereview.chromium.org//691053004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41425 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-30 19:04:02 +00:00
regis@google.com 5a09dee193 Fix Function::Clone() and Field::Clone() to adjust the class owner of type
parameters (issue 18630).
Add regression tests.
Commented out 3 lines in mirror test (issue 21474 filed).

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41424 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-30 17:39:40 +00:00
vegorov@google.com e2c3ab74e2 Introduce --no-prune-dead-locals flag to disable dead locals pruning.
Disabling this optimization regresses code quality but improves debugging experience.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41423 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-30 16:35:39 +00:00
fschneider@google.com 876193b31a Make CTX allocatable by the register allocator.
This change makes CTX available by not caching the current
context while in Dart code. Instead the current context
is held in a local variable (:saved_current_context_var) and
is passed as argument in CTX at calls.

This also simplifies a lot of code in the debugger: As a result,
Isolate::top_context is not needed anymore since the current context
can always be extracted from a Dart frame.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41422 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-30 15:42:38 +00:00
whesse@google.com 3da2c473cd Update status for vm and analyzer.
BUG=dartbug.com/21468 dartbug.com/21469
R=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41418 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-30 12:33:50 +00:00
koda@google.com 36a6dd4201 Context objects don't have a compile-type. Return dynamic-type in this case.
This is lifted from
https://codereview.chromium.org/678763004/diff/120001/runtime/vm/flow_graph_type_propagator.cc
to fix issue 21455.


BUG=21455
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41406 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-29 21:34:59 +00:00
koda@google.com d718e29fe9 Fix unintended effects in vm.status.
Review URL: https://codereview.chromium.org//688143002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41404 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-29 21:00:19 +00:00
koda@google.com b6b054e3f1 Add VerifiedMemory helper for write-barrier verification.
Allocates hidden extra memory after VirtualMemory, and
verified writes are duplicated at a fixed offset.

This CL only adds the helper.
Next steps:
1. Use Reserve when reserving semi-spaces and heap pages.
2. Use Write for storing pointers (+ offset in generated code).
3. Use Accept for GC-related object lifecycle.
4. Call Verify regularly.
5. Fix failures (= places where we forget/ignore write barriers).

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41399 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-29 19:56:12 +00:00
zra@google.com 306ef8dd75 Fixes leak in Process.runSync().
This removes the call to _stdin._sink.destroy()
from my previous CL, which broke a test.
stdin is closed by the native implementation.
Closing again shouldn't cause a problem, but
it looks like destroy() attempts to do a lot
more than that.

OTOH adding the remove call is sufficient to
fix the leak, so let's just stick with that.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41395 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-29 14:32:30 +00:00
zra@google.com 4e15424820 Reverts 41378 for test failure.
Review URL: https://codereview.chromium.org//688443005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41386 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-29 01:57:22 +00:00
zra@google.com 2bb9c19ab8 Fixes memory leak in Process.runSync()
This was introduced in 36665 by https://codereview.chromium.org/307503002/

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41378 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-28 23:02:54 +00:00
koda@google.com f78517a5ba Atomic update of header word on ARM.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41360 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-28 15:50:44 +00:00
sgjesse@google.com b6d16215aa Revert "Make stdout/stderr async"
This reverts r41350.

There are test-failures that needs to be analyzed.

TBR=iposva@google.com, ajohnsen@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41353 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-28 09:07:56 +00:00
sgjesse@google.com c50df5e563 Make stdout/stderr async
This makes stdout.write and stderr.write async.

This effectively reverts https://code.google.com/p/dart/source/detail?r=33645

R=iposva@google.com, ajohnsen@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41350 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-28 08:53:10 +00:00
iposva@google.com d309354728 Fix SIMARM64 and SIMMIPS builds:
- Use DEBUG_ASSERT as needed for Mutex::Owner() access.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41334 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-27 19:51:46 +00:00
iposva@google.com 55357d2993 - Use the simulator to do atomic operations that could also
be executed in generated code.

R=koda@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41332 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-27 19:21:33 +00:00
hausner@google.com 95dc65a0e9 Implement await for statement
Implement await for statement to iterate over streams. Uses
the built-in class StreamIterator.

await for (var e in stream_expr) {
  S;
}

Is translated to:

var it = new StreamIterator(stream_expr);
while (await it.moveNext()) {
  var e = it.current;
  S;
}

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41328 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-27 18:03:43 +00:00
turnidge@google.com c658fa60f9 Fix deadlock that can occur while handling service messages at a breakpoint.
Deadlock looks like:

  Regular Isolate
  -> paused at breakpoint in debug message loop
  -> holds debug message queue lock to get message notifications
  -> handles an service message
  -> waits for portmap lock to send response

  Service Isolate
  -> receives request for paused isolate
  -> holds portmap lock to send message
  -> runs custom message notifier to wake debug message loop
  -> waits for debug message queue lock

I've solved this by releasing the debug message queue lock while
handling service messages.  This requires me to poll for new service
messages after reacquiring the debug message queue lock to make sure I
haven't dropped any notifications.

It's a little weird that the embedder (runtime/bin) needs to be aware
of the locking in the core vm (runtime/vm), but this seemed like the
simplest fix for now.

BUG=
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41326 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-27 16:57:21 +00:00
lrn@google.com 8050a0392b Fix assertion not holding (calling with start==end) and typo.
Review URL: https://codereview.chromium.org//677423002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41317 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-27 14:00:13 +00:00
fschneider@google.com cedcd90984 Remove dead code from InvokeDartCode stub.
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41316 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-27 13:43:17 +00:00
lrn@google.com 7485b6fff2 Fix type-errors.
R=whesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41315 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-27 13:33:49 +00:00
lrn@google.com a3dd8cd26f Fix typo reutrn -> return typo.
R=whesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41314 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-27 13:05:21 +00:00
vegorov@google.com acee3f390f Revert "Revert "IR refactoring: reduce duplication related to MayThrow/AllowsCSE.""
This relands commit r41281.

TBR=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41312 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-27 12:13:37 +00:00
lrn@google.com e2e17c3f26 Make JSON parsing work as a chunked conversion sink.
This allows JSON parsing to work on individual chunks of source instead
of collecting and concatenating all the parts before parsing.

This is made in anticipation of having a UTF-8 version that parses directly
on the input codes, without creating a String first.

R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41311 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-27 12:11:39 +00:00
vegorov@google.com ad57bec275 Revert "IR refactoring: reduce duplication related to MayThrow/AllowsCSE."
This reverts commit r41281.

Old Mac OS X bots are unhappy (GCC frontend used on those bots can't correctly resolve reference to the base constructor unless all template parameters are specified).

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41284 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-24 16:05:59 +00:00
vegorov@google.com 6b4677a431 IR refactoring: reduce duplication related to MayThrow/AllowsCSE.
Fold those things into TemplateInstruction/TemplateDefinition.

R=fschneider@google.com, zerny@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41281 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-24 15:10:11 +00:00
fschneider@google.com 1dc4e979d9 Remove isolate pointer from context objects.
By moving all stubs that do runtime calls into the isolate
we don't need to cache the current isolate in each context
object.

This saves space on each context at the cost of duplicating stubs
in each isolate. Most stubs are already isolate-specific and the total number
 of stubs is small enough for this to be a good trade-off.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41279 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-24 12:19:20 +00:00
vegorov@google.com fb915fe887 IR cleanup: pass deopt id as constructor argument instead of doing deopt_id_ assignment.
This also kills a list of Instruction friends that was growing without bounds.

R=srdjan@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41278 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-24 11:27:17 +00:00
fschneider@google.com 81eacccfa3 Simplify SnapshotReader::LookupInternalClass.
All callers of this function assert that the returned RawClass
is non-null. Also, the returned Class is only used to extract its class id.

I removed the unreachable code and simplified it accordingly to just return
the class id directly.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41277 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-24 09:37:04 +00:00
kustermann@google.com 360dfe4f41 Several bugfixes in dart:io's handing of sockets
This CL includes fixes for the following issues:

a) The event handler created listening socket metadata (values of a hashtable
indexed by filedescriptor) sometimes as SocketData and sometimes as
ListeningSocketData depending whether the socket has been listened to or not.
This was very buggy, in particular because multiple isolates can have a
reference to the same server socket in different states (opened, listened,
closed).

=> This should be fixed by sending the file descriptior typeMask always to the
   eventhandler.

b) A server socket cloned via the ServerSocketReference mechanism, opens a
receive port for sending (fd, address, port) to isolates/... which want to
create a server socket from the reference.
This receive port was not closed properly when calling only close() (and not
listening first).

=> This should be fixed by closing this receiveport on the ServerSocket.close()
   call as well.

c) It was assumed in the event handler that a close command needs to have the
Dart_Port in a hash table. But this is only the case if the user actually
listened to the ServerSocket. Otherwise the event handler does not know about
the server socket. This caused a NULL dereference which resulted in a SEGFAULT.

=> This should be fixed by checking if the Dart_Port is in the hashmap of the
ListeningSocketData or not.

d) Too many bits were considered when extracting token count in C++ code.

The CL includes a regression test which should trigger these issues.

BUG=21384,21383
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41276 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-24 08:55:50 +00:00
iposva@google.com abd65a6bec - Make sure the VM actually asks for libdl when being linked.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41264 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-23 18:20:50 +00:00
koda@google.com 516a33a0cc Avoid races in capacity accounting.
Use pages_lock_ to sync access to usage_.capacity_in_words.
Also remove ASSERT no longer valid with concurrent sweep.

This does not resolve the more general issue of the growth policy not being perpared for concurrent sweeping.

BUG=21363
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41251 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-22 20:41:44 +00:00
johnmccutchan@google.com fb7f8551b4 Add unboxed Mint for X64
BUG=
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41233 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-21 18:11:43 +00:00
iposva@google.com c7c9d5d12f Fix http://dartbug.com/21335
- Make the VM internal AssertionError, TypeError and CastError implement
  the public classes instead of patching them.

R=asiva@google.com, lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41231 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-21 17:00:16 +00:00
fschneider@google.com c6e2650073 VM: Avoid repeated deoptimizations from hoisted array bounds checks.
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41223 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-21 10:36:52 +00:00
koda@google.com ede485669b Fix test timeout; faster DEBUG String::CharAt by not using mutable accessor.
BUG=dart:21343
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41218 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-21 00:15:43 +00:00
iposva@google.com 3feded1f47 - Rename flags to reflect the generation impacted.
R=koda@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41202 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-20 15:26:04 +00:00
vegorov@google.com dde7963d36 Ignore redundant parallel moves when checking if a block is empty.
Single predecessor blocks containing nothing but redundant parallel moves can be compacted away.

R=zerny@google.com
BUG=http://dartbug.com/21302

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41187 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-20 11:29:19 +00:00
iposva@google.com 6266f1d4a0 - Do not attempt to set parameter types if they
were already finalized.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41182 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-17 21:50:28 +00:00