Commit Graph

47 Commits

Author SHA1 Message Date
whesse@google.com 7b9880570d Refactor URI processing of native extensions directive #import("dart-ext:foo").
BUG=
TEST=standalone/io/TestExtensionsTest

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6674 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-18 09:58:01 +00:00
ager@google.com 37147fc116 Remove unused thread pool from standalone VM binary.
We are using the thread pool in the VM via native ports.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5954 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-28 21:57:58 +00:00
iposva@google.com de4e574ac3 - Make the URI resolution methods used by the tag handler private.
Review URL: https://chromiumcodereview.appspot.com//9845040

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5921 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-28 01:21:04 +00:00
whesse@google.com 3b7099b7e2 Change lookup path for Dart native extensions shared libraries.
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5524 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-15 15:49:57 +00:00
iposva@google.com 92cddd5ba8 - The dart:io library uses Uri from dart:uri.
- Fix the library tag handler to proper import libraries
  when generating snapshots.
Review URL: https://chromiumcodereview.appspot.com//9655015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5238 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-09 16:45:57 +00:00
turnidge@google.com 48de07fb60 Start using Dart_PropagateError in the runtime/bin directory.
Review URL: https://chromiumcodereview.appspot.com//9657001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5197 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-08 23:06:44 +00:00
iposva@google.com 8e5891cb96 - Fix the dart_no_snapshot binary.
Review URL: https://chromiumcodereview.appspot.com//9639018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5195 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-08 22:25:29 +00:00
turnidge@google.com c143d26700 Start using Dart_SetField and Dart_GetField in the vm.
Review URL: https://chromiumcodereview.appspot.com//9642003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5185 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-08 18:36:56 +00:00
dgrove@google.com 98302c85df Unify most of our utf8 implementations. This takes the implementation
from utils/string_encoding and moves it to utils/utf . utils/utf8
goes away.
Review URL: https://chromiumcodereview.appspot.com//9462001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5169 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-08 13:28:40 +00:00
iposva@google.com e3a8f10c52 - D:\rive\letters
Review URL: https://chromiumcodereview.appspot.com//9608028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5140 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-08 00:02:17 +00:00
iposva@google.com a37d9578d2 - Fix build: unused vars.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5138 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-07 23:18:16 +00:00
iposva@google.com 67b02b441d - Proper URI resolution when loading scripts from the standalone binary.
Review URL: https://chromiumcodereview.appspot.com//9614006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5135 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-07 22:57:57 +00:00
whesse@google.com 0e40002890 Add native extensions to the Dart shell, on the linux platform.
BUG=
TEST=standalone/TestExtensionTest

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4529 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-23 13:25:11 +00:00
iposva@google.com 9dc3d0f49d - Add dart:json, dart:uri and dart:utf8 to the known and builtin libraries.
- Unify and simplify the building of the creation of the source file.
Review URL: https://chromiumcodereview.appspot.com//9417012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4336 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-16 19:59:19 +00:00
asiva@google.com d50bbba277 Implement support for specifying string interopolation style variable substitution in the import and source statements.
e.g:
sivamach[runtime]>more /workspace/asiva/expr/test1.dart
#library('test1.dart');
#import('${GOOGLE}$SRC/test2.dart');
#import('$DART/test3.dart');
test1() {
  print("test1");
}
main() {
  test1();
  test2();
  test3();
}
sivamach[runtime]>more /workspace/asiva/expr/src/test2.dart
#library('test2.dart');
#source('$GOOGLE$SRC/test2a.dart');
test2() {
  print("test2");
  test2a();
}
sivamach[runtime]>more /workspace/asiva/expr/src/test2a.dart
test2a() {
  print("test2a");
}
sivamach[runtime]>more /workspace/asiva/expr/src/test3.dart
#library('test3.dart');
#source('test3a.dart');
test3() {
  print("test3");
  test3a();
}
sivamach[runtime]>more /workspace/asiva/expr/src/test3a.dart
test3a() {
  print("test3a");
}

sivamach[runtime]>out/Debug_ia32/dart --import_map=GOOGLE,/workspace/asiva/expr --import_map=SRC,src --import_map=DART,/workspace/asiva/expr/src /workspace/asiva/expr/test1.dart
test1
test2
test2a
test3
test3a
Review URL: https://chromiumcodereview.appspot.com//9359009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4199 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-13 22:50:19 +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
ager@google.com 4efd1f98fa Split dart:builtin into dart:builtin and dart:io.
- dart:builtin is implicitly imported.
- dart:io has to be explicitly imported.

I will update the macos and windows stable test binaries when we
are happy with the solution.

