Commit graph

177 commits

Author SHA1 Message Date
Ryan Macnak 6545e8539e Fix isAssignableTo in VM mirrors to use subtype (<:) rather than moreSpecificThan (<<).
BUG=http://dartbug.com/22852
R=gbracha@google.com

Review URL: https://codereview.chromium.org//1156583005
2015-06-04 12:25:59 -07:00
Ryan Macnak 4102b0c446 Canonicalize mixin type during class finalization. Add asserts that most types are canonical.
R=regis@google.com

Review URL: https://codereview.chromium.org//1167583002
2015-05-29 15:29:04 -07:00
rmacnak@google.com a6e42c48b5 Deal with deferred loading in the VM mirrors.
- Invalidate MirrorSystem.libraries when a load completes.
- Recheck if a deferred import's target has been loaded before failing.
- Allow loading libraries from a LibraryDepedencyMirror.
- Propogate compile-time error when attempting to reflect a deferred type.

BUG=http://dartbug.com/22592
R=asiva@google.com, gbracha@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45444 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-28 23:47:45 +00:00
rmacnak@google.com e2c41789ee Mirrors memory usage tweaks.
- Don't build and cache vestigial members/constructors maps.
- Avoid creating multiple LibraryMirrors for the same library.
- Store infrequently used method flags as a bitfield.
- Don't cache MethodMirror source.

mirrors_reader_test final heap size: 10.8 -> 8.9 MB (-17.5%)
mirrors_reader_test time: 1.55 -> 1.33 seconds (-14.2%)

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45352 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 17:51:49 +00:00
rmacnak@google.com 9f56280609 Add asserts that isolates have a root library set up before they become runnable.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45224 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 00:44:47 +00:00
rmacnak@google.com 26548a2f3d Remove some duplication in code that extracts the source for a function.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45145 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-14 19:41:38 +00:00
rmacnak@google.com b3f4ce9bd8 Deal with type arguments of generic local functions in VM mirrors.
BUG=http://dartbug.com/14913
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44983 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-08 21:40:51 +00:00
rmacnak@google.com 91a7300cb9 Mark the functions of closures generated to speed up getField/setField as invisible, just like other dispatchers.
BUG=http://dartbug.com/23006
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44748 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-27 18:09:49 +00:00
rmacnak@google.com 60fd23bffc Treat functions generated for closurization as equivalent to their source functions.
BUG=http://dartbug.com/22601
R=asiva@google.com, gbracha@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44674 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-24 20:06:40 +00:00
koda@google.com 9c181ec6d5 Thread/Isolate refactoring: new(Isolate*) -> new(Zone*)
Refactor all remaning cases where the current zone is used through new(Isolate*) and remove this interface.

Removing this interface is needed to move towards multiple threads per isolate, and also makes the caller more aware of the scope of the zone used, reducing the risk of use-after-free.

Make the current thread and the stack zone created around native/runtime entries directly available in their body, saving an indirection (and optimized away if unused).

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44541 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-17 19:24:26 +00:00
rmacnak@google.com 8b6a6a1e4f Add ClassMirror.isEnum.
BUG=http://dartbug.com/21718
R=asiva@google.com, gbracha@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44035 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-26 01:13:50 +00:00
rmacnak@google.com 4abf50c04d Add LibraryDependencyMirror.isDeferred.
R=asiva@google.com, gbracha@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43829 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-17 23:49:40 +00:00
rmacnak@google.com 511c997316 Implement DeclarationMirror.location for all but ParameterMirrors.
- Mark NativeFieldWrapper classes as synthetic.
- Mark ClassID fields as synthetic.

BUG=http://dartbug.com/22378
R=gbracha@google.com, hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43784 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-13 23:32:20 +00:00
rmacnak@google.com 4de5f89b99 Rename IsConstructor to IsGenerativeConstructor.
This matches the terminology in the spec, and it avoids confusion with the function kind kConstructor, which indicates either a generative constructor or a factory constructor.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43673 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-11 00:59:19 +00:00
rmacnak@google.com db79e9cca6 Rename is_visible to is_reflectable; use is_debuggable instead of is_reflectable to decide whether to filter a frame from stack traces.
Merge verbose_stacktrace flag into show_hidden_frames.

Don't mark native functions as non-debuggable (breakpoints don't actually work there now but nothing goes wrong).

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43121 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 21:16:40 +00:00
rmacnak@google.com 2fb0bb020b Reapply "Mark all private functions in dart: libraries as invisible (*sniff*). Previously these functions were only marked invisible if they were also native, a constructor, or on a black list."
Broken assumption in Dartium fixed in blink r188698.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43053 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-21 20:44:04 +00:00
rmacnak@google.com ed88ac7f0c Revert "Mark all private functions in dart: libraries as invisible (*sniff*). Previously these functions were only marked invisible if they were also native, a constructor, or on a black list."
Broke Dartium.

TBR=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43026 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 20:56:59 +00:00
rmacnak@google.com 045bd762d7 Mark all private functions in dart: libraries as invisible (*sniff*). Previously these functions were only marked invisible if they were also native, a constructor, or on a black list.
An invisible function is hidden from stack traces, will not be enumerated
by mirrors, and cannot be directly invoked by mirrors. Note that private
classes remain accessible.

Fix a few internal dart:io functions that should be private.

Fix bug where mirrors would enumerate top-level invisible functions.

Mark observatory test that was using such private functions through
mirrors as failing.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43019 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 18:32:19 +00:00
fschneider@google.com 876193b31a Make CTX allocatable by the register allocator.
This change makes CTX available by not caching the current
context while in Dart code. Instead the current context
is held in a local variable (:saved_current_context_var) and
is passed as argument in CTX at calls.

