Commit Graph

2925 Commits

Author SHA1 Message Date
asiva@google.com c71a8cc1ee Change dart frame and stub frame layout to include the PC of the code executing on the frame. The stack frame layout is as follows:
ret PC
  saved EBP                          <== EBP
  PC (used to locate RawInstruction) <== ESP
Review URL: https://chromiumcodereview.appspot.com//10375059

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7675 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-16 00:47:05 +00:00
regis@google.com 5d9dab620c Implement latest rules prohibiting some self referencing typedefs.
Update tests.
Review URL: https://chromiumcodereview.appspot.com//10377095

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7524 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-10 23:03:36 +00:00
srdjan@google.com 92b9e64375 Adding collected type feedback to the IL nodes (only in optimized mode).
Review URL: https://chromiumcodereview.appspot.com//10378093

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7509 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-10 19:04:09 +00:00
srdjan@google.com eaab5d38aa Fixed compilation time measurement, restructure some code. Do not use slow ToFullyQualifiedCString in production backend (saves 10% in backend time with compile-all).
Review URL: https://chromiumcodereview.appspot.com//10389023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7435 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-09 00:03:25 +00:00
regis@google.com a1fcd03ca6 Allow self referencing typedefs (issue 2490).
Fix Type::Name for malformed function types (issue 2340).
Added tests.
Removed bad negative test.
Review URL: https://chromiumcodereview.appspot.com//10388019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7422 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-08 16:27:43 +00:00
regis@google.com c609c03cc2 Stop postponing instantiation of Type and remove InstantiatedType VM class.
Review URL: https://chromiumcodereview.appspot.com//10380019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7389 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-07 17:34:53 +00:00
srdjan@google.com 318742e413 Inline type checks for complex uninstantiated types, e.g., List<T>.
Review URL: https://chromiumcodereview.appspot.com//10317026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7353 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 23:28:26 +00:00
cshapiro@google.com 1472427af8 Revert "Revert "Implement {Int,Uint}{8,16,32,64} and Float{32,64} typed arrays.""
This reverts commit 63480a81fccbde001494dd535cd06a8fa02ed261.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7352 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 23:16:09 +00:00
regis@google.com 5e99edcea7 Properly set the element type of literal lists.
Add test.
Keep element type consistent between growable array and backing array.
Fix snapshot reader to set the element type in growable array
Remove run time call checking rest argument.
Review URL: https://chromiumcodereview.appspot.com//10368004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7337 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 16:36:27 +00:00
cshapiro@google.com 3a14326da4 Revert "Implement {Int,Uint}{8,16,32,64} and Float{32,64} typed arrays."
This reverts commit 747dbeaa8f9c0dc1f49d6d6a369c6a3fe2d8b7c9.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7313 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 05:28:10 +00:00
cshapiro@google.com 537010ea16 Implement {Int,Uint}{8,16,32,64} and Float{32,64} typed arrays.
Internal and external representations of each array are provided.  A
single interface type implementing the ByteArray and List interfaces
is shared among the internal and external implementation type.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7311 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 05:12:19 +00:00
srdjan@google.com 6fc1247bb6 Using SubtypeTestCache object instead of an array, that way we do not need to patch and can communicate to type tests if there is a cache to update (quicker than looking up code).
Review URL: https://chromiumcodereview.appspot.com//10352012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7304 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-03 22:00:52 +00:00
regis@google.com 7793191032 Check upper bounds of type arguments when allocating objects of a generic type
at run time when they cannot be checked at compile time.
Review URL: https://chromiumcodereview.appspot.com//10280007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7211 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-02 01:57:22 +00:00
iposva@google.com 4d3c2b94a2 - Add extra checking when validating objects.
- Properly set the class tags when converting growable arrays
  to fixed length arrays.
