Commit Graph

13143 Commits

Author SHA1 Message Date
iposva@google.com 242a784291 - Revert r4135: va_copy is not available everywhere.
Review URL: https://chromiumcodereview.appspot.com//9381009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4136 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-10 17:08:22 +00:00
iposva@google.com 431e8329bb Fix http://dartbug.com/1133:
- Incrementally concat error messages to avoid hitting
  a maximum error message size.
Review URL: https://chromiumcodereview.appspot.com//9334007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4135 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-10 16:59:41 +00:00
srdjan@google.com 1d7d76a43b Optimizing code generator expects that every AST node is traversed once, i.e., the nodes are not reused. Unfortunately this is not the case in assignment operations with arrays (e.g. a[i] += 3).
The proper solution would be to clone array and index nodes but that would require too many changes. Long term we can't / won't use AST nodes for optimization purposes.
Short term fix is here: load array and index and release their CodeGenInfo before value is traversed so that the value computation can set its own CodeGenInfo on the same node.
Review URL: https://chromiumcodereview.appspot.com//9373025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4121 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-10 08:30:53 +00:00
regis@google.com 851682f104 Represent declared type parameters of a class as an array of TypeParameter
rather than an array of String and simplify code accordingly.
Rename the field holding type parameter bounds of a class.

Note: I retract my earlier suggestion to Srdjan to represent interfaces of a
class (as well as its canonical types) as a TypeArguments. This would require
more code to check for an empty array and for growing the array. Besides, these
are really arrays and have nothing to do with type arguments. I removed the
corresponding TODO(srdjan).
Review URL: https://chromiumcodereview.appspot.com//9368032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4096 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-09 21:28:53 +00:00
sgjesse@google.com ff0a266e7e Add support for big integers to the native message format
Also fixed snapshotting of negative big integers.

R=asiva@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4078 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-09 14:09:03 +00:00
sgjesse@google.com 61b3c7435c Add support for medium integers to the native message format
R=asiva@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4073 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-09 10:21:38 +00:00
sgjesse@google.com ff3c5e88f1 Add support for byte arrays to native messages
R=asiva@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4071 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-09 09:34:31 +00:00
sgjesse@google.com 3481c5661a Decode the Dart message into a Dart_CMessage structure before calling the native port callback
The native port callback is now passed the message as a decodes
Dart_CMessage structure. The Dart_CMessage structure is allocated
in a zone and the callback receiving it should expect the
lifetime to be controlled by the caller.

Added support for zones which do not require a current
isolate. Changed the GrowableArray to support allocating in
aprovided zone instead of the zone for the current isolate.

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

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4068 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-09 08:47:19 +00:00
sgjesse@google.com 2c57dd40bf Add integer min/max constants to globals.h
R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4024 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-08 09:22:46 +00:00
hausner@google.com b43152a477 Fix issue 1246
continue; inside a switch statement jumps to outer loop.

http://code.google.com/p/dart/issues/detail?id=1246
Review URL: https://chromiumcodereview.appspot.com//9347032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4013 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-07 23:27:51 +00:00
hausner@google.com b89e03ef16 Placate linux compiler
Review URL: https://chromiumcodereview.appspot.com//9349019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4000 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-07 16:40:38 +00:00
hausner@google.com dfee219860 Fix string escape, recognize escaped newline
Fix issue 1350 (http://code.google.com/p/dart/issues/detail?id=1350)
Review URL: https://chromiumcodereview.appspot.com//9346005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3999 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-07 16:37:24 +00:00
sgjesse@google.com 252323441b Move the thread local functions to the Thread class in runtime/platform
This gets rid of all the platform specific isolate_*.h and isolate_*.cc files.

R=asiva@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3982 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-07 09:18:22 +00:00
regis@google.com 598cfd27c2 Test again the library url in the error message shortened in r3965.
Review URL: https://chromiumcodereview.appspot.com//9340001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3973 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-06 22:45:05 +00:00
srdjan@google.com 4b3a6e1e57 Fixed a bug in isNegate intrinsified code, fixed negation for doubles (handling of negative zeros). Added tests. Fix issue 1554.
Factored out parts of X86Decoder::InstructionDecode in order to satisfy lint (500 lines max per function).
Review URL: https://chromiumcodereview.appspot.com//9338002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3971 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-06 22:16:44 +00:00
regis@google.com 2edb4ae9c7 Add token index position to classes and types for more accurate error reporting.
Review URL: https://chromiumcodereview.appspot.com//9325047

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3965 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-06 19:52:02 +00:00
sgjesse@google.com b6c9b6de24 Spelling corrections to the API header file
R=asiva@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3964 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-06 19:31:32 +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 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
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
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
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
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