Commit Graph

685 Commits

Author SHA1 Message Date
hausner@google.com f58745f751 Fix parsing and resolving of prefixed names
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37631 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-23 23:26:26 +00:00
regis@google.com 32f3e11d99 Cleanup of error and warning reporting.
R=hausner@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37468 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-18 22:30:34 +00:00
iposva@google.com 5864eb56c6 - Use I instead of isolate() where possible.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37375 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-16 20:50:05 +00:00
hausner@google.com 4eac05607f Lazy loading of deferred libraries
Defer reading of source code of deferred libraries until the
Dart code executes the loadLibrary() call.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37334 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-13 22:43:31 +00:00
fschneider@google.com b0904c1409 Record field initializer with simple literals stores at compile-time.
This helps to rule out fields from being unboxing candidates earlier and
avoids generating extra code to track the type at runtime.

Also, align the location summary computation for instance field stores to
use the same condition as the code generation function.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37310 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-13 11:49:34 +00:00
regis@google.com 1186078de6 Add support to trace warnings in TraceBuffer.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37298 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-13 00:47:15 +00:00
rmacnak@google.com da3b61d764 Add missing demangling to the VM's NoSuchMethodError. Ensure the VM's NoSuchMethorErrors for reflective invocation match those for non-reflective invocation.
Fix bug in VM demangling of setters.
Fix bug where test was not covering invocation on classes as intended.

BUG=http://dartbug.com/18042
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37294 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-12 22:53:00 +00:00
iposva@google.com ab18821876 - Fix the external_test.dart as it was relying on outdated
functionality and broken syntax. So some tests were passing
  for the wrong reason.
- Fix the VM parser to properly report the compilation errors.
- Fix the generation of pretty names of private identifiers.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37208 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-10 22:19:33 +00:00
srdjan@google.com 3480ac4a0e Fix deferred library code disabling for inlined functions.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37107 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-06 22:14:40 +00:00
regis@google.com fa70e35e60 Improve error message and suggest workaround for mixin limitation.
Related to issues 15101, 17610, and 19226.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37057 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-05 23:19:45 +00:00
regis@google.com 139187ae5f Add javascript compatibility warnings for strings that are not identical, but
equal. The vm does not canonicalize all strings as javascript does.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37013 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-04 20:47:54 +00:00
rmacnak@google.com fc3ce06a95 VM: Use a fake parsed function when parsing metadata.
BUG=http://dartbug.com/18976
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36903 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-02 22:06:28 +00:00
vegorov@google.com 4e286b316f Split GuardField into GuardFieldType and GuardFieldLength instructions.
Record expected length offset that matches guarded_cid.

This greatly simplifies code generation and control flow inside these guards.

Fixes the bug that was causing unoptimized code to call into runtime even when guard did not fail.

Add --trace-field-guards flags to trace updates to the state of guarded fields' properties.

BUG=http://dartbug.com/19003
R=fschneider@google.com, johnmccutchan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36872 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-02 13:53:53 +00:00
regis@google.com b7c5f90bf0 Address TODOs and remove obsolete ones.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36813 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-29 23:06:02 +00:00
hausner@google.com 7eb65dc57e Cache the current token in some functions in the parser
Avoid some calls to CurrentToken(). Compiling all of dart2js, this saves
about 10% of calls to CurrentToken(). There is no measurable performance
difference (using wall-clock time).

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36763 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-28 20:21:02 +00:00
srdjan@google.com ce2d52f111 Pass isolates explicitly.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36740 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-28 14:24:53 +00:00
fschneider@google.com 9eb97cb338 Don't require eliminating certain type checks in unoptimized compilation.
The compiler relied on the graph builder to eliminate certain type
checks so that running without type check elimination required a
hack in the code generator to deal with the transition sentinel.

This CL makes type checks explicit in the AST and avoid inserting
them where they're not necessary (e.g. assigning null, sentinal values).

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36734 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-28 10:16:05 +00:00
srdjan@google.com 2b06c73841 Remove unused code, improve speed of Parser::CurrentToken (improvement seen in measurements and profile).
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36710 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 21:12:24 +00:00
iposva@google.com 13d2f0f237 - Fix build: Move definition of I local to the files using it.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36687 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 14:53:20 +00:00
iposva@google.com bd91ac03d4 - Add isolate to ZoneHandle allocation in parser.
- Add I macro which gets the local isolate().

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36686 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 14:30:30 +00:00
iposva@google.com d36cd610cb - Use isolate where it is appropriate.
- Do not emit an name for ExternalLabel.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36662 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 10:15:50 +00:00
srdjan@google.com 45692c1248 More reduction of accessing TLS by caching/passing isolate value.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36598 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-23 23:26:48 +00:00
rmacnak@google.com d14dc6c502 Fix crash when parsing metadata that refers to a static getter.
BUG=http://dartbug.com/18949
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36522 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-22 18:56:08 +00:00
iposva@google.com b4b4889406 - Refined https://codereview.chromium.org/293963008/
Make compilation VM more fine grained

- Use the isolate where appropriate.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36451 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-21 21:04:03 +00:00
regis@google.com 38319b0f33 Fix issue 18435 (2nd attempt).
Add regression test.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36402 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-21 00:32:32 +00:00
regis@google.com 8d7bc4bef5 Revert bad fix.
Review URL: https://codereview.chromium.org//288343005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36365 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-20 17:03:10 +00:00
regis@google.com 9ae1b1f5e0 Fix issue 18435.
Add regression test.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36362 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-20 16:41:37 +00:00
regis@google.com dec11d8b7b Add support for javascript incompatibility warnings (work in progress).
For now, warnings are only issued when applicable for type tests, type casts,
and toString.
Fix newly reported lint errors.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36001 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-09 22:42:10 +00:00
rmacnak@google.com f4f4713eb8 Put metadata fields in their owner class to maintain the class-field bidirectional relationship asserted Field::PrintJSON.
Extended metadata scope test based on suspicions regarding the ordering of adding type parameters metadata fields versus ordinary fields of a class.

