Commit Graph

407 Commits

Author SHA1 Message Date
rmacnak@google.com 7ba8ca5753 Reapply "Mark private functions in dart:* that are native or constructors as not visible (omitted from stack traces and ineligible for reflective enumeration or invocation)."
With fix for uninitialized is_dart_scheme_ when read from snapshot.

BUG=http://dartbug.com/15274
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35289 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-23 00:05:08 +00:00
rmacnak@google.com 7840906011 Revert "Mark private functions in dart:* that are native or constructors as not visible (omitted from stack traces and ineligible for reflective enumeration or invocation)."
Review URL: https://codereview.chromium.org//246173002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35238 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-22 00:08:52 +00:00
rmacnak@google.com 69d82c334b Mark private functions in dart:* that are native or constructors as not visible (omitted from stack traces and ineligible for reflective enumeration or invocation).
Ensure invocation_fuzz_test doesn't exit prematurely.

Also visit instance methods defined in superclasses.

Complete blacklist so invocation_fuzz_test passes on the VM.

B=http://dartbug.com/15274
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35234 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-21 23:24:17 +00:00
zra@google.com d128fb91ae Adds object pool, LoadImmediate, and LoadObject to ARM64.
Also enables many object tests.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35109 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-16 15:48:33 +00:00
zra@google.com 2fe51715e5 Begins work on ARM64, first assembler test.
Most new code is in constants_arm64.h and
{assembler,disassembler,simulator}_arm64.{h,cc}

The rest of the CL just #def's out tests, modifies status files,
and adds UNIMPLEMENTED functions, etc.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34654 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-02 17:39:32 +00:00
turnidge@google.com b373e6c423 Change how we provide value previews in the vm service.
Rename the 'preview' property to 'valueAsString'.

Rework printing so that we only add 'valueAsString' when we need it
(num, String, etc.).

Change ToUserCString to be a String-only method.  Drop ToUserCString
for lists -- it was hokey and unused.  Max string length is now 1024
instead of 40.

Update tests.

BUG=
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34612 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-01 19:45:57 +00:00
koda@google.com 565a554b02 Make all objects print at least their type in PrintToJSONStream.
Also check this in the unit test.

R=turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34315 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-24 16:57:53 +00:00
koda@google.com d17423903d Ensure PrintToJSONStream can be called on all heap objects without crashing.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34271 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-21 21:12:38 +00:00
iposva@google.com 25678c7d86 - Fix formatting of generated sources.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33570 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-12 09:16:21 +00:00
regis@google.com d599ea7d9b Simplify type argument instantiation cache lookup by introducing an array
of 1 zero Smi.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32756 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-18 19:30:03 +00:00
fschneider@google.com 78fbacbd87 Fix flag to switch write protection of code pages on/off.
TBR=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32549 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-11 10:17:03 +00:00
fschneider@google.com d6178535b2 Landing: Write protect executable pages in the VM.
Change executable pages to be read/execute but not writable by default.

All pages are made temporarily writable just before a full GC, because both
the mark and sweep phases write to the pages. When allocating in a page and
when patching code, the pages are made temporarily writable.

The order of allocation of Code and Instructions objects is changed so that
a GC will not occur after Instructions is allocated. (A full GC would
render the Instructions unwritable.) A scoped object is used to make memory
protection simpler.

Original CL: https://codereview.chromium.org/106593002/

