Commit Graph

38 Commits

Author SHA1 Message Date
asiva@google.com 292d8c9c21 Fix 13594.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28017 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-27 16:55:20 +00:00
asiva@google.com 89ef11e004 Final step towards loading core library scripts directly from the sources
- Modify bin.gypi to ensure that the io library and patch files are read
  directly from the sources. Remove the source buffer generation step in
  the gypi files for all the io library and patch files.

- Restructure the code a bit to eliminate some code duplication.

- Delete runtime/tools/concat_library.py

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22514 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-08 16:42:46 +00:00
smok@google.com ebbc2020a2 Put everything in runtime/bin into '::dart::bin' namespace.
Review URL: https://codereview.chromium.org//14341015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22032 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-25 14:22:30 +00:00
asiva@google.com 97ef3c86d3 Move json, uri, utf and crypto libraries into the VM.
This should ensure that we would not need a patch per embedder for these libraries in case somebody decides to patch these.
Review URL: https://codereview.chromium.org//12318031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18865 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-22 01:24:57 +00:00
sra@google.com b82378e3e4 Revert "Fresh try at "Use browsers JSON.parse for parsing JSON.""
Review URL: https://codereview.chromium.org//12220009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18117 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-05 07:11:12 +00:00
sra@google.com 2a3de27007 Fresh try at "Use browsers JSON.parse for parsing JSON."
Review URL: https://codereview.chromium.org//12221009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18116 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-05 07:00:47 +00:00
sra@google.com 42ccc2aa4a Revert "Revert "Revert "Use browsers JSON.parse for parsing JSON."""
Review URL: https://codereview.chromium.org//12192003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18024 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-02 04:01:28 +00:00
sra@google.com 75a7b7e0f6 Revert "Revert "Use browsers JSON.parse for parsing JSON.""
with missing gyp file.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18023 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-02 03:36:10 +00:00
sra@google.com e525fdb517 Revert "Use browsers JSON.parse for parsing JSON."
Review URL: https://codereview.chromium.org//12190002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18022 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-02 03:25:53 +00:00
sra@google.com cafd5ddcae Use browsers JSON.parse for parsing JSON.
This shrinks swarm by 27k (3.6%)
We can't make the error messages be the same since the native error contains only a message.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18021 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-02 03:17:41 +00:00
whesse@google.com ad4681a661 When building standalone Dart executable, put implementation of dart:io natives in a separate library.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14679 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-08 13:19:26 +00:00
asiva@google.com ebbb7c4134 - Represent strings internally in UTF-16 format, this makes it
compatible with webkit and will allow for easy externalization of
  strings. One byte strings are retained for pure ASCII strings.
  (The language specification was changed recently to reflect this as
   follows "A string is a sequence of UTF-16 code units").
- Remove four byte string class and all references to it.
- Rename some of the string functions in Dart API to make them
  consistent and better describe the underlying functionality
  Dart_NewString => Dart_NewStringFromCString
  Dart_NewString8 => Dart_NewStringFromUTF8
  Dart_NewString16 => Dart_NewStringFromUTF16
  Dart_NewString32 => Dart_NewStringFromUTF32
  Dart_NewExternalString8 => Dart_NewExternalUTF8String
  Dart_NewExternalString16 => Dart_NewExternalUTF16String
  Dart_NewExternalString32 => Dart_NewExternalUTF32String
  Dart_StringGet8 => Dart_StringToUTF8
  Dart_StringGet16 => Dart_StringToUTF16
  Dart_StringToCString => Dart_StringToCString
  Dart_IsString8 => Removed
  Dart_IsString16 -> Removed
  Dart_StringToBytes -> Removed
  Dart_StringGet32 -> Removed
Review URL: https://codereview.chromium.org//11318018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14357 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 17:56:46 +00:00
ager@google.com aac030e777 Use patching for dart:io.
This allows the tools such as dartdoc to operate on dart:io
in the same way as it does with other code and allows the
implemenation of parts of dart:io for dart2js if we ever
want to do that.

The current patching is very VM specific. I have only moved
stuff to patch files when they actually need to be. For
Process and Socket everything has to be moved because they
use native fields. For the rest, only the individual native
calls have been put in patch files.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14259 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 10:32:30 +00:00
asiva@google.com 6a0ea0d428 Simplify functions in Builtin class and get rid of unused code.
Review URL: https://chromiumcodereview.appspot.com//10911135

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12085 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-08 01:00:28 +00:00
lrn@google.com 978c3f6da6 Move dart:web to pkg:htmlescape.
Remove the dart:web library from the VM.
Remove reference to web library from libraries.dart.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12023 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 12:30:55 +00:00
kasperl@google.com 8db48e4171 Revert "Move dart:web to pkg:htmlescape."
This reverts r11943.

