Commit Graph

3601 Commits

Author SHA1 Message Date
cshapiro@google.com 6d99ab1ec2 Fail if an imported file cannot be read.
Review URL: http://codereview.chromium.org//8439025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1060 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-02 00:54:02 +00:00
ager@google.com 5b5c36e253 Implement async file API on top of isolates.
This is not going to be efficient but will give us the right
semantics of the operations. We should be using native async
operations for this.

Fixed a bug in VM implementation of List.setRange.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1012 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-01 14:07:30 +00:00
sgjesse@google.com 032de2585d Some Linux and Mac OS event handler refactoring
This moved some of the handling of the data on a socket to a socket data object.

This is a step in preparation for another change where more state will be stored on socket data object.

This is also a step in moving from an array of socket data objects indexed by the file descriptor to a hash map of socket data objects.

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1001 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-01 11:54:14 +00:00
sgjesse@google.com 18e5ef8da5 New OutputStream interface
R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@997 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-01 10:10:37 +00:00
asiva@google.com 8e2f6361f1 When generating snapshots for a specified script don't include the builtin library by default. The DOM snap shot for instance does not want the builtin library. If the builtin library is needed it needs to be explicitly imported in the specified script.
Review URL: http://codereview.chromium.org//8343071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@971 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-31 20:53:44 +00:00
ager@google.com 83539ca419 Add type checks to directory listing.
R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@940 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-31 09:37:07 +00:00
asiva@google.com 9c7db339b8 Allocate and pass a resolved_path buffer to realpath as older macos versions
do not work when a NULL is passed in for resolved_path
Review URL: http://codereview.chromium.org//8400070

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@917 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-28 20:22:34 +00:00
rchandia@google.com 035fdaa49d Added builtin native call to exit the running vm
Total uses exit(int) to signal whether to stop or restart

R=iposva@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@893 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-28 15:32:33 +00:00
srdjan@google.com 8d69118676 More strict non-equal cleanups in library code
Review URL: http://codereview.chromium.org//8413018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@892 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-28 15:21:42 +00:00
sgjesse@google.com 6568436be7 Explicitly handle listen sockets and connection sockets differently in Linux and Mac OS eventhandler
Previously the assumption was that an POLLIN event with no data available was from a listen socket with pending accepts. However a POLLIN event from a connection socket can have no data available if the data has been read before the event is processed.

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@878 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-28 09:30:42 +00:00
srdjan@google.com 959f4b519d Use strict equality when comparing with null, especially when null is a default value.
Review URL: http://codereview.chromium.org//8400038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@859 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-27 22:11:16 +00:00
ager@google.com d864b5e1f6 First round of changes to the file interface.
Have both async and sync version for the file operations. The
thinking is that once you have used an async operation you will
not be allowed to use a sync one. Only sync versions currently
implemented.

Instead of having one input and one output stream associated with a
file we create new streams whenever needed. These get their own
underlying file descriptor so they do not interfere. This means
that FileStreams have to be explicitly closed.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@819 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-27 13:33:18 +00:00
sgjesse@google.com 500a14c6d5 Only call the dataReceived callback for sockets if there is actually data available
R=ager@google.com

BUG=
TEST=EchoServerStreamTest.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@809 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-27 10:08:08 +00:00
turnidge@google.com e756497a78 Refactor the dart api a bit:
- Dart_Result is gone.  Dart_Handle mostly replaces it.
- Name/signature changes
  - IsValidResult -> IsValid
  - GetErrorCString -> GetError
  - many more...
- Make details of persistent handle freelist private.
- Add persistent "True" handle to api state.

Things I am not doing in this changelist:

- Documentation updates
Review URL: http://codereview.chromium.org//8380020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@778 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-26 20:38:41 +00:00
sgjesse@google.com 00a00bcdb4 This contains a new InputStream and StringInputStream interfaces.
The readUntil is only supported through readLine on the StringInputStream.