BUG=http://dartbug.com/18652
R=iposva@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35926 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-08 18:15:33 +00:00
iposva@google.com 7256650645 - Change when the library being loaded is registered. Now
we register it before calling the tag handler so that the
  VM can keep track of which libraries have outstanding
  requests.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35870 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-07 21:46:05 +00:00
fschneider@google.com dfa5c809f5 Simplify flow graph building for instantiator.
The instantiator is always loaded from a local variable which
is determined in the parser. There is no need to create an AST a fresh
ValueGraphVisitor for it since the flow graph builder can just emit a
load-local.

This also makes it clear that the instantiator is not an arbitrary expresssion.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35699 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-02 17:58:01 +00:00
turnidge@google.com f8fcc45e3d Save the entry context for a function that has captured loop variables.
BUG=18561
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35692 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-02 16:14:05 +00:00
iposva@google.com 84e4a2d2ce - Remove unneeded creation of :saved_current_context_var
R=turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35400 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-24 20:31:45 +00:00
regis@google.com da0958c822 Expose functionality to create a stack trace to internal vm code.
Provide functionality to limit depth of printed stack trace.
Fix frame numbering in presence of invisible functions in stack trace.
Let FlowGraphBuilder know if it is building a graph to generate optimized code.
The above features will be used to warn on Javascript incompatibilities.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35319 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-23 17:58:12 +00:00
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
fschneider@google.com 79a5307d5b VM: Implement closure calls as instance calls.
Conceptually f() becomes f.call() where the .call method performs the actual
closure call. The closure call itself is implemented without a stub.

The check if the object called is a closure becomes a class-id check
which can be hoisted out of loops.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34917 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-10 10:56:00 +00:00
hausner@google.com 10f6318d87 Allow function literals in string interpolation
Interpolated strings in initializers can contain function literals. Add a test case to the function literals test.

Fixes issue 18112.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34903 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-09 23:42:58 +00:00
hausner@google.com 625b564a4b Fix instance method resolution with abstract accessors and methods
Fix issue 18082

R=gbracha@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34845 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-08 22:14:24 +00:00
hausner@google.com 83f80fe560 Add const static field optimization that got lost in last checkin
My last change list accidentally got rid of an optimization where the parser replaces const static field references with the value of the field. This causes many more compile-time “execute once” calls. This change adds back the special case.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34798 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-07 21:30:54 +00:00
hausner@google.com 2b4e3c7c99 Implement deferred constant support
Compile time constants lose their const-ness if they are referred
to through a deferred prefix. This CL adds a flag to some ast node
types that remembers whether a field or closure was referred to
via a deferred prefix. If so, the compile-time const analysis flags
the value as non-const.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34785 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-07 17:31:32 +00:00
hausner@google.com b36457263a Deferred prefix support in metadata
Deferred prefixes are never ok in metadata, since metadata is required
to be compile time constant.

R=rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34601 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-01 16:11:28 +00:00
rmacnak@google.com f0626388f5 VM: Evaluate metadata on a class in the scope of its library not the scope of the class.
BUG=http://dartbug.com/17795
R=gbracha@google.com, hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34537 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-28 22:38:32 +00:00
hausner@google.com ed24226376 Support deferred library prefix syntax
First step towards deferred library support:
- Parse the “deferred as” import clause.
- Implement p.loadLibrary() which returns a future that
  completes when the library is loaded.
- Treat type annotations of deferred types as malformed.
- Throw NoSuchMethodError when calling functions from
  unloaded libraries.
- Libraries are still read synchronously, but items in the
  library won’t be visible through the deferred prefix until
  the future returned by loadLibrary() completes.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34481 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-27 21:20:47 +00:00
johnmccutchan@google.com 6952f5ddfe Use VM tag in profile and add stack trace trie
R=asiva@google.com, turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34064 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-18 21:20:41 +00:00
fschneider@google.com 37b30ab2ac Alternative fix for .call invocation of closures.
This also covers "closurization" of the .call method.
This relies on the fact that f.call === f if f is a closure.
This means that adding a simple getter to _FunctionImpl that
 returns this is enough. No need for a separate dispatch.

This CL reverts the previous fix for issue 12602 (modulo the
additional tests).

BUG=dartbug.com/17473, dartbug.com/12602
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33736 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-17 10:31:33 +00:00
iposva@google.com 021fca847c - Implement a PauseTimerScope so that we can properly exclude
times when a TimerScope is active.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33662 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-13 20:38:24 +00:00
fschneider@google.com f75ef2e6ab Fix invocation of closures via .call in the VM.
Calling closures via .call does now work in the VM - it was working in
dart2js already.  Calling .call on a closure is implemented to go through
a dispatcher method. These dispatcher methods are automatically created and
cached in the same way as NoSuchMethod- or field-invocation dispatchers.

This CL does not change the way regular closure invocation works in
the VM. It is therefore performance-neutral for normal closure calls.

BUG=dartbug.com/12602
TEST=language/call_test
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33576 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-12 14:02:27 +00:00
rmacnak@google.com 57dd1321d1 Reapply "Access to imports in the VM's runtime mirrors. Extend test coverage of the source mirrors."
Regenerate snapshot test due to change in the size of Namespace. Relate the types source mirror libraries dependencies to the runtime library dependencies.

BUG=http://dartbug.com/10360

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33441 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-07 19:00:20 +00:00