iposva@google.com
e100129f8e
- Use canonicalized type of non-parameterized classes when
...
available.
- Do not attempt to make types for objects of Context.
R=fschneider@google.com , regis@google.com
Review URL: https://codereview.chromium.org//102053010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31194 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-17 16:59:14 +00:00
fschneider@google.com
9031c80c88
Change == into an instance call to allow polymorphic inlining of ==.
...
In unoptimized code equality is now just another instance call.
The optimizer replaces it with a specialized implementation based on static
type information and type feedback.
Many of the manual optimizations of == in the optimizer are now just handled
by the generic inliner, plus polymorphic inlining of == calls is now possible.
This also eliminates the need for a lot of duplicated code in the backend.
I adapted the inlining heuristics to compensate for the slightly larger
inital flow graph size.
Review URL: https://codereview.chromium.org//27307005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29800 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-04 11:32:52 +00:00
regis@google.com
9ec07853c5
Report correct error message in case of super invocation (fix issue 8208).
...
R=hausner@google.com
Review URL: https://codereview.chromium.org//30533004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29042 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-22 22:12:07 +00:00
regis@google.com
5a5edb7f0c
Report use of malbounded interface in type test.
...
Fix language tests related to malbounded types (issues 14123, 14131, 14132).
R=rmacnak@google.com
Review URL: https://codereview.chromium.org//33313003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28943 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-21 19:49:19 +00:00
srdjan@google.com
1676113897
Fix runtimeType for strings, integers and double: return their interface type.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//25674017
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28286 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-04 22:08:55 +00:00
iposva@google.com
f1583dec18
- More use of pre-allocated read-only handles.
...
R=zra@google.com
Review URL: https://codereview.chromium.org//23510006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27490 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-13 16:55:57 +00:00
kmillikin@google.com
4f80ef09df
Change Bool::Get to return a handle instead of a pointer to a raw object.
...
Replace occurrences of 'expr ? Bool::True() : Bool::False()' with simply
'Bool::Get(expr)' and analogously for its negation. The pointer to the raw
object can still be extracted with 'Bool::Get(expr).raw()'.
R=iposva@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//23480005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26770 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 08:38:56 +00:00
regis@google.com
3b7cdf80a0
Update VM to handle malformed types according to revised spec (issues 9055,
...
12105, 7247).
Update language tests.
Update status files.
Allow map literals to specify a key type that is not a String.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//21049012
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25666 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-31 15:20:28 +00:00
srdjan@google.com
cbb9d76c4b
Fix wrong type test optimization when testing against a signature class: we must always consider the instance type arguments as well. FIxes failing tests when run with --optimization-counter-threshold=5.
...
R=regis@google.com
Review URL: https://codereview.chromium.org//18807007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24961 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-12 17:31:19 +00:00
iposva@google.com
56b0fc10a7
Reland r24563 and r24564 with fixes cumbersome API leading to leaks.
...
- Add a WeakTable to the VM. This is used to remember the
native peers registered through the Dart C API as well
as assigning identity hashcodes to objects when needed.
- Use the hashcode to lookup entries in the Expando.
Review URL: https://codereview.chromium.org//18826007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24822 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-08 21:41:05 +00:00
iposva@google.com
fb06bcdff3
- Revert r24564 and r24563 due to unexplained malloc corruption.
...
Review URL: https://codereview.chromium.org//18051007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24565 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-28 00:27:25 +00:00
iposva@google.com
9c9989d2f6
- Add a WeakTable to the VM. This is used to remember the
...
native peers registered through the Dart C API as well
as assigning identity hashcodes to objects when needed.
- Use the hashcode to lookup entries in the Expando.
R=asiva@google.com
Review URL: https://codereview.chromium.org//17992002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24563 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-28 00:01:47 +00:00
iposva@google.com
e24d83c10d
- Add a GetClassId() to Object, so that we do not have to
...
create a temporary class handle only to get at an object's
class id, which is stored in the object header.
R=asiva@google.com
Review URL: https://codereview.chromium.org//15338008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22904 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-20 21:01:31 +00:00
srdjan@google.com
7797d39362
Added Object._cid getter, optimized it. Added to (some) classes a static final _clCid. Use those to test for exact type in VM's libraries.
...
R=iposva@google.com
Review URL: https://codereview.chromium.org//14703005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22695 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-14 18:16:44 +00:00
srdjan@google.com
706e79d074
Fix error reporting when calling static methods and closures withh mismatched arguments.
...
Closures BEFORE:
----
Unhandled exception:
Class '(dynamic, dynamic, dynamic) => dynamic' has no instance method 'call'.
NoSuchMethodError : method not found: 'call'
Receiver: Closure: (dynamic, dynamic, dynamic, dynamic) => dynamic from Function 'foo':.
Arguments: [2]
Closures NOW:
----
Closure call with mismatched arguments: function 'A.foo'
NoSuchMethodError: incorrect number of arguments passed to method named 'A.foo'
Receiver: Closure: (dynamic, dynamic, dynamic, dynamic) => dynamic from Function 'foo':.
Tried calling: A.foo(2)
Found: A.foo(a, b, c)
Statics BEFORE:
----
Unhandled exception:
No top-level method 'foo' declared.
NoSuchMethodError : method not found: 'foo'
Receiver: Type: class '::'
Arguments: []
Statics NOW:
----
Unhandled exception:
No top-level method 'foo' with matching arguments declared.
NoSuchMethodError: incorrect number of arguments passed to method named 'foo'
Receiver: top-level
Tried calling: foo(...)
Found: foo(a, b, c)
R=regis@google.com
Review URL: https://codereview.chromium.org//14652008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22209 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-30 22:05:14 +00:00
srdjan@google.com
60e57ecfe1
Optimizes 'as' operation in similar way as 'instanceof': collect type feedback in unoptimized mode and try to convert it to a simple classcheck in optimized code.
...
Review URL: https://codereview.chromium.org//13190014
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20783 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-02 15:30:14 +00:00
iposva@google.com
c900112af7
- Improve the message for NoSuchMethodErrors that are
...
determined statically at compile time.
Review URL: https://codereview.chromium.org//12328019
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18848 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 18:53:27 +00:00
regis@google.com
47e08870ca
Support Null type in Class::TypeTest and simplify Instance::IsInstanceOf.
...
Review URL: https://codereview.chromium.org//11785006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16664 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-05 00:45:52 +00:00
asiva@google.com
4c069867e4
- Make Boolean 'true' and 'false' singleton VM isolate objects.
...
- Change all uses of it
Review URL: https://codereview.chromium.org//11745022
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16623 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-04 01:52:05 +00:00
srdjan@google.com
29e06db609
In unoptimized code use call for instanceof instead of inlined checks. This allows us to collect type feedback and to reduce the code size of unoptimized code. Next will be work on type tests as well.
...
Review URL: https://codereview.chromium.org//11694003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16589 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-02 22:22:39 +00:00
tball@google.com
929344a574
Issue 7549: fix for invalid runtimeType.toString() for int, double, and
...
string constants.
Review URL: https://codereview.chromium.org//11624034
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16516 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-27 18:08:16 +00:00
asiva@google.com
8af296c9c8
Cleanup the exceptions create code to use Arrays instead GrowableArrays so
...
that it is consistent with the DartEntry invoke code that it calls finally.
Review URL: https://codereview.chromium.org//11639007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16295 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-18 23:47:35 +00:00
regis@google.com
3b1dfe51d1
Pass the proper invocation mirror argument to noSuchMethod.
...
Review URL: https://codereview.chromium.org//11523002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15939 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-11 00:31:53 +00:00
regis@google.com
dd6a0ec349
Rename GET_NATIVE_ARGUMENT macro to GET_NON_NULL_NATIVE_ARGUMENT.
...
Introduce new GET_NATIVE_ARGUMENT macro accepting null.
Add test.
Review URL: https://codereview.chromium.org//11468016
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15919 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-10 17:59:40 +00:00
lrn@google.com
22309b260c
Remove NullPointerException.
...
Accessing non-existing members on null now throws NoSuchMethodError.
Throwing a null value fails by throwing a NullThrownError.
Methods checking for null now generally throw new ArgumentError(null).
Committed: https://code.google.com/p/dart/source/detail?r=15061
Review URL: https://codereview.chromium.org//11415028
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15136 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-20 09:21:52 +00:00
lrn@google.com
0c8dce77f1
Revert "Remove NullPointerException."
...
Crashes in the x64 VM.
Review URL: https://codereview.chromium.org//11417058
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15065 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-19 09:59:59 +00:00
lrn@google.com
e211c2f0ee
Remove NullPointerException.
...
Accessing non-existing members on null now throws NoSuchMethodError.
Throwing a null value fails by throwing a NullThrownError.
Methods checking for null now generally throw new ArgumentError(null).
Review URL: https://codereview.chromium.org//11415028
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15061 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-19 08:51:49 +00:00
hausner@google.com
7eb3efc2ba
Fix native argument handling
...
Native functions need to fetch arguments differently if they are
called through a closure.
fixes issue 6696.
Review URL: https://codereview.chromium.org//11293290
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14937 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-15 01:14:01 +00:00
lrn@google.com
a8720a6d9c
Change signature of noSuchMethod to take an InvocationMirror.
...
Requires VM and dart2js/dart2dart changes to work.
Committed: https://code.google.com/p/dart/source/detail?r=14198
Committed: https://code.google.com/p/dart/source/detail?r=14254
Review URL: https://codereview.chromium.org//11231074
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14324 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 10:32:54 +00:00
lrn@google.com
895d155ab1
Revert "Change signature of noSuchMethod to take an InvocationMirror."
...
TBR=ager@google.com
Review URL: https://codereview.chromium.org//11339042
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14260 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 10:47:42 +00:00
lrn@google.com
4a24ddc1d4
Change signature of noSuchMethod to take an InvocationMirror.
...
Requires VM and dart2js/dart2dart changes to work.
Committed: https://code.google.com/p/dart/source/detail?r=14198
Review URL: https://codereview.chromium.org//11231074
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14254 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 10:04:12 +00:00
lrn@google.com
778b0dc5e5
Revert "Change signature of noSuchMethod to take an InvocationMirror."
...
TBR=floitsch@google.com
Review URL: https://codereview.chromium.org//11336011
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14199 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-29 14:07:10 +00:00
lrn@google.com
0bcd2f4f7b
Change signature of noSuchMethod to take an InvocationMirror.
...
Requires VM and dart2js/dart2dart changes to work.
Review URL: https://codereview.chromium.org//11231074
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14198 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-29 13:34:58 +00:00
iposva@google.com
b85f604f66
- Implement first class types in the VM.
...
- Make AbstractType a subclass of Instance and map it and its subclasses
to private Dart classes in dart:core implementing the Type interface.
- Avoid dispatching through statics in Object if not strictly needed.
Review URL: https://codereview.chromium.org//10979058
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12981 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-27 21:19:00 +00:00
regis@google.com
e860f819a0
Limit the maximum number of formal parameters (32K fixed and 32K optional)
...
in order to save space in function objects.
Naming cleanup.
Review URL: https://codereview.chromium.org//10928160
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12288 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 23:35:05 +00:00
regis@google.com
9e00bd8ccb
Implement argument definition test in the vm.
...
Add tests.
Various cleanups.
Review URL: https://chromiumcodereview.appspot.com//10915022
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11664 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 22:46:44 +00:00
turnidge@google.com
14f614da12
Use the return value of vm native methods to set the return value,
...
based on Siva's earlier suggestion (he actually suggested putting it
in the generated stub, which I haven't done).
Added SetReturnUnsafe and use it exactly one place so far.
Review URL: https://chromiumcodereview.appspot.com//10874072
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11633 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 17:41:19 +00:00
srdjan@google.com
037cfcf849
Add optional arguments to NullPointerException so that it can report more information (make it similar to what is reported by NoSuchMethodException):
...
NullPointerException : method: 'foo'
Receiver: null
Arguments: [1, 2]
Review URL: https://chromiumcodereview.appspot.com//10034026
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6429 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-11 19:58:45 +00:00
srdjan@google.com
c097795d6e
Improve repoorting of NoSuchMethod:
...
NoSuchMethodException: incorrect number of arguments passed to method named 'foo'
Receiver: Instance of 'A'
Tried calling: foo(5, 6, 7)
Found: foo(b, c)
Review URL: https://chromiumcodereview.appspot.com//9317099
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3960 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-06 18:05:16 +00:00
srdjan@google.com
19c79a3660
If programmer mistakes the number of arguments, VM throws noSuchMethod. Extend reporting to report correct number/name of arguments if a method with the same name exists. Example:
...
NoSuchMethodException - receiver: 'Instance of 'A'' function name: 'foo' arguments: [1]]
Found 'foo(alpha, beta, message)'
0. Function: 'Object.noSuchMethod' url: 'bootstrap' line:647 col:3
1. Function: '::main' url: '/sources/chinstrap/dart/runtime/Test.dart' line:8 col:8
Review URL: https://chromiumcodereview.appspot.com//9307074
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3911 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-03 17:13:09 +00:00
srdjan@google.com
59b79d8171
Fix more co19 crashes. Introduce GET_NATIVE_ARGUMENT that throws an illegal argument exception if the native argument is of incorrect type.
...
Review URL: http://codereview.chromium.org//8476002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1205 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-04 16:30:29 +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