Commit Graph

1120 Commits

Author SHA1 Message Date
mlippautz@google.com 94502c10ea Checks CObject lengths in native API.
Also converts the API to use intptr_t instead of a mixture of int64_t and int. Internally all variable length objects have lengths and maximum values represented as intptr_t (actually Smi ranges). In order to check for these maximum lengths we need to have a common type for 32 and 64 bit platforms.

Helping constructs like IOBuffer can still use 64bit lengths, but have to check that there values are actually in the domain of intptr_t as soon as internal objects are created.

Addresses issue 4314.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27395 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-11 16:56:12 +00:00
ajohnsen@google.com c6ef82b5c9 Polish the EventHandler cleanup in r26517.
BUG=
R=iposva@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27386 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-11 15:31:44 +00:00
ajohnsen@google.com 1cd800214f Always wait for child processes when forked, even if the process failed.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27384 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-11 14:29:23 +00:00
ajohnsen@google.com 6949a7bd08 Simplify process exit-code handling on Posix, take 2.
As in https://codereview.chromium.org/24024007, except the monitor->Wait
is now called in a loop with a guard, to ensure we actually do get notified.

Also, now correctly exiting the thread if we have no more child
processes, using the initialize/terminate mutex as guard.

BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27380 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-11 13:05:13 +00:00
ajohnsen@google.com 8fdf9b8ee6 Use correct output encoding in Process.runSync.
BUG=https://code.google.com/p/dart/issues/detail?id=13149
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27283 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-09 10:33:53 +00:00
ajohnsen@google.com bce63cccc9 Revert "Simplify process exit-code handling on Posix."
This reverts commit f1b1ba410e964b0f787513f245faf8b457c9331a.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27251 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-06 15:02:31 +00:00
ajohnsen@google.com 5e4135c731 Simplify process exit-code handling on Posix.
We now only use waitpid and not signals. When we exit, we perform a
small fork-and-exit to interrupt waitpid, so it can exit the thread.

BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27247 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-06 13:08:34 +00:00
whesse@google.com 7e7b95c04e Fix android build of runtime.
BUG=
R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27197 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-05 15:04:59 +00:00
ajohnsen@google.com 47239cb3a2 Move delete/deleteSync up to FileSystemEntity, with a shared documentation.
This also means that FileSystemEntity.delete(recursive: true) now will
delete any object on disk, much like 'rm -r', without the need of
wrapping it in a Directory object.

BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27196 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-05 14:54:38 +00:00
ajohnsen@google.com b8d9214b2c Be sure to enter monitor before notifying, in file_system_watcher_macos.
BUG=https://code.google.com/p/dart/issues/detail?id=13065
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27178 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-05 08:14:48 +00:00
sgjesse@google.com f235a79d0d Remove ASSERT which was reported as a race by ThreadSanitizer
R=whesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27131 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-04 13:52:59 +00:00
ajohnsen@google.com 7c53dfaf3f Make file system watcher compile on Mac OS 106, and add a runtime-call to test if the system supports the feature.
BUG=
R=kustermann@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27064 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 15:42:02 +00:00
ajohnsen@google.com 6c5229abda Move _FileSystemWatcher to IO patch since it extends NativeFieldWrapperClass1.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27051 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 13:13:36 +00:00
ajohnsen@google.com 38bae0af02 Add FileSystemWatcher class to dart:io.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27048 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 12:43:08 +00:00
hausner@google.com f82de66060 Evaluation of expression in context of library top-level
Third and final part of expression evaluation in the context
of an (object|class|library).

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26898 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-29 23:24:23 +00:00
floitsch@google.com 74da0c7286 Remove usage of dart:json.
R=jmesserly@google.com, lrn@google.com, nweiz@google.com, rnystrom@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26789 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 14:05:11 +00:00
floitsch@google.com 1887b5ca49 Some more removals of dart:utf.
R=jmesserly@google.com, lrn@google.com, nweiz@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26712 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-27 13:18:34 +00:00
sgjesse@google.com 264611807f Get rid of some downcasts
R=whesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26697 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-27 09:13:21 +00:00
hausner@google.com a105ba48fc JSON string decoding for VM debugger
The VM must properly decode JSON strings it receives.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26668 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 20:59:16 +00:00
whesse@google.com 6de4e020f2 Fix android compilation by copying process_linux.cc to process_android.cc.
These files, in runtime/bin, are the native functions supporting the dart:io
Process class.  The android version hadn't been updated when the linux version was changed.

BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26642 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 12:28:08 +00:00
floitsch@google.com 35d7140e66 Remove Encoding-enum from dart:io and add interface in dart:convert.
BUG= http://dartbug.com/6284
BUG= http://dartbug.com/7966
R=nweiz@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26632 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 10:37:25 +00:00
hausner@google.com 2642b1e522 Evaluate expression in the context of a class
Allows debugger to evaluate an expression in the context of a
static method of a class.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26617 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-23 22:42:41 +00:00
ajohnsen@google.com cf6578fafe Update ZLib/GZip in dart:io to be a Codec/Converter from dart:convert.
BUG=
R=floitsch@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26577 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-23 07:12:11 +00:00
ajohnsen@google.com 3dfe7c97e2 Always initialize the EventHandler in the standalone.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26517 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-22 12:03:59 +00:00
whesse@google.com 9de122a462 Add Platform.packageRoot and Platform.executableArguments to dart:io.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26432 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-21 15:21:55 +00:00
jacobr@google.com 605b33c1bc fix cpp11 compile errors
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26387 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-20 20:24:11 +00:00
hausner@google.com d62ea57f8e Evaluate expression in context of an object
This is the core functionality needed for the debugger.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26328 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-19 22:17:09 +00:00
kevmoo@j832.com 178afc3105 because Kasper cares
R=kasperl@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26286 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-16 18:04:48 +00:00
johnmccutchan@google.com f4a3de9d82 Fix absolute paths on Windows without a drive letter.
BUG=11946

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26201 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-15 16:53:25 +00:00
sgjesse@google.com affa849184 Remove the certificate management methods from dart:io
Certificate management functions where added to dart:io in r25610 and
r26002. However these functions where mutating the NSS database for
the whole Dart process, and some functions where also persisting the
changes to the database.

This might cause issues when running multiple isolates as changes in
one isolate will affect other isolates and could lead to unexpected
results.

These functions are removed from dart:io for now.

BUG=http://dartbug.com/8227
TBR=ager@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26194 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-15 14:55:53 +00:00
sgjesse@google.com a4e6a23195 Remove bogus Dart_ExitScope calls
When the Dart_EnterScope/Dart_ExitScope calls where removed some
Dart_ExitScope calls in error returns where not removed.

R=whesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26108 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-14 08:07:29 +00:00
sgjesse@google.com 7c98c1fc66 Fix Process.runSync on 64-bit Mac OS
Turned out that for poll on 64-bin Mac OS POLLIN set with 0 available
bytes means closed even though POLLHUP is not set.

Also slighty refactored the loop in the Linux version to make them
look the same.

R=whesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26057 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-13 15:56:47 +00:00
sgjesse@google.com 959456533f Add Process.runSync for running processes synchronously
BUG=http://dartbug.com/1707

R=whesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26052 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-13 14:12:31 +00:00
regis@google.com 9eb12ad303 Implement updated method overriding rules in the vm (issue 11495).
Introduce --error-on-bad-override flag and use it when generating snapshots.
Fix signature checking when patching methods.
Fix errors in patch files.
Fix receiver type of constructors.
Fix finalization of mixin application typedefs.
Update tests and status files.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26027 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-12 20:28:52 +00:00
whesse@google.com 292f34bdb3 dart:io | Add SecureSocket.importPrivateCertificates, that reads a PKCS#12 file.
Add private key with certificate to SecureSocket