I added a cc test that is expected to crash.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32493 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-10 12:18:06 +00:00
regis@google.com 7830430adf Implement eager instantiation and canonicalization of type arguments at run
time using a cache in uninstantiated type arguments.
Remove InstantiatedTypeArguments class.
Fix a bug in optimized code: do not update unused type test cache for Smi.
Fix a bug in optimized code on ARM and MIPS in type test cache lookup.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32447 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-07 19:54:33 +00:00
hausner@google.com 0c434b3073 Rename kDummyTokenIndex to kNoSourcePos
Addresses comment to previous change list.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31969 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-21 23:46:26 +00:00
johnmccutchan@google.com 403715b27c Fix checked mode failure of FindFunctionIndex
Review URL: https://codereview.chromium.org//121553005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31448 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-03 20:32:08 +00:00
johnmccutchan@google.com 7da1f4f3ba Build map of code regions and address ticks for profile report.
Profile pauses should be less than 500 ms even when handling 120,000 samples (2 minutes @ 1000 hz).
Code objects are referenced by hex address: "code/cafebabe".
Test for retrieving code objects over the service.
Remove old profile tool scripts. Replaced by dprof (https://github.com/dart-lang/dprof) and Observatory UI for profiler.
Support for stable service refs to implicit closures and dispatcher functions.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31447 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-03 19:55:50 +00:00
johnmccutchan@google.com 727d29d6b6 Refactor VM service IDs:
- IDs are strings which can be concatenated together like paths.
- Isolate ID is now "/isolates/XXX"
- Function, field, class, library, and script IDs are now stable.
- Introduce <type-ref> tags.

R=turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31358 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-20 22:35:55 +00:00
turnidge@google.com 365cde2ecb Add GrowableObjectArray::ToUserCString().
Prints a decent representation of a list, subject to length
constraints.  Prints the length of the list if it is truncated.

e.g.

[]
[1,2,3]
["0123456789",...](length:4)

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31144 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-13 19:36:40 +00:00
turnidge@google.com 29b080a4b1 Add Instance::ToUserCString.
-----

Often ToCString returns a representation which would be weighty or
unsightly to users.  Instance::ToUserCString tries to return a
representation that will be more familiar to end users.

ToUserCString will be used in the vmservice to produce interesting
instance preview strings w/o calling toString.  No doubt we will find
other uses for it too.

For example, strings are represented more as they would be in a user
program, with quotes and escapes: ("this\nis\ta\n\ntest") instead of (this
is        a

test).

I intend to add better representations for short lists and maps
later, e.g. ([1,2]) instead of (Instance(length:2) of '_GrowableList').
I've added some tests to track current behavior.

Fix a problem where the vm internal names for private classes were
leaking out through ToCString.  This is problematic because Dart's
default toString relies on ToCString (which surprised me).  This fix
will be user-visible and, darn it, it's the right thing to do.  For
example, before toString (in Dart) might yield:

  Instance of '_MyPrivateClass@43df89GARBAGE4389'

Now it will yield:

  Instance of '_MyPrivateClass'

(as an aside, do those single-quotes around the class name add any
meaning here?)

Massage the output of ToString for GrowableObjectArray to be more
consistent with other instance ToString output.  This should not be user
visible, as lists define a reasonable toString.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30996 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-09 19:47:23 +00:00
fschneider@google.com cd54507fc2 Mark native functions when they are created.
Until now the parser marked native functions as native when parsing.

This may be too late for some functions. E.g. the native typed list
constructor may not be invoked because the intrinsic code is executed
instead (unless for example new-space allocation fails).

This causes missing type information when optimizing functions using
those recognized factory functions like Uint8List._new.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30846 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-04 10:32:43 +00:00
srdjan@google.com 3274f92827 Rename FinalizeTypeHierarchy to ProcessPendingClasses.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30688 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-27 00:11:32 +00:00
srdjan@google.com 3485989ae7 Do not eagerly finalize classes in CHA, instead regard unfinalized classes as ’non-existent’ and only invalidate optimized code at finalization of the class.
Rename FinalizePendingClasses to FinalizePendingClassInterfaces as the class finalization occurs lazily.
TODO: add dependency information to deoptimize/remove only relevant optimized code.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30582 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-22 17:59:23 +00:00
johnmccutchan@google.com 97ac18aee9 Sampling profiler
BUG=4350
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30419 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-19 18:26:10 +00:00
turnidge@google.com d24c7e0be7 Don't inline functions if they have an active breakpoint.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29388 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-28 20:12:37 +00:00
jacobr@google.com 3a19cddf9c Respond to Ivan's code review comments from previous TBR cl.
BUG=
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28135 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 23:48:45 +00:00
jacobr@google.com da160cd5af TBR: fix build break
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28076 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 00:45:13 +00:00
jacobr@google.com 636d137f66 Fix for issue where external one byte strings cannot be escaped. This occured in practice when requesting all library names for a Polymer.dart example The likely reason why the issue occurs in this case but not others is that some of the libraries are generated using data urls. Added some tests for EscapeSpecialCharacters as it did not have any tests.
BUG=
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28073 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 00:08:01 +00:00
mlippautz@google.com 728c46ca4f Make Script::GetTokenLocation() and Script::TokenRangeAtLine() use token streams
where possible.

BUG=
R=hausner@google.com, iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27786 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-23 23:24:59 +00:00
mlippautz@google.com 4fa46b7148 Introduce newline tokens into the token stream.
CL only introduces the tokens into the compressed token stream. We do not
use the newline tokens (yet).

Overhead:
snapshot: 6.4% (860k/808k)
compressed token stream (gen_snapshot): 21% (314312/259907)

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27677 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-19 21:46:50 +00:00
hausner@google.com fd57843900 Update handling of ambiguous name references
Update VM to latest spec. Referencing a name that is imported
from more than one library is no longer a compile-time error.
If one of the sources of an ambiguous reference is a dart library,
the dart library declaration is automatically hidden.

Also fixes a bug where looking up a getter name in a library
found the getter even though the name is filtered out in the
'hide' combinator.

Long-term we should fix the need for repeatedly convert between
the mangled getter and setter names and the untangled name.

Fixes 12915, 12913, 12724.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27312 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-09 21:52:40 +00:00
srdjan@google.com cfb81a40aa Last round of cleanups in exception handler, before going to the next stage.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26941 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-30 20:47:02 +00:00
srdjan@google.com e06ea63b60 Mark exception handlers if they have a stacktrace specified. Do not build a stacktrace if the handler has no stacktrace.
R=asiva@google.com, hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26823 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 22:42:21 +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
mlippautz@google.com 2187a8f63f Move the begin token (token_pos) of explicit functions to the start of the function declaration.
This fixes setting the breakpoints when the signature of function declarations is spread across multiple lines.

Example:
int
get
foo
=>
42;

BUG=
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26080 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-13 20:11:23 +00:00
rmacnak@google.com 1edde1e0bf Ensure the classes void and dynamic have empty arrays for fields, functions, etc. Move their Types to the VM isolate, and as a side-effect they are now canonicalized.
BUG=http://dartbug.com/12071
BUG=http://dartbug.com/12246
R=asiva@google.com, iposva@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26043 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-13 00:11:42 +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
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
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
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
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 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
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
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
asiva@google.com 5ce344f18e Add test to check that IsArray returns true for immutable array objects.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24048 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 20:02:57 +00:00
asiva@google.com d7dd745eaf Fix build break.
Review URL: https://codereview.chromium.org//16815004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23916 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-12 16:29:14 +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 e33c2d4254 Delay Class parsing until the class is actually used.
Prior to this change the initial heap sizes were as follows:
ia32:
Size of isolate snapshot = 1230921
New space (0k of 32768k) Old space (1446k of 1604k)

X64:
Size of isolate snapshot = 1223943
New space (0k of 32768k) Old space (2630k of 2692k)


After this change the initial heap sizes are as follows:
ia32:
Size of isolate snapshot = 686443
New space (0k of 32768k) Old space (677k of 836k)

X64:
Size of isolate snapshot = 684731
New space (0k of 32768k) Old space (1220k of 1412k)

R=hausner@google.com, iposva@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23115 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 00:13:10 +00:00
srdjan@google.com 142b49316a Fix issue 5275: The VM must always generate the most compact form of an integer (Smi, Mint or Bigint). Hide methods that can be used to bypass that assumption and require the use of Integer::NewXXX which is guaranteed to return the most compact integer form.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22816 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-16 20:49:06 +00:00
hausner@google.com 8e29370a1b BREAKING CHANGE: enforce part of directive
For historical reasons, the VM is currently too lenient when parsing library parts. Files that get loaded through a 'part' directive must start with a 'part of libraryname;' clause. The VM so far has not reported an error if the clause is missing.

This change enforces the grammar as the Spec mandates it. Library parts that do not start with 'part of' will no longer compile.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22278 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-01 20:46:48 +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