Commit Graph

2008 Commits

Author SHA1 Message Date
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
rmacnak@google.com 303a29b5ba Move Null class out of the VM isolate.
BUG=http://dartbug.com/12071
BUG=http://dartbug.com/12128
BUG=http://dartbug.com/12319
BUG=http://dartbug.com/12337
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25982 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-09 21:54:30 +00:00
zra@google.com 5c3c549300 Allows compiler bailout to handle errors of any type.
R=asiva@google.com, iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25974 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-09 19:51:11 +00:00
rmacnak@google.com fe85bf84bb Reflection on generics.
BUG=
R=ahe@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25942 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-08 20:06:56 +00:00
srdjan@google.com ecd28e626a Fix Issue 12322: the analysis requires stored guarded_cid to be returned when requested; only when computing result of LoadField instruction should we not trust guarded_cid for externalizable cids.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25938 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-08 18:31:53 +00:00
cbracken@google.com b93ed6b1e6 Cleanup: Use array syntax instead of pointer arithmetic
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25929 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-08 16:40:45 +00:00
srdjan@google.com 1b12859a7e Implement IsNullCheck for CheckClassInstr. If input is nullable expected type, then check for null only.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25907 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-07 23:01:43 +00:00
srdjan@google.com 0cabd24ae6 Do not use guarded cid on externalizable cid-s (one and two byte strings). An externalizable object can change its type on the fly and therefore we cannot rely on the information obntained while storing into the field.
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25893 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-07 18:56:48 +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
srdjan@google.com c891612920 Adapt Random class to be able to run in javascript integer compatibility mode.
R=asiva@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25753 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-02 23:07:55 +00:00
rmacnak@google.com 6ab88ae6d5 Implement metadata for libraries. Partially addresses issue 10906.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25721 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-01 20:45:49 +00:00
regis@google.com 4c90984b43 Set local function type as uninstantiated when applicable (fix issue 12127).
Add language regression test.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25687 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-31 23:26:26 +00:00
zra@google.com 42add423d2 Fixes javascript integer overflow check.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25675 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-31 17:51:23 +00:00
mlippautz@google.com c5c6df3548 BUG=
R=asiva@google.com, rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25651 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-30 22:57:59 +00:00
srdjan@google.com 14a3cb0cfd Make sure that ICData always contains valid data (non-null values).
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25535 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-26 20:17:04 +00:00
mlippautz@google.com db8354cd4b Inline CreateParameterMirrorList() functionality.
BUG=
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25450 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-24 23:35:15 +00:00
srdjan@google.com 849e8b0385 Make sure that all objects store in the Code object live in old space.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25353 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-23 18:38:03 +00:00
regis@google.com 9581071936 Refactor resolution code in the vm to properly handle ambiguity errors.
Add test.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25324 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-23 00:19:39 +00:00
rmacnak@google.com 9c4fef756b Implement VariableMirror creation with non-API code. To break circular initialization, have them find their type lazily.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25317 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-22 23:05:54 +00:00
mlippautz@google.com b58e38269b This change introduces nothing new. It only fixes the native entrypoints to use the right macros.
BUG=
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25315 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-22 22:49:08 +00:00
mlippautz@google.com b3cb27a829 Since returnType is represented by a mirror, we make it lazy. We do not use a lazy mirror anymore, but instead create a type mirror upon first access.
CreateTypeMirror is already factored out of MethodMirror_return_type since it is needed by others mirrors (future CLs). Also introduces CreateMirror() which will be used in future CLs.

BUG=
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25252 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-19 23:17:47 +00:00
regis@google.com fc8308a4f0 Allow the optimizer to canonicalize instantiated function types (issue 11775).
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25056 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-16 16:35:55 +00:00
regis@google.com 191d2673c8 Use proper internal name for implicit static final getters.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25053 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-16 16:29:59 +00:00
fschneider@google.com dfd21c06e0 Change resolving of instance methods to check early for name mismatch.
The names of actual arguments are checked at resolving time
for a mismatch instead of deferring this check to the function
prologue (emitted as part of the CopyParameters() prologue).

For example:

class A {
  foo({a:42}) => null;
}