BUG=
R=sgjesse@google.com, wtc@chromium.org

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26002 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-12 13:50:53 +00:00
cbracken@google.com a6ace331f3 Replaced strerror() calls with threadsafe strerror_r().
Mac/Android use the XSI-compliant definition of strerror_r() which stores the message in the passed-in buffer.

Linux uses the GNU-specific definition of strerror_r() which takes a buffer and returns the message in a char* (which may or may not be the passed-in buffer).

BUG=
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25943 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-08 20:24:05 +00:00
johnmccutchan@google.com 33d528a787 Remove race(s) in vmservice tests.
BUG=https://code.google.com/p/dart/issues/detail?id=12294
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25927 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-08 15:44:21 +00:00
sgjesse@google.com a1158d6c50 Make the values of Platform.executable and Platform.script available to all isolates
BUG=http://dartbug.com/12258

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25913 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-08 07:19:21 +00:00
cbracken@google.com 43fae66ebf Fixes to get Dart VM compiling on Ubuntu 13.04, Debian Wheezy.
* Convince gcc 4.7.x that len is initialized before use in callers of ReadFileFully()
* Cast RawObject* to intptr_t to avoid strict-aliasing error on gcc 4.7.x
* Replace two calls to strerror_r() with strerror() on Linux. When _GNU_SOURCE is
  defined to be non-zero (as it is on Dart Linux builds), strerror_r() is
  defined to return a char*, which is the correct error string to use. When
  _GNU_SOURCE is zero, the XSI-compliant definition is used and the error
  message is returned in the char* param. Surrounding error logging uses
  strerror() which solves the problem.
* Replace int literals with char literals in test string definition.
* co19 math/tan_A01_t01 passes on Ubuntu 13.04.

Original issues:
https://code.google.com/p/dart/issues/detail?id=12085
https://code.google.com/p/dart/issues/detail?id=8807

BUG=
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25890 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-07 17:28:04 +00:00
asiva@google.com b4d9e0d620 Auto create ApiLocalScope before calling native functions, this ensures that
native functions do not have to call Dart_EnterScope/Dart_ExitScope
when they callback into the VM.

Remove Dart_EnterScope/Dart_ExitScope calls around native functions in 'bin'
directory.

R=regis@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25827 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-06 19:27:48 +00:00
johnmccutchan@google.com f0ddab1af7 Cleanup vm_service library loading.
BUG=11927
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25744 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-02 21:40:13 +00:00
ajohnsen@google.com 7451cf3add Fix a Socket edge-case where the socket is closed by peer right after accept, where we havn't set a close-handler yet.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25732 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-02 13:12:24 +00:00
johnmccutchan@google.com 97ef50a1b2 Support stacktrace and objecthistogram service commands
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25726 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-02 00:24:09 +00:00
whesse@google.com acf2c86659 Fix sample_extension_test on 64-bit macos.
BUG=
R=kustermann@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25620 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-30 16:02:54 +00:00
whesse@google.com 9e27f1b98b Add SecureSocket.addCertificate.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25610 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-30 10:01:07 +00:00
kustermann@google.com a38ea2076d Fixed memory leaks in runtime/bin/dartutils.cc
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25608 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-30 07:13:33 +00:00
whesse@google.com e550079125 dart:io | Fix handling of exceptions from onBadCertificate callback.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25519 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-26 13:39:18 +00:00
ajohnsen@google.com 4b4f0307ba Add echo and line modes to Stdin.
BUG=https://code.google.com/p/dart/issues/detail?id=8190,https://code.google.com/p/dart/issues/detail?id=9825,https://code.google.com/p/dart/issues/detail?id=11659
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25413 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-24 13:51:55 +00:00
ajohnsen@google.com 2d43c9b0b8 Report correct socket error and use HttpServer:close future in pub.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25332 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-23 08:59:23 +00:00
johnmccutchan@google.com ea3a5cfb93 VM Service isolate listing
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25279 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-22 15:39:03 +00:00