The StringInputStream implementation in string_stream.dart could live outside the VM as it is plain Dart code.

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@747 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-26 13:17:28 +00:00
ager@google.com 1fa8860919 Implement path canonicalization on Windows to fix infinite loop on cyclic includes.
R=sgjesse@google.com
BUG=179
TEST=language/CyclicImportTest

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@744 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-26 12:44:16 +00:00
asiva@google.com 597dba3644 Fix windows build.
TBR=regis.
Review URL: http://codereview.chromium.org//8341032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@715 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-25 21:09:44 +00:00
asiva@google.com ac94efb33f Fix infinite recursion when dealing with cyclic library dependencies.
Review URL: http://codereview.chromium.org//8371016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@714 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-25 21:01:07 +00:00
ager@google.com 60300b4c0e Fix Mac build.
R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@691 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-25 12:20:33 +00:00
ager@google.com 86284155b9 Improve error handling in the process library.
Verify that the arguments have the types expected by the
implementation. Require a List instance containing builtin
Strings as the arguments. Require a builtin String path.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@690 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-25 12:16:04 +00:00
ager@google.com 0005f9fe53 Use realpath on Linux and MacOS to compute the full path for directory listing.
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@628 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-24 12:58:07 +00:00
sgjesse@google.com ebe5b49e51 Added file missing from last commit
TBR=rchandia@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@604 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-21 15:36:15 +00:00
sgjesse@google.com 17f9c619db Rename getters in process object
stdinStream -> stdin
  stdoutStream -> stdout
  stderrStream -> stderr

R=rchandia@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@602 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-21 15:22:35 +00:00
iposva@google.com 481305a9c7 - Fix which headers are included.
Review URL: http://codereview.chromium.org//8347023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@555 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-19 15:44:40 +00:00
jrgfogh@google.com 999a62bd68 Fixed NullPointerException in Timer.
Review URL: http://codereview.chromium.org//8346030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@547 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-19 10:00:19 +00:00
rchandia@google.com 055ff3f630 Flush stdout on calls to PrintString
R=iposva@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@530 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-18 21:06:01 +00:00
sgjesse@google.com 7041797907 Get the OS error message for process exceptions on Windows
R=ager@google.com
Review URL: http://codereview.chromium.org//8277035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@435 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-14 13:03:39 +00:00
ager@google.com 17f168a2f1 Fix type annotation error in directory implementation.
TBR=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@434 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-14 12:57:42 +00:00
ager@google.com 953d2599c1 Add exists, create and delete to directory implementation on Linux and Mac.
All of the directory implementations on Linux and Mac are identical
and uncontroversial. Join the implementations in directory_posix for
now. I will split it into the two files again if it becomes necessary.

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@432 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-14 12:42:44 +00:00
sgjesse@google.com 82312e0130 Use UUIDs for named pipe names on Windows instead of counter
R=ager@google.com
Review URL: http://codereview.chromium.org//8276002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@422 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-14 07:34:05 +00:00
sgjesse@google.com b98198c894 Make sure that the named pipe created for signalling the exit code is not inheritable
R=ager@google.com
Review URL: http://codereview.chromium.org//8267006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@396 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-13 13:34:36 +00:00
sgjesse@google.com 786aee238a Fix the handling of exceptions from process start
The privious change in r389 where the sockets used to communicate with the chile process did not work. Even though the Socket objects are not assigned any file descriptor they should still have their Dart port closed. If not the VM will not terminate.

TBR=ager@google.com

TEST=ProcessStartExceptionTest.dart
BUG=none

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@395 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-13 13:31:51 +00:00
sgjesse@google.com d0496ec807 Implement the full process interface for Windows
There are still a couple of TODOs in the code.

R=ager@google.com
Review URL: http://codereview.chromium.org//8249007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@389 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-13 10:38:37 +00:00
sgjesse@google.com 1cd5459f7b Add the ability to run tests with several sets of VM flags
The test-option VMOptions that can be placed in .dart test files can now be specified several times like this:

// VMOptions=
// VMOptions=--short_socket_read
// VMOptions=--short_socket_write
// VMOptions=--short_socket_read --short_socket_write

For each time VMOptions is specified a seperate test will be bun with the specified flags.

