Commit Graph

2008 Commits

Author SHA1 Message Date
regis@google.com 91388a5f79 Simplify and fix instantiation of recursive types.
Add tests for non-contractive types.
Cleanup language tests status file.
Enhance tracing of type finalization.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34739 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-04 18:27:53 +00:00
fschneider@google.com cc9e3b8068 Introduce a lazy-compile stub for functions.
The function's code pointer is either a lazy-compile stub
or the compiled code. The function is compiled on invocation.

There is no need to check for null when invoking a function. This means
one check less when invoking functions via a stub. For this I added a  LazyCompile
stub.

Additional cleanup in Stackmap and PcDescriptors (remove unused code pointer,
and changed smi-lengh into a raw integer).

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34643 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-02 12:37:48 +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
turnidge@google.com bb6003d9b7 Fix line number table generation for multiline strings with interpolation.
Share the line number table generation code between debugger and vm service.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34606 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-01 18:16:27 +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
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
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
regis@google.com f60ab4dd11 Detect and reject illegal recursive types (non-contractive types).
Fixed instantiation and equality of recursive types.
Added many asserts to detect issues with recursive types.
Disabled bad tests. They declare illegal types and will be fixed in a later cl.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34460 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-26 23:38:18 +00:00
turnidge@google.com 99fca31c02 Support Types in instance-ref/instance-view.
Refactor JSON printing for all instances to share more code.  This allows Types to act like Instances in Observatory.

Update the look and feel for the function-view page.

Add script info for functions.

Update tests.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34435 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-26 17:13:03 +00:00
ajohnsen@google.com 38bfed114d Fix memory-issue String::fromCharCodes, where a GC could invalidate an address.
The constructions is now reordered, so the address is not extracted
until after allocation of the new string.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34320 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-24 18:56:36 +00:00
koda@google.com 95894fc2e5 Assert that FreeListElement is never wrapped in a handle.
Previously, this just crashed with a segfault (since its vtable entry is 0).

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34257 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-21 16:31:32 +00:00
srdjan@google.com c8ec766bf0 Print inlined tree using --print_inline_tree. Also added Function::ToQualifiedCString which prints only the class and function name.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34216 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-20 23:53:58 +00:00
asiva@google.com d302dc431a Auto delete persistent weak handles during finalization after invoking the callback associated with the weak handle.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34208 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-20 21:45:43 +00:00
regis@google.com ed690f97b6 Fix canonicalization of types.
Add functions retrieving canonical types by their index or vice versa (used by
a future cl supporting types in vm service).
Add getters for type argument instantiations (used by future cl).

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34128 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-19 18:48:57 +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
johnmccutchan@google.com 6ea46abd34 Create a shadow table to track CodeRegions of reused code address space.
R=asiva@google.com, turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33665 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-13 21:00:44 +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
johnmccutchan@google.com 01c3d1adcb Add compile timestamp to Code
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33555 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-11 21:14:24 +00:00
srdjan@google.com 8de0c6eb8e Fix performance of setRange by avoiding going to Lists.copy which can become polymorphic.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33540 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-11 16:56:55 +00:00
asiva@google.com 3af18cc4c0 1. Restructure reusable handles to make individual Scopes for each handle type
2. Add a convenience macro to make use of reusable handle scopes easier

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33471 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-08 00:26:29 +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
srdjan@google.com 6e882f79e3 When running compile-all, clear code after compiling so that we do not out too much pressure on GC and measure the compilation instead.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33294 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 19:52:21 +00:00
iposva@google.com 762a05195b Fix dartbug.com/17261
- Make sure to preserve type arguments when morphing a growable
  array to a fixed sized array.
- Small performance optimization for getting the number of type
  parameters in a class.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33286 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 18:20:03 +00:00
asiva@google.com e380b175f8 Pass in the isolate parameter to the weak persistent callback handler so that
there is no need to access the current isolate in the callback and delete
path (this code is run while a GC is in progress).

