Commit Graph

520 Commits

Author SHA1 Message Date
hausner@google.com 43d319c105 Update unresolved name handling with library prefixes
Fixes issue 12913

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27393 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-11 16:21:25 +00:00
regis@google.com 6c92ec5439 Simplify VM internal representation of a mixin application clause (MixinAppType
object) by removing some redundant field and type arguments.
Tolerate mixins with wrong number of type arguments and update tests.
Note: this is a first cleanup step in preparation of more mixin bug fixes.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27363 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-11 00:41:07 +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
fschneider@google.com dff262d761 Remove inlining restriction of calls to the == operator.
This CL is the first step in enabling full inlining of == calls.
Previously, calls to any function with the name "==" were not considered
for inlining because super-calls were not handled correctly. Instead
  of implementing == semantics for super calls in the back-end, the parser
now expands super calls to == into 

let t1 = left, t2 = right {
  (t1 === null  || t2 === null) ? t1 === t2
                                : static_call(super.==, t1, t2)
}

This change removes a bit of platform-specific assembly. Normal instance calls
to == are still translated as before. Expanding those at the AST level would
incur a too high cost in terms of (unoptimized) code size, and also would be
an obstruction for optimizations of equality. The plan is to expand those
only at optimization time if there is an inlineable instance call to ==.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27248 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-06 13:55:24 +00:00
kmillikin@google.com 2b19ed632d Disentangle AstNode::Name and AstNode::ShortName.
The Name function is used for pretty printing except that for a few
node types we rely on a specific name for implementation correctness.
Overriding the pretty printing function to get out a type name, or a
variable name, or an operator symbol name, is risky.

1. Code that relies on the semantics of the name will break if the
   pretty name is changed.

2. Pretty printing is less useful.  For instance, LoadLocalNode just
   prints the variable name (twice, once as the AST constructor and
   once in quotes as the variable name).  This is confusing if the
   variable happens to have the same name as one of the other pretty
   names, e.g., args or seq.

Now, there is a virtual function to get the pretty name but classes do
not change it to communicate other information (type names, variable
names, operator names).

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27244 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-06 11:54:26 +00:00
regis@google.com 765aac1496 Keep track of the application of a mixin type to a mixin application class,
which includes setting up its type parameters (fix issue 12871).

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27157 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-04 22:21:36 +00:00
rmacnak@google.com 865ef54309 Implement ParameterMirror.metadata.
BUG=http://dartbug.com/10906
BUG=http://dartbug.com/11418
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27082 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 22:50:15 +00:00
fschneider@google.com 92e97e5d1a Fix bug with reflection on VM-internal native methods.
My previous approach was not enough, since methods can
be invoked via reflection before they are parsed/compiled.

This CL fixes the problem at hand, but I'd like a more general
approach to mark those methods. Maybe an annotation at the declaration
would be better.

I also refactored the test case as suggested in the previous code review.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27009 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-02 10:43:59 +00:00
srdjan@google.com 97891ce193 If a rethrow is encountered in the catch block, then its handler must be marked that it needs stacktrace. Fix issue r12584.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26963 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-31 00:26:47 +00:00
zra@google.com c012196222 Evaluates arguments before throwing a NoSuchMethodError in constructor
calls and static function calls.

Fixes issue 12820.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26827 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 23:39:43 +00:00
rmacnak@google.com ac705b02a7 More reflection of mixin applications in the VM.
*Provide ClassMirror.mixin
*Hide extra class on the inheritance chain introduced in mixin typedefs
*Give mixin applications a simpleName that matches the source language syntax
*Update mixin_test to distinguish between members and constructors
*Update mixin_test for the mixin application naming scheme

BUG=http://dartbug.com/12464
R=ahe@google.com, asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26824 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 22:55:53 +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
hausner@google.com 3e9467672f Require case expressions to be compile-time constants
Remove legacy semantics in switch statement compilation.