This also simplifies a lot of code in the debugger: As a result,
Isolate::top_context is not needed anymore since the current context
can always be extracted from a Dart frame.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41422 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-30 15:42:38 +00:00
rmacnak@google.com 3a40319ed2 Remove hard limit from mirrors accessor caches.
Avoids treadmilling the cache when the working set is larger than the cache size, such as the observe loop of a very large Angular app.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39057 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-08 22:20:36 +00:00
rmacnak@google.com bfd342fd8a Remove MirroredCompilationError from the VM.
Regenerate snapshot test due to removed symbol.

BUG=http://dartbug.com/16562
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38202 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-14 18:00:04 +00:00
rmacnak@google.com 14fcffb2b6 Hide synthetic metadata field exposed in r35926.
Also remove Object::CreateInternalMetaData.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37900 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-01 20:09:09 +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
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
rmacnak@google.com ce490637b2 Censor dart:_blink and dart:builtin from the enumeration of libraries in the isolate and from import lists. Note we are not censoring dart:_internal.
For the moment, this doesn't seem to break any language invariants, but that may happen if
a) the censored libraries start producing instances, whose classes would claim to have no library
b) types from the censored libraries are used in type annotations in the privileged libraries that can import them, resulting in types other than dynamic that claim to belong to no library

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37238 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-11 17:58:17 +00:00
rmacnak@google.com 3b5ff25469 Lay waste to ClosureMirror.findInContext.
BUG=http://dartbug.com/18741
R=gbracha@google.com, iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36704 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 19:35:58 +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
hausner@google.com 3f40651e3a Support evaluation of expressions in context of a stack frame
This change adds a debugger API function to evaluate an expression
in the context of a particular stack frame. The expression can
refer to local variables accessible in the frame, but it cannot
alter the variables.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35340 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-23 22:56:23 +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
rmacnak@google.com 9c105f7c9c Handle creating ParameterMirrors for the parameters of forwarding constructors.
BUG=http://dartbug.com/17823
R=hausner@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34494 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-28 01:22:03 +00:00
rmacnak@google.com 78ab60a0de Implement MethodMirror.location in the VM.
R=gbracha@google.com, hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34400 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-26 00:44:54 +00:00
rmacnak@google.com f8c59de4d6 Clean up ClosureMirror.invoke(#call, ...).
R=asiva@google.com, gbracha@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33790 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-17 23:43:32 +00:00
rmacnak@google.com 8c0e1a602e Fix LibraryMirror.invoke to call through the contents of an implicit getter.
BUG=http://dartbug.com/17452
R=asiva@google.com, gbracha@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33682 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-14 01:14:06 +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
rmacnak@google.com 62ad4b82ce Revert "Access to imports in the VM's runtime mirrors. Extend test coverage of the source mirrors."
Review URL: https://codereview.chromium.org//189293002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33402 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-06 22:45:29 +00:00
rmacnak@google.com 2d0e54a94d Access to imports in the VM's runtime mirrors. Extend test coverage of the source mirrors.
BUG=http://dartbug.com/10360
R=gbracha@google.com, hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33397 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-06 22:02:29 +00:00
iposva@google.com f2a6f1b4b6 Another round of cleanups for http://www.dartbug.com/15922
- Address warnings about 64-bit to 32-bit conversions.

R=ajohnsen@google.com, asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32831 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-19 23:35:55 +00:00
rmacnak@google.com 0c821b2457 Fix getField/setField optimization for private members.
BUG=http://dartbug.com/16773
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32634 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-12 23:44:34 +00:00
rmacnak@google.com 1c7fecac7e Add TypeMirror.isSubtypeOf, TypeMirror.isAssignableTo, ClassMirror.isSubclassOf to the API, the VM runtime mirrors and the source mirrors.
BUG=http://dartbug.com/12439
BUG=http://dartbug.com/13856
R=gbracha@google.com, johnniwinther@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32577 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-11 20:41:32 +00:00
rmacnak@google.com d354d73609 Avoid printing the full token stream and doing line/column position calculations when extracting the source of a function where we don't have the original source.
Brings mirrors_reader_test from 2 minutes to 11 seconds on the standalone VM.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32461 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-08 01:18:18 +00:00
rmacnak@google.com 41b3ac826d Adjust assertions in MethodMirror.source not to expect source for implicit constructors or signature functions.
BUG=http://dartbug.com/16588
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32454 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-07 21:46:01 +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
rmacnak@google.com 00c96bfbbf Optimize getField by caching a closure generated from eval.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32343 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-05 23:03:46 +00:00
rmacnak@google.com 7dfcd0f4a1 Add ClassMirror.isAbstract to the API and VM implementation.
BUG=http://dartbug.com/12826
R=gbracha@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31643 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-09 01:27:51 +00:00
rmacnak@google.com 8313c51650 Ensure a class is finalized before attempting any reflective invocation on it.
Avoids mysterious error that results when finalization that is triggered by the reflective invocation fails to propogate a compile-time error.

BUG=http://dartbug.com/15886
R=regis@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31638 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-09 00:18:09 +00:00
rmacnak@google.com d8c4c637bf Revert "Add ClassMirror.isAbstract to the API and VM implementation."
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31633 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-08 22:51:45 +00:00
rmacnak@google.com a5e3c91936 Add ClassMirror.isAbstract to the API and VM implementation.
BUG=http://dartbug.com/12826
R=asiva@google.com, gbracha@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31630 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-08 22:21:43 +00:00
regis@google.com 06830dbbd2 Use a trail instead of a mark bit when processing recursive types in the VM
(issue 15595).

R=asiva@google.com, rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31584 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-07 21:55:07 +00:00