Commit Graph

15405 Commits

Author SHA1 Message Date
sgjesse@google.com 186e0078e4 Fix Windows build
TBR=asiva@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3949 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-06 15:56:44 +00:00
sgjesse@google.com be4fb55ac9 Fix Windows and Mac OS builds
TBR=asiva@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3948 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-06 15:52:39 +00:00
sgjesse@google.com 4e9686dc4b Implemented encoding af a Dart_CMessage structure into a Dart message. Currently supported types are:
Boolean
  Smi
  Double
  String
  Array

The encoding uses the upper bits of the Dart_CObject type field for "marking" already written objects with their object id for generating backward references. After serialization these mark are removed.

Added the API Dart_PostCMessage for encoding and posting a Dart_CMessage structure.

Removed the API Dart_PostIntArray and used Dart_PostCMessage instead.

R=asive@google.com,turnidge@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3947 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-06 15:42:15 +00:00
srdjan@google.com be66ab9a1c Fix for issue 1307: throw runtime exception instead of reporting a compile time error if a static call cannot be resolved.
Review URL: https://chromiumcodereview.appspot.com//9316100

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3922 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-03 22:25:16 +00:00
srdjan@google.com 19c79a3660 If programmer mistakes the number of arguments, VM throws noSuchMethod. Extend reporting to report correct number/name of arguments if a method with the same name exists. Example:
NoSuchMethodException - receiver: 'Instance of 'A'' function name: 'foo' arguments: [1]]
Found 'foo(alpha, beta, message)'
 0. Function: 'Object.noSuchMethod' url: 'bootstrap' line:647 col:3
 1. Function: '::main' url: '/sources/chinstrap/dart/runtime/Test.dart' line:8 col:8