- Set the class tag when allocating instantiated type arguments. 
Review URL: https://chromiumcodereview.appspot.com//10271032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7190 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-01 15:16:02 +00:00
iposva@google.com d8c7c1ada6 - Add a class index to the classes.
- Add a class table which assigns individual ids to classes.
Review URL: https://chromiumcodereview.appspot.com//9965042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7183 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-01 09:20:40 +00:00
asiva@google.com 09adb99a85 Add a stub_code_space in the heap alongside code_space so that stub code generation happens here and it is easy to determine if a PC is a stub code or not.
This gets rid of the temporary change made in code_generator.cc for fast access to the top dart frame. In addition it will not pollute the pc ==> code cache that I plan to add next as we don't have to store stub pcs in that table.
Review URL: https://chromiumcodereview.appspot.com//10223015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7033 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-26 18:00:53 +00:00
iposva@google.com 843a339045 - Improve marking performance by pre-marking RawInstructions objects,
since they are not currently being collected.
- Update svn:ignore properties.
Review URL: https://chromiumcodereview.appspot.com//10232003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6993 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-26 08:05:41 +00:00
srdjan@google.com dc17b7338f Canonicalize type arguments lazily.
Review URL: https://chromiumcodereview.appspot.com//10161030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6973 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-25 20:32:45 +00:00
srdjan@google.com be4b479d8b Revert change 6946.
Review URL: https://chromiumcodereview.appspot.com//10191020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6953 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-25 15:43:44 +00:00
srdjan@google.com b34787b742 Progress toward inlined type checks for classes with type arguments: factor out code, optimize type arguments of an instance.
Review URL: https://chromiumcodereview.appspot.com//10209002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6946 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-25 15:21:40 +00:00
regis@google.com efa92f5447 Mark types as instantiated or uninstantiated upon finalization.
Review URL: https://chromiumcodereview.appspot.com//10205006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6894 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-24 16:15:37 +00:00
regis@google.com 0148376aa9 Provide better ToCString description for closures (issue 2680).
Thanks to Ladislav Thon for the suggestion!
Review URL: https://chromiumcodereview.appspot.com//10188004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6861 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-23 20:15:43 +00:00
regis@google.com ac6cb8cb66 Map malformed function result type and malformed function parameter type to
Dynamic in production mode (fix issue 5532534).
Fix bad negative test and make it positive.
Review URL: https://chromiumcodereview.appspot.com//10143004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6777 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 22:59:58 +00:00
turnidge@google.com 9e2c641658 Remove the deprecated method invocation and field access apis from the
dart embbedding api.  Use the new apis instead.

Fixed a bug where field/function lookup was failing for imported libs.
Added tests.  Had to add a couple of lookup functions to Library.