R=iposva@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3537 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-24 07:36:59 +00:00
whesse@google.com b02ed08af1 Add script attribute to Options class, providing the name of the running script.
BUG=dart:409
TEST=standalone/OptionsTest

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3485 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-23 12:15:26 +00:00
hausner@google.com 3ebdf081ca Set breakpoint at url, line number
Add debugger functionality to set breakpoint at given url and line number.
Review URL: https://chromiumcodereview.appspot.com//9240014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3420 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-18 23:15:56 +00:00
turnidge@google.com e62f34ce77 Give isolates names to be used during debugging.
Implement --trace_isolates.

-------------

Sample output of --trace_isolates for the CrossIsolateMessageTest:

[+] Starting isolate:
    isolate:    CrossIsolateMessageTest.dart/main-7112
[+] Starting isolate:
    isolate:    CrossIsolateMessageTest.dart/CrossIsolate1.main-7114
[+] Starting isolate:
    isolate:    CrossIsolateMessageTest.dart/CrossIsolate2.main-7115
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/main-7112
    reply_port: 7117
    dest:       CrossIsolateMessageTest.dart/CrossIsolate2.main-7115
    dest_port:  7115
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/CrossIsolate2.main-7115
    reply_port: 7118
    dest:       CrossIsolateMessageTest.dart/main-7112
    dest_port:  7117
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/main-7112
    reply_port: 7119
    dest:       CrossIsolateMessageTest.dart/CrossIsolate1.main-7114
    dest_port:  7114
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/CrossIsolate1.main-7114
    reply_port: 7120
    dest:       CrossIsolateMessageTest.dart/main-7112
    dest_port:  7119
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/main-7112
    reply_port: 0
    dest:       CrossIsolateMessageTest.dart/CrossIsolate1.main-7114
    dest_port:  7120
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/CrossIsolate1.main-7114
    reply_port: 0
    dest:       CrossIsolateMessageTest.dart/CrossIsolate2.main-7115
    dest_port:  7118
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/CrossIsolate2.main-7115
    reply_port: 0
    dest:       CrossIsolateMessageTest.dart/main-7112
    dest_port:  7116
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/main-7112
    reply_port: 0
    dest:       CrossIsolateMessageTest.dart/main-7112
    dest_port:  7113
[-] Stopping isolate:
    isolate:    CrossIsolateMessageTest.dart/CrossIsolate2.main-7115
[-] Stopping isolate:
    isolate:    CrossIsolateMessageTest.dart/CrossIsolate1.main-7114
[-] Stopping isolate:
    isolate:    CrossIsolateMessageTest.dart/main-7112
Review URL: https://chromiumcodereview.appspot.com//9242035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3416 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-18 21:46:27 +00:00
ager@google.com 607eea1402 Cleanup gypi mess.
My change that introduced a platform directory shared between vm and bin runtime components did not correctly update gypi files.

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3155 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-10 16:50:14 +00:00
sgjesse@google.com a6071e0880 Thread pool changes
Make one global thread pool instead of a thread pool for each
eventhandler (i.e. isolate).

Also:

* Added handler function for thread pool tasks.
* Added thread pool shutdown.
* Added a simple test.

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3079 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-09 07:38:30 +00:00
ager@google.com c4c92c4f7b Introduce runtime/platform directory for code shared between vm
and bin.

Cleaned up globals.h. Common parts now in platform/globals.h.
vm specific parts are in vm/globals.h and bin/globals.h is gone.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3030 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-06 11:28:21 +00:00
ager@google.com d5696e2026 Change the behavior of open on files to not truncate by default
when opening for writing.

We have an explicit truncate method in the API and truncating
the file is a bit hostile to users who want to modify or append
to an existing file. :-)

R=whesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2941 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-04 12:23:01 +00:00
asiva@google.com bde808f44b Changes to create an application snapshot which can be layered on top
after an isolate is created and initialized.

Added an option --use_script_snapshot which creates a snapshot of the specified script in an isolate, shuts that down and restarts on a new isolate and loads the script from the snapshot buffer and executes it.
Review URL: http://codereview.chromium.org//8970004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2609 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-20 02:04:24 +00:00
turnidge@google.com 0b833d4977 Add support for interrupting an isolate in the vm. Interrupts are
implemented by extending the existing support for stack overflow
checking in the vm.  When an interrupt is scheduled for an isolate, we
overwrite the isolate's stack limit with a value guaranteed to cause a
stack overflow.

We support multiple kinds of interrupts, encoded in the low bits of
the stack limit.

Add Dart_InterruptIsolate and Dart_InterruptIsolateCallback to the
dart embedding api to allow the embedder to request and handle
interrupts.