Used this to run the tests that uses sockets with short read and writes. Fixed a number of bugs in both stream implementation and in tests revealed by this.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@388 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-13 10:14:31 +00:00
ager@google.com 10f298a6d4 Directory: implement recursive listing on Windows.
R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@364 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-12 13:03:06 +00:00
ager@google.com c53c7097d0 Directory: implement recursive directory listing on Linux and Mac.
R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@363 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-12 12:53:39 +00:00
ager@google.com 59135cc57b Clean up directory listing interface.
Remove open and close. A directory instance just holds a string
representing the path to the directory.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@362 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-12 10:39:30 +00:00
sgjesse@google.com 74e4e46c2f Fix wrong pointer arithmetic when extending the file descripter list in the eventhandler
This caused random crashes due to memory corruption when the file descripter list in the eventhandler needed to be extended.

R=ager@google.com

BUG=none
TEST=tests/dart/src/SocketManyConnectionsTest.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@331 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-11 15:05:32 +00:00
ager@google.com 536a9f0500 Fix type mismatch in directory listing.
R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@328 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-11 13:19:19 +00:00
ager@google.com cf136a7685 Use isolates for directory listing.
Use isolates to make directory listing asynchroneous from the point
of view of the main Dart isolate. Each listing operation will spawn
a new heavy isolate to perform the actually directory listing using
the synchroneous OS primitives.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@327 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-11 13:12:14 +00:00
sgjesse@google.com d5e6daf99f Fix Windows build
TBR=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@326 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-11 11:45:17 +00:00
sgjesse@google.com b7485553a2 Fix deadlock in process exit handling
As glibc allocation routines are not re-entrant avoid calling delete in signal handler.

Instead the message send from the signal handler on process exit contains both the pid and the exit code. The internal _Process object always installs a data handler for the exit message and calls back into C++ to cleanup the resources allocated for running a process.

Changed the ActiveProcess (renamed to ProcessInfo) to form an explicitly linked list.

R=ager@google.com

BUG=dart:1
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@325 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-11 11:26:12 +00:00
ager@google.com 4914d6c9c6 Windows Sockets: handle client socket close correctly.
When the client closes the socket on which it is listening
GetQueuedCompletionsStatus can return with the error
ERROR_NETNAME_DELETED.

R=sgjesse@google.com
BUG=2
TEST=EchoServerTest.dart

Review URL: https://chromereviews.googleplex.com/3573014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@209 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-07 11:17:58 +00:00
asiva@google.com 0b30a49971 5419598: Add a setjmp around the isolate spawning code so that parse errors
are caught and reported as errors.
5417103: Add a setjmp around Dart_Run_Loop so that parse errors
are caught and reported as errors.
Review URL: https://chromereviews.googleplex.com/3553012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@140 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-06 18:33:36 +00:00
sgjesse@google.com 6abaad8aa1 Restructured socket tests and fixed readUntil on InputStream
Most of the socket tests where written with closing both the server and client ends of the socket. However on Windows this can lead to errors once in a while (WSAECONNRESET). The tests now closes the socket in the client and and waits for a close event on the server side.

The readUntil on InputStream did not take data in the internal buffer into account. This has been fixed and the related test have been rewritten to check for two patterns which together will match all the input.

R=ager@google.com

BUG=
TEST=

Review URL: https://chromereviews.googleplex.com/3536016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@126 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-06 14:47:49 +00:00
ager@google.com 30ede18056 Implement first version of directory listing library on Windows.
R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromereviews.googleplex.com/3543018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@123 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-06 14:28:05 +00:00
floitsch@google.com 15727ed074 Rename DateTime to Date.
Review URL: https://chromereviews.googleplex.com/3529013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@107 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-06 10:14:49 +00:00
sgjesse@google.com cc0ffa0766 Minor changes to Socket and File
* align the definition of the exception class with how ProcessException ended up
* add constants for redability

R=ager@google.com

BUG=
TEST=

Review URL: https://chromereviews.googleplex.com/3551012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@98 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-06 07:57:34 +00:00
ager@google.com 7c191c392b Fix Windows build after directory library changes.
R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromereviews.googleplex.com/3527012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 15:02:27 +00:00
ager@google.com 023fa46e48 Finish non-recursive synchronous directory listing on Linux and Mac.
Next steps: Testing, Windows support and using isolates to make
listing async.

We should probably change the API to not tie a Directory object
to a given OS directory structure. When spawning an isolate to
perform a listing operation, that will open the directory,
list its contents and close the directory. That way we can
do multiple listing operations with the same Directory object
without having interference.

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

Review URL: https://chromereviews.googleplex.com/3511020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 14:33:49 +00:00