Fixed a bug in Dart_Invoke -- it wasn't handling a null receiver
correctly.
Review URL: https://chromiumcodereview.appspot.com//10021072

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6769 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 21:04:15 +00:00
asiva@google.com a61ffc6210 Fix a pretty blatant GC bug (was the cause of all the weird crashes on windows).
Review URL: https://chromiumcodereview.appspot.com//10025033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6726 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 05:30:30 +00:00
asiva@google.com d807f2a7dd Initialize tags back to 0 before using it.
Review URL: https://chromiumcodereview.appspot.com//10021046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6711 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-18 21:50:15 +00:00
hausner@google.com 475fbca314 Implement implicit interfaces
Amazingly, this small change is all it seems to take to implement
implicit interfaces.
Review URL: https://chromiumcodereview.appspot.com//10103009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6607 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-16 22:21:54 +00:00
turnidge@google.com e5022d70d4 Add fast paths for Smi values in the dart embedding api.
This speeds up the UseDartApi microbenchmark by 30%.  Thanks to Carl
for suggesting this.
Review URL: https://chromiumcodereview.appspot.com//10052027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6602 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-16 20:30:37 +00:00
regis@google.com 85e4a9c054 Do not require type class to be finalized when performing a type test.
However, make sure that the interfaces are resolved (issue 2523).
A later change will cleanup interface resolution code.
Review URL: https://chromiumcodereview.appspot.com//10050034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6446 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-12 00:18:43 +00:00
regis@google.com 113c4b6626 Add missing calls to class finalizer in various tests.
Make 'sentinel' and 'transition_sentinel' instances of class Null.
Review URL: https://chromiumcodereview.appspot.com//10034019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6421 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-11 18:12:28 +00:00
srdjan@google.com d154a7ffce Try/catch in new compiler. Added try index to appropriate instructions. If any instruction throws an exception, the try index tells us which catch entry the exception belongs to.
Review URL: https://chromiumcodereview.appspot.com//10014006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6389 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-10 23:22:40 +00:00
asiva@google.com 8f208ad7ca Wire GrowableArray to use the internal VM object.
This also fixes issue (5526318 : Make access to GrowableArray objects through the dart api more efficient)
Review URL: https://chromiumcodereview.appspot.com//10012042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6341 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-09 21:50:53 +00:00
asiva@google.com 2d3775a1b1 Resubmit change 6302 after fixing the compiler warning on older GCC compiler versions:
Change 6302 description:
- Wire the stack frame iterator to use stack maps for traversing objects if
there are stack maps in the code object. If there are no stack maps it still
does the old style stack frame traversal between fp and sp looking for tagged
pointers.
- Added a mechanism to be able to iterate over the code space and look for a
particular object.
Review URL: https://chromiumcodereview.appspot.com//10030001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6331 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-09 18:20:23 +00:00
asiva@google.com c79da818cc Revert change 6302 until the compiler warning is addressed.
Review URL: https://chromiumcodereview.appspot.com//10025003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6304 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-07 02:04:28 +00:00
asiva@google.com c27cec5b6e - Wire the stack frame iterator to use stack maps for traversing objects if there are stack maps in the code object. If there are no stack maps it still does the old style stack frame traversal between fp and sp looking for tagged pointers.
- Added a mechanism to be able to iterate over the code space and look for a particular object.

- Remove registration of code objects into the code index table.
Review URL: https://chromiumcodereview.appspot.com//9791048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6302 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-07 01:44:48 +00:00
srdjan@google.com 1125846660 When checking against non-parametrized types use a cache to hold result tuples (class, result). That cache is stored in the instruction stream. Currently implemented for instanceof, ia32 only. Should migrate to other type tests and architectures.
70x improvement on a benchmark (similar to what is seen in html _unwrap).
Review URL: https://chromiumcodereview.appspot.com//10010029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6281 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-06 16:05:55 +00:00
regis@google.com 9ff0afa50e Do not require upper bounds to be resolved and finalized before comparing them
between the expected and actual factory class (issue 2431).
Add test.
Review URL: https://chromiumcodereview.appspot.com//10008017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6236 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-05 18:11:42 +00:00
turnidge@google.com e610ab662b Revert my last change due to problems on other platforms.
Review URL: https://chromiumcodereview.appspot.com//9968088

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6129 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-03 17:51:20 +00:00
turnidge@google.com 11d29be5e1 Detect recursion during compilation of const constructors.
We now give a message like this:

    Illegal recursion in const constructor 'A.'.
Review URL: https://chromiumcodereview.appspot.com//9965081

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6128 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-03 17:32:39 +00:00
regis@google.com 5282e44fb2 Use null type argument vector instead of vector of Dynamic for a generic raw
type when possible.
Fix type finalization of type parameters (always finalize in the context of the
class being parameterized and not in the enclosing class where the type
parameter is used).
Fix wrong generic optimization and added a test (a generic type instantiated
from a raw instantiator is not always raw).
Added printing of type argument vectors.
Review URL: https://chromiumcodereview.appspot.com//9939003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6068 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-30 22:16:52 +00:00
srdjan@google.com f1bad6571d Improve checked mode a little (more to come in a different CL).
Review URL: https://chromiumcodereview.appspot.com//9854030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5847 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-26 18:23:37 +00:00
hausner@google.com 356870a3c8 Stop ignoring compilation errors on compile_all
When compiling all code, stop compiling after the first error.
Previously, we ignored compilation errors.