Still to be added: analysis that all case expressions are
of the same type.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26749 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-27 23:07:59 +00:00
iposva@google.com d7aa93e0b3 - Remove support for the old "get foo()" - style syntax.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26743 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-27 20:47:14 +00:00
mlippautz@google.com 817a6fff3a Implement ParameterMirror.{isFinal,hasDefaultValue,defaultValue}.
Fixes issue 12196 and partially addresses issue 12430.

BUG=
R=ahe@google.com, asiva@google.com, gbracha@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26730 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-27 17:31:09 +00:00
hausner@google.com c2fa1cf490 Add compilation error on named parameters with private names
Remove bogus test cases.

Fixes issue 5743, 3502

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26719 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-27 16:41:33 +00:00
rmacnak@google.com 92f8786e99 Remember metadata positions for mixin and function typedefs.
BUG=http://dartbug.com/10906
R=asiva@google.com, hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26680 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-27 00:47:42 +00:00
regis@google.com 93059fe3cf More cleanup related to malformed and malbounded types.
Remove support for warnings in parser and related flags.
Rename flag --error-on-malformed-type to --error-on-bad-type, since it covers
both malformed and malbounded types (also closer to --error-on-bad-override).

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26677 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 23:24:01 +00:00
regis@google.com 81bcb1f18a Distinguish between malformed and malbounded types (fix issues 12552 and 12554).
Add test.
Update status files.

Explanation of change: A malbounded type argument should not be mapped to
dynamic, as is a malformed type argument.
This change also adds a bunch of TODOs related to the encounter of malbounded
types in unexpected places.
A follow-up change will address these TODOs, add more tests, and may simplify
code that is still handling malformed types where they cannot occur anymore
after the spec simplified their handling.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26665 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 17:56:02 +00:00
mlippautz@google.com b708a455d1 Fix Function.end_token_pos() and implement MethodMirror.source getter.
Move .source getter from ClosureMirror to MethodMirror (as the TODO already suggested) and provide an implementation.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26659 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 17:14:07 +00:00
fschneider@google.com d773e985a7 Mark private methods of core libraries as invisible in the VM.
This prevents accessing them via reflection which should not
be allowed since they are often handled specially by the compiler.
Those functions also will not be shown in stacktraces.

TEST=tests/language/reflect_core_vm_test.dart
R=rmacnak@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26625 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 09:19:54 +00:00
fschneider@google.com 4a9402eb26 Fix allocation of indices for try-blocks.
The compiler has the assumptions that try-index starts
at zero for each function: The list of exception handlers
is a dense array indexed using the try-index.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26585 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-23 08:49:05 +00:00
hausner@google.com 3876a9e23c Remove assertion in compile-time constant map literals
We had a left-over assertion that keys are strings.

Fixes issue 12505.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26549 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-22 19:45:13 +00:00
hausner@google.com 6b20c0ecaa Detect circular dependencies in compile time constants
Fix issue 1681

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26491 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-21 23:55:59 +00:00
johnmccutchan@google.com c8b370ab50 Initial support for length guards on final fields.
R=regis@google.com, srdjan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26433 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-21 15:32:45 +00:00
fschneider@google.com ba0f59d1bc Polymorphic inlining for some recognized methods in the optimizing compiler.
The optimizing compiler currently recognizes a certain frequent native methods
like array length or string length and provides an inlined implementation.
Inlining does currently not work for polymorphic call sites of these methods.  
This CL enables also polymorphic inlining in the case of .length getters for
arrays and strings.

1. The method is recognized at flow graph build time. The builder creates
 the body of the method for both compilers (non-optimizing and optimizing).
 Native methods that are not recognized, are translated as before using a NativeCall
 IL instruction.

2. The flow graph inliner handles recognized methods in the same manner as normal methods.
Until now intrinsic and recognized method could not be inlined. This CL enables it.