See https://codereview.chromium.org/185643003/ for corresponding changes
in dartium

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33282 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 18:11:19 +00:00
fschneider@google.com 1fbec40a7f Change deoptimization description for materialized objects.
Use field offset instead of fields as arguments in the deoptimization
instructions for materialization of objects. This is to prepare for
materializing contexts and fixed-size arrays when doing allocation sinking.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33267 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 11:53:16 +00:00
johnmccutchan@google.com e9e54f6af6 Cleanup native, collected, and stub code handling in profiler
R=iposva@google.com, turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33177 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-28 22:55:53 +00:00
regis@google.com 8d5dae7798 Allocate instance closures similarly to regular closures, i.e. without a
specific stub and runtime call.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33074 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-26 18:38:47 +00:00
asiva@google.com 04d7a5350f Add Dart_GetNativeFieldsOfArgument to get all the native fields of a dart
object. This is especially useful for dartium which has two native fields
the type id and the native implementation field for the wrapper. This allows
for both values to be extracted in one call.

R=vsm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32905 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-21 16:53:23 +00:00
johnmccutchan@google.com ed5894d0cf Unbox/Box Float64x2 and inline typed array loads and stores
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32869 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-20 20:41:54 +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
turnidge@google.com 21f92bfa63 Don't forget to subtract materialization instructions when computing the offset of the frame pointer after deoptimization.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32773 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-19 01:02:09 +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
turnidge@google.com 174bc974bd Add expandable instances and lists to the vm service.
Review URL: https://codereview.chromium.org//164183003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32707 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-14 17:48:25 +00:00
regis@google.com 9b13508243 Avoid repeated resolution of types by marking them as resolved.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32706 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-14 17:43:11 +00:00
regis@google.com 9380c54628 Make cycle checking of super interfaces linear instead of quadratic by marking
classes as checked (issue 16343).

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32636 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-13 00:14:36 +00:00
hausner@google.com a64a32382b Small cleanup: move all library private key code to Library class
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32522 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-10 22:28:07 +00:00
iposva@google.com 056872727d - Zap the allocated object when allocating uninitialized memory in debug.
- Do not run any smart code when recreating type arguments from a snapshot.
- Adjust assertions.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32510 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-10 18:40:20 +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
srdjan@google.com 2c37517875 Disable hoisting CheckClass due to excessive deoptimization (issue 16285). Detect that a deoptimization was caused by hoisted check class instruction and disable hoisting of CheckClassInstr for that function. This is a short-term solution to fix excessive deoptimization causing slow start-ups.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32460 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-08 00:02:22 +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 ac559f643a Introduce cache of resolved names in library
A name that is not resolved in the local scope gets looked up
in the global scope of the library to which the code being compiled
belongs. The local name dictionary gets searched first, then the
dictionary of each imported library (and and their re-exported
libraries.) Each dictionary lookup includes the lookup of the
mangled getter and setter names, which means that we concatenate
the same name many times.

This change introduces a cache that stores the result of a previous
name lookup, including negative lookup results. The latter is important
to speed up the resolution of names that are not in the global name
space, e.g. class members like .length in lists.

Experiments running dart2js (with VM option --compile_all) show
that this reduces the number of name mangling calls by a factor of 10
and speeds up compiling dart2js by 15%.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32385 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-06 21:32:31 +00:00
srdjan@google.com 8b7ebed54f Mark optimized code that used CHA for optimization so that lazy class 'finalization' does not invalidate that code.
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32335 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-05 20:31:57 +00:00
asiva@google.com 732d1a44de Add a UpdatedGuardedCidBit to Class object so that we don't have
to iterate over all the classes and it's fields to update the
GuardedCid value on each call to Dart_Allocate.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32271 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-04 01:12:55 +00:00
johnmccutchan@google.com 15090664ba Refactor unboxed fields code in preparation of reusable SIMD boxes.
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32199 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-31 16:45:23 +00:00
johnmccutchan@google.com 9d80608b9c Add Float64x2, Float64x2List, etc... with runtime and dart2js implementations
R=sra@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32196 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-31 15:28:05 +00:00
fschneider@google.com 6ffa061fdf Fix stack height assertion code and free up a bit in the Function tag bits.
The bit has_finally was only used to skip the checking of the stack height
at return statements: There was an unused value floating on top of the
expression stack in unoptimized code if the finally block preceded a normal
return statement. Normallyi, that does not cause harm. Optimized code is not
affected since it has a fixed stack size for expression evaluation.

This CL fixes the stack height for functions with try-finally by introducing
a temporary local where the return value is saved before an inlined
finally-block.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32157 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-30 12:12:31 +00:00
hausner@google.com 682855e8cc Ensure the debugger keeps a reference to code objects
Keep the code object in a breakpoint object rather than the
function object. This ensures that the GC can’t collect the
code object while there are breakpoints for the function.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32006 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-24 23:55:11 +00:00