Review URL: https://chromiumcodereview.appspot.com//9307074

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3911 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-03 17:13:09 +00:00
ager@google.com 641cf84f6a Implement recursive directory deletion.
Additionally, make sure that the handler can be registered after
the operation in file and directory implementation:

  dir.delete();
  dir.deleteHandler = () => print('hest');

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3892 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-03 12:37:30 +00:00
srdjan@google.com e09ffd78db Fix build: Mac compiler does not complain about a missing return :-(. Eliminated return type, made function void.
Review URL: https://chromiumcodereview.appspot.com//9309063

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3870 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-02 19:50:43 +00:00
srdjan@google.com 5d53270821 Intrinisifed more core library methods: isNaN, isNegative, cos, sin.
TODO: inline those methods in otpimized code.
Review URL: https://chromiumcodereview.appspot.com//9320023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3869 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-02 19:44:55 +00:00
turnidge@google.com 0ddd4c04e9 Dart_PropagateError, take 2.
This change hopefully takes care of the non-mac build issues.  The
checked mode failures are fixed in a separate cl.
Review URL: https://chromiumcodereview.appspot.com//9316071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3863 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-02 19:05:06 +00:00
srdjan@google.com 92d6a081d0 Fix for issue r1469: DartVM appears to not GC closure reachable memory properly
(The issue was diagnosed and solved by Siva)

The problem appears when allocating large arrays that are stored in a context.
We allocate large arrays directly in the old space. The context in which these arrays are stored is in the new space. When we do an old gen GC we were not first scavenging the new space. As a result the large arrays still remained when we did the old-gen GC, resulting in OOM.

The fix is to do both a new gen scavenge and an old gen mark-sweep when we run out of space in the old gen.
Review URL: https://chromiumcodereview.appspot.com//9317054

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3856 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-02 18:22:25 +00:00
ager@google.com 37499dce81 Rework Windows process handling.
- Use only one thread to wait for multiple process objects.
- Fix issue where reading from a closed pipe would print an
  error message on stderr.
- Remove the need to go to dart before removing a processinfo
  object from the list. Sometimes you never get there so we
  have to remove the process info object always.

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3844 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-02 13:47:42 +00:00
sgjesse@google.com 085bb5496e Allocate a Dart_CMessage structure when decoding a message into C structures
Changed tests to use zone allocation for C structures.

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

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3835 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-02 10:49:49 +00:00
sgjesse@google.com 3f035ecad0 Add support for lists and backward references when decoding a message to a Dart_CObject object
The C message reader can now read lists created like this:

  new List()
  new List<int>()
  new List<String>()
  new List<double>()
  new List<bool>()

The backward references are now resolved and already allocated
Dart_CObject objects are reused when there is a backward reference.

The reuse of the Dart_CObject objects poses the issue of which objects
where allocated with the supplied allocator and which where not.

Currently this will work best with a zone allocator. This will be added
to the tests in a subsequent change.

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

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3831 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-02 09:55:18 +00:00
sgjesse@google.com 42b70dcddb Change the thread interface in runtime/platform and use it starting all threads
The platform thread interface (dart::thread) is now refactored to an
all static interface as suggested by iposva@ and asiva@. Use this
interface for running all threads in the VM.

R=ager@google.com, iposva@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3830 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-02 08:59:26 +00:00
turnidge@google.com ae88492093 Revert Dart_PropagateError until I can track down the problems in
checked mode tests.

Sorry for the hubbub.
Review URL: https://chromiumcodereview.appspot.com//9314053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3823 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 23:39:28 +00:00
asiva@google.com f4a89b3260 Fix for issue 1456 - register libraries read from a partial snapshot
Review URL: https://chromiumcodereview.appspot.com//9314048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3822 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 23:18:14 +00:00
turnidge@google.com 1a722c7a04 Remove unused variable.
Review URL: https://chromiumcodereview.appspot.com//9315043

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3821 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 22:53:02 +00:00
turnidge@google.com 26e24ede55 More fixes for non-mac builds.
- Don't use NULL in arithmetic in LongJump::IsSafeToJump
- Various functions need to return a faux value on unreachable branches.
Review URL: https://chromiumcodereview.appspot.com//9315041

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3819 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 22:49:36 +00:00
turnidge@google.com 4a3d434dee Remove some unused variables to fix the linux build.
Review URL: https://chromiumcodereview.appspot.com//9310039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3817 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 22:40:13 +00:00
turnidge@google.com 9da62c5fea Add Dart_PropagateError.
This function can be used in native functions to properly pass all
errors up the stack.

Set the long jump base in the Compiler instead of outside of the
compiler.  A bunch of errors that used to be propagated through the
sticky_error are now propagated through return values.  This includes
all of the DartEntry and DartLibraryCall functions.

In particular, we no longer use the long jump to cross dart frames.
Instead errors are propagated across dart frames using the same
mechanism that we use for unhandled exceptions.  I've added assertions
to make sure that we only use the long jump when it is "safe".
Review URL: https://chromiumcodereview.appspot.com//9169102

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3815 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 22:34:16 +00:00
ajohnsen@google.com 143de9eb80 Use ByteArray's native for Socket and File.
Review URL: https://chromiumcodereview.appspot.com//9235067

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3812 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 21:48:27 +00:00
turnidge@google.com 1f5364cd3b Add support for native ports in the vm.
Dart_NewNativePort creates a port associated with a C handler
function.  When messages come in on this port, they are forwarded to
the C function for processing.

To support this, refactored PortMap so that it operates on a new
MessageHandler type instead of directly on Isolates.

For now, native ports have a dedicated single thread.  Eventually we
will back native ports (and possibly Isolates as well) by a shared
thread pool.
Review URL: https://chromiumcodereview.appspot.com//9169063

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3804 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 18:53:40 +00:00
ager@google.com ed3338dbae Wait for exit-code thread to terminate before terminating main.
The code is identical on Linux and Mac. Currently unimplemented on
Windows because I had to revert my change to the exit code handling
on Windows. I will revive that change tomorrow and implement this
as part of that change.

R=iposva@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3801 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 18:16:45 +00:00
ager@google.com 7031be2291 Revert "Changes to the process implementation."
There is a race-condition on Windows and exit handling when a process
has been closed is incorrect.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3790 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 14:19:25 +00:00
ager@google.com 6b5815328c Changes to the process implementation.
- Make the list of active processes thread safe on Windows.
- Use only one thread on Windows to detect process termination.
- Stop the process termination thread when the standalone VM terminates.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3780 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 09:09:23 +00:00
hausner@google.com 0c61be512e Allow assignment expressions in conditional expressions
Fix issue 1243 (http://code.google.com/p/dart/issues/detail?id=1243)
Also fix issue 1370 (name of internal temporary variables, order of expression evaluation.)
Review URL: https://chromiumcodereview.appspot.com//9310007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3768 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 00:49:47 +00:00
srdjan@google.com 9e77768c91 Fix for bug 1229: Unary operator plus is not allowed ... except for literals.
Add tests for incorrect literals, e.g. "+ 5".

Added a temporary token kTIGHTADD that represents an ADD not terminated by a whitespace. It is temporary and eliminated in the parser (code generator ot AST do not see it). It is used to recognize correct literals.
Review URL: https://chromiumcodereview.appspot.com//9264051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3745 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-31 20:05:24 +00:00
hausner@google.com e1d0b0619b Debugger API: get local variables of an activation frame
Also add a test case where the evaluation of a field name results in an error during the evaluation of the field.
Review URL: https://chromiumcodereview.appspot.com//9264058

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3738 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-31 18:10:08 +00:00
ager@google.com 37af08b705 Move actual work out of the SIGCHLD signal handler for the dart:io
process library.

Use the self-pipe trick to signal a dedicated thread when a SIGCHLD
signal is received. The dedicated thread will perform the actual work
of extracting the exit code and posting it back to Dart.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3711 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-31 09:10:24 +00:00
regis@google.com 5efeb28010 Fix build breakage.
Review URL: https://chromiumcodereview.appspot.com//9302025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3707 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-31 03:44:01 +00:00
regis@google.com 980cbf9c74 Store resolved library prefix in unresolved class object in order not to repeat
unnecessary library prefix resolution.
Remove redundant Type::NewParameterizedType() helper.
Simplify parsing of qualified identifiers.
Cleanup parsing of factory methods.
Fix resolution of imported types (add tests).
Review URL: https://chromiumcodereview.appspot.com//9233039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3703 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-31 00:07:07 +00:00
sgjesse@google.com 1b6dcca246 Change friend declaration
Visual Studio requires the friend declaration for the actual class using a private method. GCC lives with a friend declaration for a sub-class.

TBR=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3683 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-30 08:53:11 +00:00
sgjesse@google.com f50fb7546e Implementation of message reader for converting a message snapshot into a C structure
It currently supports a limited number of types null, boolean, smi,
double, one byte string and arrays of these.

There is still no public function in the API to access this.

R=asiva@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3682 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-30 08:29:31 +00:00
hausner@google.com 8866540697 Fix listing of source scripts in debugger
The cache of loaded scripts must be initialized to null when loading
from a snapshot.

Fix for issue 1345.
Review URL: https://chromiumcodereview.appspot.com//9121060

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3673 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-27 23:00:55 +00:00
srdjan@google.com df94bc5fa5 Use inlined double temporary object for unary operation, add tests. Fix disassembler crash.
Review URL: https://chromiumcodereview.appspot.com//9297026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3666 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-27 21:04:12 +00:00
srdjan@google.com 71dbd99c77 Fix a perfrormance degradation in Mandelbrot: double comparison may have
left and right temporary objects.
Review URL: https://chromiumcodereview.appspot.com//9225008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3660 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-27 16:54:14 +00:00
ager@google.com c3f89c46ec Fix race condition between signal handler and main thread.
The signal handler could unblock the main thread. The main thread
could delete the Process object the signal handler is holding a
pointer to. The signal handler could then close a file descriptor
it got from the deleted memory.

The whole process exit handling infrastructure is pretty fragile.
We should attempt to come up with something simpler.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3652 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-27 13:01:16 +00:00
srdjan@google.com 81698d0ad7 Allocate inlined temporary double objects only if the parent node supports it;
fixes bug http://b/issue?id=5903071
More optimizations can be added later.
Review URL: https://chromiumcodereview.appspot.com//9288086

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3639 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-27 01:14:47 +00:00
hausner@google.com 021029a386 Not my day today
Review URL: https://chromiumcodereview.appspot.com//9113100

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3638 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-27 01:01:01 +00:00
hausner@google.com ae5c6905ac Fix new test in checked mode
Murphy is in a really bad mood today...
Review URL: https://chromiumcodereview.appspot.com//9289061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3637 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-27 00:49:02 +00:00
hausner@google.com 690df302d4 More lottery wins...
Review URL: https://chromiumcodereview.appspot.com//9235082

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3636 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-27 00:33:00 +00:00
hausner@google.com 9dea8d3795 Bingo
Tripped the linux compiler again...
Review URL: https://chromiumcodereview.appspot.com//9113099

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3635 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-27 00:29:47 +00:00
hausner@google.com 864393bdad Add debugger functions to inspect objects and classes.
Next steps: inspect global variables, better support for inspecting local variables on stack.
Review URL: https://chromiumcodereview.appspot.com//9288071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3634 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-27 00:27:12 +00:00
regis@google.com 76a765b72f Simplify parsing of 'new' operator.
Fix checking of default factory type parameters (add new tests).
Start cleanup of class resolution code in parser and finalizer.
Review URL: https://chromiumcodereview.appspot.com//9290065

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3632 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-26 23:50:29 +00:00
ajohnsen@google.com 20f24769c8 Fix type error
Review URL: https://chromiumcodereview.appspot.com//9249052

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3629 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-26 22:56:50 +00:00
ajohnsen@google.com 56d0e3a746 Send data in chunks when writing to socket.
Review URL: https://chromiumcodereview.appspot.com//9220008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3628 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-26 22:50:26 +00:00
ager@google.com 4605b5ea33 Minor changes to the dart:io library files.
- Split some of the streams into an interface and an implementation file.
- Add documentation comments where missing.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3616 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-26 10:03:19 +00:00
cshapiro@google.com 9869598950 Fix a build break caused by an new execution test that cannot run on ARM.
Review URL: https://chromiumcodereview.appspot.com//9169073

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3614 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-26 03:36:04 +00:00
cshapiro@google.com 569ef3c044 Add ByteArray interface and provide internal and external implementations.
The new ByteArray interface supersedes the ByteBuffer type which allowed
only external data storage.  This type has been removed and replaced by
the more flexible ByteArray with a default implementation that stores its
elements on the managed heap.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3613 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-26 02:42:08 +00:00
ngeoffray@google.com b12ed463bd Change error message (and not the internal method names) to report 'final field' instead of 'const field'.
Review URL: https://chromiumcodereview.appspot.com//9117025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3592 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-25 08:09:47 +00:00