3. There is no need for an intrinsic assembly implementation because recognized methods
have an IL implementation that does not call into the C++ runtime. I left the intrinsics
in for now, but they can be removed if there is not noticable performance benefit anymore.

4. The inlining heuristics are tweaked in a way that enables more aggressive inlining
of recognized methods: +1 level of inlining depths, call sites of recognized methods are
not counted in the inlining heuristic.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26429 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-21 12:58:08 +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
regis@google.com f9df206e2e Report compile-time errors for conflicting overrides as specified by latest
language spec (fix issue 12342).
Add override conflict tests.
Update status files.
Add support for 'ok' status in multi-tests.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26302 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-16 23:39:41 +00:00
vsm@google.com 5893fa7634 Remove test for native resolver
This check asserts that a type with a native field must be in a
library with a native resolver.  It won't be true with custom elements
- which inherit from dart:html and inherit a native field - but are
otherwise in user libraries.

I'm just removing the check altogether here.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26144 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-14 20:18:16 +00:00
regis@google.com dd9d0b1f36 Make sure type information is not lost in snapshots created in production mode,
since they can be executed in checked mode.
Add snapshot test.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26127 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-14 15:52:41 +00:00
srdjan@google.com 1f31dcc424 Fix for running with --throw_on_javascript_int_overflow: recognize pattern (a << b) & mask and test for overflow only after the mask.
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26122 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-14 15:12:39 +00:00
hausner@google.com aa27308cab Fix top-level map literals
This is the remaining part that needed to be done to implement
map literals with arbitrary keys.

Fixes issue 10472

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26095 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-13 23:45:20 +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
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 3fdec161e8 Fix attempt to find metadata of a library with no metadata.
BUG=12206
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25930 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-08 16:50:11 +00:00
hausner@google.com 32c1b1e412 Follow-up to capturing instantiator
Add boolean result to CaptureVariable, as suggested by Regis.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25922 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-08 11:22:59 +00:00
hausner@google.com 1453019552 Remove bogus assertion
Fix issue 12290.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25884 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-07 16:33:02 +00:00
hausner@google.com e390ba9871 Fix access to type variables in initializer expressions
Allow initializer expressions to capture type arguments.
This used to crash because the receiver is not accessible
in initializer expressions. We don't need the receiver, we
just need to mark it as captured.

Fixes issue 8847.

R=ahe@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25877 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-07 15:15:02 +00:00
hausner@google.com 5a8e70d39a Better error message for redefined local names
Improve error message when a name is defined in a scope and
and outer declaration of the name has been referenced before.

Fixes issue 7073.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25875 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-07 14:22:13 +00:00
asiva@google.com b4d9e0d620 Auto create ApiLocalScope before calling native functions, this ensures that
native functions do not have to call Dart_EnterScope/Dart_ExitScope
when they callback into the VM.

Remove Dart_EnterScope/Dart_ExitScope calls around native functions in 'bin'
directory.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25827 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-06 19:27:48 +00:00
fschneider@google.com 086b60dada Fix a bug in compilation of try-finally.
When nesting try-finally, the outer finally was incorrectly executed
twice under certain conditions (a return in the inner try-block and a outer
finally-block that ends with throw)

This was because finally-code was inlined at return/break/continue statements
and it was associated with the wrong catch-handler when compiling.

This CL tracks indices of try-blocks in the parser so that each inlined
finally block has the correct catch handler index.

BUG=https://code.google.com/p/dart/issues/detail?id=11972
TEST=test/language/throw8_test.dart
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25767 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-05 13:49:48 +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
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
regis@google.com b55b249409 Delay resolution of redirecting factory targets in order to avoid class
finalization cycles (issue 12041).
Ensure that a super class is finalized before the class extending it.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25532 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-26 18:18:56 +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
regis@google.com 30609cff91 Use library prefixes in scope of the mixin class when compiling a functions of
a mixin application (issue 11891).

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25233 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-19 18:08:17 +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 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