Add EXPECT_SUBSTRING(needle, haystack) testing macro.
Review URL: http://codereview.chromium.org//8851008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2529 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-16 18:41:20 +00:00
hausner@google.com 9159389495 First bits of external debugger API
The debugger API is in a separate set of files. Embedders do not have
to include the debug api if they don't need to.
Review URL: http://codereview.chromium.org//8826007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2198 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-07 22:13:49 +00:00
podivilov@google.com c692646f07 Introduce Dart_SetVMFlags API function.
It should be possible to set command line arguments without providing isolate init callback.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1972 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 11:59:35 +00:00
asiva@google.com b53c955b37 - Refactor the isolate callback mechanism to also include creation of the
isolate, this enables creation of isolates using a snapshot
- remove source buffers of corelib, coreimpl-lib and builtin-lib from the binary
Review URL: http://codereview.chromium.org//8673002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1958 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 00:30:25 +00:00
sgjesse@google.com d7c8c1f1e4 Fix a number of issues with the process handling
1. Ignore the signal SIGPIPE on Linux and Mac OS

When reading from or writing to a closed pipe the signal SIGPIPE
is raised. The default handling of this is to terminate the
program. When signal SIGPIPE is ignored the read and write
returns EPIPE.

2. Wrong return type for stdio getter

3. When there is an error on a socket mark it as closed

4. Mark the pipe used for process exit status as a one way pipe

5. Add tests to test stdin, stdout and stderr in Dart scripts

R=ager@google.com

BUG=dart:536, dart:454
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1793 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 14:49:18 +00:00
asiva@google.com 0ce8298541 Refactor the library tag handler to share code between standalone dart and the snapshot generator.
Review URL: http://codereview.chromium.org//8549009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1665 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-18 18:24:04 +00:00
asiva@google.com 2d88131bfe Fix prototype of Dart_Initialize.
Review URL: http://codereview.chromium.org//8574075

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1635 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-17 21:59:38 +00:00
asiva@google.com 9f49e2bf74 Implement automatic loading of dart:core_native_fields library
with predefined classes having native fields.
Classes that need native fields in them can import this library and
extend these predefined classes.
Review URL: http://codereview.chromium.org//8537023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1629 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-17 21:04:43 +00:00
asiva@google.com aaffbd2561 Support command line parameters to specify a url to file name mapping. This is used during snapshot generation so that a URL is mapped to a physical file name.
Review URL: http://codereview.chromium.org//8439061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1550 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-15 21:19:27 +00:00
turnidge@google.com 8c64adf13e Deal with unhandled exceptions the same way in all Dart api functions.
--

Terminology change: invalid handles are now called error handles.

Unhandled exceptions used to be a kind of valid handle.  Now they are
a kind of error handle.

For the Dart_Invoke* functions, this means that the standard
error-checking blob drops from two tests to one test and is
harder to mess up.

Many other Dart api functions (Dart_ToString, for example) previously
dealt with unhandled exceptions by turning them into terse error
messages.  Now these functions preserve information about the
exceptions and generate better error messages.

Changed Dart_HandleMessage to return success/failure.  It seemed to fit.

--

Details:

Dart_IsValid becomes Dart_IsError (negated sense).

Dart_GetError now knows how to print a stack trace semi-nicely.

Dart_ExceptionOccurred -> Dart_IsUnhandledException.

Renamed ApiFailure class to ApiError to fit better.

ApiError now has a "data" pointer that points to either an error
message string or to an unhandled exception object.

Documentation changes aplenty.
Review URL: http://codereview.chromium.org//8501034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1470 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 19:31:04 +00:00
asiva@google.com e1277b840a Fix generation of pprof output.
Review URL: http://codereview.chromium.org//8497028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1367 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-09 18:59:29 +00:00
turnidge@google.com 04d38885a3 Renaming:
Dart_ObjectToString -> Dart_ToString
Dart_Objects_Equal -> Dart_ObjectEquals
Dart_IsInstanceOf -> Dart_ObjectIsType
Dart_ReThrowException -> Dart_RethrowException

Added:

Dart_IsSame: === operation

Added a couple of tests.
Review URL: http://codereview.chromium.org//8490016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1326 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-08 19:18:22 +00:00
ager@google.com 68166663f9 Renaming Array -> List in the VM API.
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1195 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-04 12:25:53 +00:00
iposva@google.com 97634fb30e - Add the implementation of the Options interface to the runtime.
Review URL: http://codereview.chromium.org//8437075

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1169 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-03 21:45:03 +00:00
ager@google.com f74ecd22fd Implemented File create API.
R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1095 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-02 15:57:54 +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
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 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
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
dgrove@google.com 4c0f559d23 Initial checkin.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00