main() {
  var a = new A();
  a.foo(b:123);  // noSuchMethod: no named parameter named "b".
}

This enables e.g. fast noSuchMethod invocation in the case
of a named argument mismatch.

It also makes the function prologue for instance functions that
use optional parameters shorter by omitting the check for a 
name mismatch there.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25041 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-16 09:38:13 +00:00
fschneider@google.com 13b7b7242a Faster invocation of fields as methods.
Until now there was a large discrepancy between

x.f() and
(x.f)()

This CL makes x.f() as fast as (x.f)() by automatically
generating  a intermediate dispatcher function that loads
the field and invokes the result as a closure.

The approach resembles the one taken for fast noSuchMethod
invocation and reuses the same per-class cache
of dispatcher functions.

It also fixes a bug in the debugger so that VM-generated 
implicit dispatcher functions (like for noSuchMethod, or
field-as-method invocation) don't show up the debuggers
stack trace.

BUG=https://code.google.com/p/dart/issues/detail?id=11041
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25001 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-15 11:12:09 +00:00
hausner@google.com 4c629b9b50 Implement forwarding constructors for mixins
By popular demand, fixes issue dartbug.com/9339

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24977 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-12 22:09:18 +00:00
srdjan@google.com 46c46f5c62 List class was not initialized properly (it has type parameters). Do not preinitialize it incorrectly, instead let it be loaded and finalized the normal way.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24922 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-11 17:32:16 +00:00
fschneider@google.com f260416fb8 Support fast noSuchMethod dispatch for any number of arguments.
Until now, the fast dispatch was only available with getters and
zero argument methods.

This CL generalizes the approach to any number of arguments. The
dispatcher functions that are auto-generated by the compiler
are not attached to the class anymore. Instead the dispatcher
is only stored in the IC data of each call site. Each class
contains a cache of dispatcher function that map
(name, arguments descriptor) => dispatcher.

This also fixes a bug where the VM report a wrong error message
when throwing a NoSuchMethodError.

BUG=https://code.google.com/p/dart/issues/detail?id=11528
BUG=https://code.google.com/p/dart/issues/detail?id=11223
TEST=tests/language/no_such_method_dispatcher_test.dart
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24876 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-10 10:09:14 +00:00
regis@google.com e8a722870b Support type parameters and classes as expression in the vm.
Turn many compile-time errors into runtime errors per latest spec.
Triage affected tests.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24861 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-09 19:35:56 +00:00
johnmccutchan@google.com 0ba453b4b6 JSONStream Print Dart Objects
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24841 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-09 14:07:14 +00:00
rmacnak@google.com 04e9e1fe56 Add a VM defined class VMReference as an opaque pointer for Dart code to VM internal objects.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24694 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-02 16:17:25 +00:00
regis@google.com 0c93466054 Hide parent function name in name of closurized function to user (issue 5436).
Hide implicit parameter of closure to user.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24504 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-27 00:49:49 +00:00
srdjan@google.com 7d945c593a Remove skip_static_calls_ as it uses an obsolete way to check for uncalled static calls. Will be replaced by ICData tracking.
Add two different PCDescriptors to differentiate between optimized and unoptimized static calls (the former loads args. descr, the later loads ICData before calling).
Populate static call's ic_data field when optimizing.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24433 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-25 21:31:37 +00:00
asiva@google.com 8e27430ddd - Create isolate specific resuable handles and use them in the hot lookup paths.
- Create a ResuableHandleScope class which ensures that we do not end up
  recursively reusing handles leading to corruption.

This change shows Dart2JSCompileAll runtime change from 739931 to about
645035 on my local machine.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24373 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-24 22:41:01 +00:00
fschneider@google.com 0bf7251d1a Reland: Optimizing noSuchMethod invocation with no arguments.
This is the same CL as https://codereview.chromium.org/17315008/ with
one bug fixed:

If a method is invoked with a mismatching number of arguments, we don't
add a no-such-method-dispatcher function since the dispatcher currently
can only invoke noSuchMethod and would not work if the method
is invoked with correct arguments at a later point.

I extended the test to cover that case.