This was a feature wish so we can detect errors in libraries.
In fact, there are errors in the library, e.g. references
to non-existing top-level functions in utf16 code. And possibly
others. If this code gets checked in, any tests that depends on
--compile_all will break.

First problem:

'dart:utf': Error: line 607 pos 7: identifier 'is16BitCodeUnit' is not declared in this scope
  if (is16BitCodeUnit()) {
      ^

If I hack that, the next one is:

'dart:utf': Error: line 613 pos 9: identifier 'utf16CodeUnitsToCodepoints' is not declared in this scope
        utf16CodeUnitsToCodepoints(codeunits, 0, null, replacementCodepoint));
        ^

Didn't investigate any more than that...
Review URL: https://chromiumcodereview.appspot.com//9836064

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5835 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-26 15:51:25 +00:00
asiva@google.com d0d0cec4fc Fix for issue 2233
- Fixed the bigint instance allocation path when full snapshots are read.

- JSRegExp objects are only serialized/deserialized in a message snapshot and
hence do not need that special path. There is an assertion in JSRegExp to
ensure that these objects are not part of a full snapshot.
Review URL: https://chromiumcodereview.appspot.com//9835074

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5802 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-24 02:42:56 +00:00
asiva@google.com e360e4d1c9 Second set of changes for implementation of stack map support.
- Added functionality to be able to build stack maps in the compiler and register them into the Code object during Code finalization.
- Merged code_generator_ia32_test.cc and code_generator_x64_test.cc into code_generator_test.cc as the two files were identical.
Review URL: https://chromiumcodereview.appspot.com//9721006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5764 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-23 01:27:35 +00:00
hausner@google.com feafdf0e06 Properly recognize closures when setting breakpoints
Local functions and function literals are unknown to the VM
until the enclosing function is compiled. This change introduces
a list of known closures per class, and a function to look up
the innermost closure at a given token index.

The debugger now checks whether there are newly discovered
closures when a function containing a pending breakpoint is
compiled. If necessary, the breakpoint is set to the inner
function.
Review URL: https://chromiumcodereview.appspot.com//9716004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5599 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-16 22:28:57 +00:00
asiva@google.com 9ca9e8fbd4 Fix for issue 2124 - Dart VM crashes on windows
The Array::MakeArray was incorrectly accessing the class_ field before it was initialized.
Review URL: https://chromiumcodereview.appspot.com//9700079

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5552 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-16 03:58:06 +00:00
asiva@google.com f120af8463 First step towards implementing stack map descriptions for the optimizing compiler.
Add a RawBitmap object and a bitmap builder.
Review URL: https://chromiumcodereview.appspot.com//9701010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5502 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-15 00:18:05 +00:00
cshapiro@google.com f4c5dd4db3 Implement prologue weak persistent handles.
Prologue weak persistent handles are similar to weak persistent
handles but exhibit different behavior during garbage collections that
invoke the prologue and epilogue callbacks.  While weak persistent
handles always weakly reference their referents, prologue weak
persistent handles weakly reference their referents only during a
garbage collection occurs that invokes the prologue and epilogue
callbacks.  During all other garbage collections, prologue weak
persistent handles strongly reference their referents.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5445 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 23:41:59 +00:00
turnidge@google.com e61a02c10d Implement spawnFunction from the new isolate api.
Still need to implement spawnUri, which will be the more difficult one.
Review URL: https://chromiumcodereview.appspot.com//9691005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5441 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 22:05:08 +00:00
regis@google.com d74c2008be Fix type check to perform a subtype test at top level instead of an
assignability test. This only makes a difference when assigning an instance of
a function type.
Fix a bad language test.
Disable a bad co19 test (issue 99 filed).
Change error message for dynamic type error.
Review URL: https://chromiumcodereview.appspot.com//9664029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5413 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 16:16:12 +00:00