R=lrn@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11945 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 13:17:01 +00:00
lrn@google.com bd49eef27d Move dart:web to pkg:htmlescape.
Review URL: https://chromiumcodereview.appspot.com//10905125

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11943 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 12:54:59 +00:00
asiva@google.com 8aec37055a Rename Builtin::LoadLibrary to Builtin::LoadAndCheckLibrary as the name
LoadLibrary seems to conflict with some windows predefined macros causing
build failures on windows build of dartium.
Review URL: https://chromiumcodereview.appspot.com//10905102

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11894 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-05 18:49:07 +00:00
ager@google.com 178100ded4 Move print to corelib.
Allow embedder customization in the VM through a static field that can
be set by the embedder.

Mark failing test that is unrelated to this change. The VM does not
like when you import dart:core explicitly and tells you there both
'dart:core' and 'dart:core' define 'print'.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11603 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 11:31:30 +00:00
ager@google.com 2ad46b61fe Beginning support for library prefixes in the dart API.
This is a request for comments. Do we want to expose library
prefixes like this? Is there a way to import with a prefix already
and lookup members?

The reason why I would like to do this is so that I can import the
user-supplied builtins library under a prefix. This will be a useful
first step to move the print function to corelib while preserving
the ability to patch in a print implementation via the builtins
library.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11494 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 08:35:43 +00:00
efortuna@google.com f89032cd13 Add dart:web to VM.
Review URL: https://chromiumcodereview.appspot.com//10574037

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8993 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-21 17:11:02 +00:00
asiva@google.com 6ce890f75a 1. Restructure some of the builtin library processing code.
Review URL: https://chromiumcodereview.appspot.com//10388242

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8175 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-31 21:09:17 +00:00
turnidge@google.com 05b5d44b0e spawnUri. Take two. This time I'll wait for Anton before committing :-).
See original change 7756 for description.
Review URL: https://chromiumcodereview.appspot.com//10407042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7917 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-23 18:32:51 +00:00
turnidge@google.com 76d4586dea Revert my last change.
Review URL: https://chromiumcodereview.appspot.com//10332257

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7757 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 18:35:04 +00:00
turnidge@google.com 6a8c82db83 Implement spawnUri from dart:isolate. This function allows us to
launch an isolate running a different script.  Finally.

Reviewers: This isn't as hard to review as it looks.  Dive right in!

Siggi: Take a look at my test status file changes and make sure I'm
excluding the right stuff.

Much of the churn in the CL comes from moving ownership of the
import_map.  It used to be set per-library and is now set per-isolate.
This caused a lot of superficial diffs.

DART EMBEDDING API CHANGES:

- Dart_IsolateCreateCallback now takes a script_uri and main argument
  instead of a name_prefix argument.  The script_uri argument allows
  the callback to launch different scripts.  The main argument is used
  in creating the isolate debug name.

- Dart_CreateIsolate now takes script_uri and main arguments.  These
  are used to build the isolate's debug name.

- Dart_LibraryTagHandler, Dart_LoadScript, and Dart_LoadLibrary no
  longer take an import_map.

- Added Dart_SetImportMap.

- Added Dart_RootLibrary to provide access to the root library for the
  current isolate.

OTHER STUFF

Add a couple of tests for spawnUri -- the existing tests assume that
scripts end in a .js suffix which isn't going to work out for us.

Changed how the debug name for isolates get built a bit.

Refactored bin/main.cc a bit.  Fixed some problems with error handling
while creating isolates.

Minor refactoring in builtin.dart to always pass is_windows rather
than relying on it being squirreled away.
Review URL: https://chromiumcodereview.appspot.com//10386107

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7756 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 18:22:10 +00:00
ager@google.com b6e35655cf Make the crypto library an official dart:crypto library.
The library now works on dart2js and on the VM.

Add the library to the API docs and to the sdk.

R=iposva@google.com,dgrove@google.com,kasperl@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7604 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-14 11:20: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
sigmund@google.com ee6a907611 isolates refactor: this change introduces 'dart:isolate' as a library. This is a
big global change, so let me explain in more detail. This refactoring CL does
the following:
- moves all the dart code for isolates in a common library (lib/isolate)

- changes frog to understand 'dart:isolate' imoprts by loading the code from the
  location above.

- changes the vm to undernstand 'dart:isolate' imports by creating a separate
  library that is part of the bootstrap. This follows the same code-structure
  that Todd suggested in his CL introducing the mirror library

- changes dartc to use the shared isolate library as the source of truth for
  type checking. I left around some of the internal js code in dartc so that the
  backend continues to work for apps that don't use isolates.

- changes all tests that use isolates to import the library explicitly (this is a large bulk of the files in this CL)

- changes test status for tests we can't fix in this repo (e.g. co19)

- splits the isolate library code to make it possible to preserve some tests
  without exposing internal types (e.g. tests about
  serialization/deserialization)

- changes the create_sdk script to copy the isolate library to the sdk

- includes the isolate library in dartdoc

I'll wait for at least one lgtm from each area (dartc, vm, frog, sdk)

There is one important pending thing this CL doesn't do:
- update test_runner.dart: This should be updated next time we upload the new
  binaries to tool/testing/bin
- dartium specific changes: Vijay, is there anything I need to do for dartium?

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4647 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-27 22:50:44 +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 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
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
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
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
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
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
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
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