TEST=tests/language/no_such_method_dispatcher_test.dart
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24351 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-24 17:18:51 +00:00
srdjan@google.com fa7817bf79 Change static calls in unoptimized code to always call via a stub. Using ICData, the call count of static calls is collected as well.
TODO: Use call frequency to guide inlining.

R=asiva@google.com, hausner@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24307 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 23:35:10 +00:00
fschneider@google.com 48555c83ac Back out r24266 to investigate dartium test failure.
TBR=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24284 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 11:56:32 +00:00
fschneider@google.com ab1981b421 Optimizing noSuchMethod invocation with no arguments.
On each call that triggers a noSuchMethod invocation we 
attach a custom dispatch function that allocates the 
invocation object and invokes noSuchMethod. This dispatcher
is compiled and optimized like a normal Dart function.

Similar to method-extractors, these implicit dispatchers
do not show up as normal functions.

As a first step this CL only handles invocations of getters
and methods with no like o.foo or o.foo().  This CL gives
a >25x speedup of such noSuchMethod invocations. Calls with
multiple arguments still go through the slow path.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24266 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 07:31:51 +00:00
srdjan@google.com 47de186e76 Store arguments descriptor in ICData. Remove loading of arguments descriptor at unoptimized call site (the ones using ICData).
R=asiva@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24239 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-20 16:29:39 +00:00
kmillikin@google.com 3e78b2ad4a Reapply "Initial implementation of on-stack replacement (OSR)."
This reapplies SVN r24024 with a bugfix.

After OSR compilation, restore the pre-OSR code (which might be already
optimized) rather than the unoptimized code (which might have its entry
patched).  When the optimized code entry is patched it is only safe to call
it as a static call, not as an instance call.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24088 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-17 11:05:15 +00:00
srdjan@google.com 7192d42f46 Fix a bug in instance canonicalization and add debug mode checks that we are not missing any fields.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24059 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 22:58:48 +00:00
kmillikin@google.com d6f3eccdf2 Revert "Initial implementation of on-stack replacement (OSR)."
This reverts commit 24024.

TBR=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24025 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 10:30:53 +00:00
kmillikin@google.com 0b39927d30 Initial implementation of on-stack replacement (OSR).
Add profiling support to select OSR candidates and launch the compiler
for OSR, followed by entry to the function at the OSR entry point.

Implemented only on IA32 and X64.  The initial implementation can be
improved in various ways --- specifically: tuning of profiling
parameters and incorporation of feedback about the actual values seen
at OSR entry.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24024 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 10:10:55 +00:00
fschneider@google.com 3208230580 Revert r23330 and r23136 because of a bug with loop invariant code motion.
This CL temporarily remove deoptimzation history which was put in to prevent
repeated deoptimization caused by loop invariant code motion. It caused
illegal code motion under certain conditions.

BUG=https://code.google.com/p/dart/issues/detail?id=11245
TEST=tests/language/licm3_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23989 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-13 15:52:33 +00:00
srdjan@google.com 5543ce104c When canonicalize instances check if all fields are canonical. If a field is a non-canonical number or strings, canonicalize it. Otherwise report an error if a field is not canonical.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23934 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-12 21:27:37 +00:00
hausner@google.com 0374dc9b12 Reified metadata in the VM
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23912 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-12 15:44:57 +00:00
asiva@google.com 7f8320e042 Make ImmutableArray a sub class of AllStatic.
This enables Array to be a FINAL_HEAP_OBJECT and the operators
'=' and '^=' would be a simpler implementation which does not
require a call to initializeHandle().

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23884 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 21:52:39 +00:00
asiva@google.com 69b5efffd2 Create specific null read only handles for the frequently used types
Array, String, Instance, Object and use them.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23785 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-08 00:47:35 +00:00
zra@google.com 68f4a66a3d Improvements to 53-bit overflow checking.
- Integer literals that require more than 53 bits will cause a compile-time error.
- Checking is added to unary negate for the case that the most negative
  53-bit integer is negated.
- The tests are improved to also check optimized code.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23774 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-07 21:28:49 +00:00
srdjan@google.com d1fbe2117d Fix Issue 11047: use binary search instead of linear search to locate a pc-offset in the static call table.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23614 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-04 20:16:29 +00:00