Commit Graph

2925 Commits

Author SHA1 Message Date
vegorov@google.com 41bc926f6c Suppress inlining of complex Bigint intrinsics.
R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41558 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-06 13:56:19 +00:00
regis@google.com 5c55e61647 Resubmit fix for Function::Clone() and Field::Clone() to adjust the class owner
of type parameters (issue 18630).
Make sure to clone the parameter type array as well.
Add regression tests.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41474 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-03 23:16:33 +00:00
regis@google.com 1571d85271 Clarify comment explaining assert in Function::SetParameterTypeAt.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41447 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-31 20:14:56 +00:00
fschneider@google.com 7bec3edaef Remove saving/restoring of the context at function entry.
This is not needed anymore after I changed the current context
to always reside in a local variable.

Further simplifications and cleanup in the debugger.

This also fixes a bad memory retention problem with
non-capturing closures.

BUG=dartbug.com/18886
TEST=tests/language/vm/closure_memory_retention_test.dart
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41433 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-31 07:35:51 +00:00
regis@google.com 71c8b1b210 Revert mixin fix r41424 until mirrors issue 21474 is fixed.
Review URL: https://codereview.chromium.org//691053004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41425 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-30 19:04:02 +00:00
regis@google.com 5a09dee193 Fix Function::Clone() and Field::Clone() to adjust the class owner of type
parameters (issue 18630).
Add regression tests.
Commented out 3 lines in mirror test (issue 21474 filed).

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41424 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-30 17:39:40 +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
fschneider@google.com 1dc4e979d9 Remove isolate pointer from context objects.
By moving all stubs that do runtime calls into the isolate
we don't need to cache the current isolate in each context
object.

This saves space on each context at the cost of duplicating stubs
in each isolate. Most stubs are already isolate-specific and the total number
 of stubs is small enough for this to be a good trade-off.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41279 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-24 12:19:20 +00:00
koda@google.com ede485669b Fix test timeout; faster DEBUG String::CharAt by not using mutable accessor.
BUG=dart:21343
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41218 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-21 00:15:43 +00:00
iposva@google.com 6266f1d4a0 - Do not attempt to set parameter types if they
were already finalized.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41182 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-17 21:50:28 +00:00
iposva@google.com 39703863c4 - Add a separate step to finalize the VM isolate explicitly.
- Allocate the method extractor parameter types and names
  only once, namely in the VM isolate.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41173 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-17 17:02:19 +00:00
hausner@google.com 2f49f29c38 Await always waits
The expression ‘await e’ always suspends the enclosing function. If e does not
evaluate to a an object o of type Future, a new Future is created using Future.value(o).

A small change in the backend allows a return instruction to be followed by
other instructions. In async functions, a return can suspend the function and the
continuation point is in the same code block after the return.

Other small changes:
- More user-friendly error message if async/await is not enabled.
- Programs no longer need to import dart:async when using async/await.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41105 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-14 19:58:06 +00:00
koda@google.com 1fbac47d9e Write barrier audit: const raw_ptr()
raw_ptr() now returns a const*, and all writes within objects must be routed through a well-defined set of methods on Object.

Note: This also includes writes to non-pointer fields, to enable low-level verification of all writes. Additionally, it allows enforcing a NoGCScope around such writes to protect against moving objects.

Add a bunch of these (now required) NoGCScopes.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41058 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-11 00:26:54 +00:00
koda@google.com b7db007f71 Fix Object::Clone.
Exclude header when copying: default value for its tags will be that of a fresh object.
Correct logic for adding the clone to the store buffer.

BUG=21273

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41055 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-10 23:26:58 +00:00
vegorov@google.com e6113cc0f5 If bounds check 0 <= index < length is not redundant we attempt to
replace it with a sequence of checks that guarantee

          0 <= LowerBound(index) < UpperBound(index) < length

and hoist all of those checks out of the enclosing loop.

Upper/Lower bounds are symbolic arithmetic expressions with +, -, *
operations and are computed based on discovered simple induction variables.

Simple induction variable is a variable that follows the pattern v1 <- phi(v0, v1 + 1)

BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40969 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-07 18:50:29 +00:00
koda@google.com a6c75c3960 Fix Object::Clone heap corruption under concurrent sweeping.
Don't clone the mark bit; for details,
see https://code.google.com/p/dart/issues/detail?id=21236

BUG=21236
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40926 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-06 13:28:27 +00:00
koda@google.com 366ac688e3 Write barrier audit, part 1.
First step towards complete audit of all writes to the heap for write barrier compliance (at least on simulator debug builds).

This first CL is a semi-mechanical refactoring to route most Object field writes through StoreNonPointer and StoreSmi methods.

A few stores were converted to StorePointer (skipping the write barrier check is premature optimization for those cases).

Next step will be to make raw_ptr() return a const pointer and use the constness to clean up remaining writes in C++.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40889 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-02 20:47:45 +00:00
hausner@google.com e62533bcbe Fix corner case in partial script url matching
Fixes issue 21182

R=rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40860 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-01 22:53:15 +00:00
regis@google.com f6c6ac61dd Second attempt at fixing warning on Windows.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40827 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-01 00:20:43 +00:00
regis@google.com 3cf27d550e Disable 2 intrinsics causing optimizer issues (under investigation).
Rename 2 intrinsics (was not the issue).
Added a static cast to eliminate a warning on Windows.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40825 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-30 23:01:40 +00:00
regis@google.com f7ac8841a9 Provide ia32 intrinsics for bigint add, sub, quotient digit estimation, and
Montgomery mulMod.
Refactored bigint dart code to allow for the above intrinsics.
Added support for unsigned  division on ia32 and added assembly tests.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40822 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-30 18:49:41 +00:00
regis@google.com 50086cbc75 Resubmit reverted r40623 unchanged after GC issue fixed.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40815 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-30 16:21:23 +00:00
koda@google.com 60b12996ec Track references to allocation stubs via static_calls_table, instead of keeping two referencers alive.
(Verbatim copy of srdjan's https://codereview.chromium.org/609893002/ )

TBR=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40738 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-26 20:17:53 +00:00
hausner@google.com b8499c27bb Allow setting breakpoints specifying the suffix of a file path
In this version, the VM does not set a breakpoint if the url given
matches the suffix of more than one loaded script.

Partial matches must start with a path separator or with the character immediately following a path separator.

E.g. d.dart will match /tmp/d.dart, but not /tmp/ed.dart.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40736 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-26 20:11:24 +00:00
koda@google.com a56293ab7d Break out WeakCodeReferences to own file in preparation to use it outside object.cc.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40656 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-24 22:43:05 +00:00
whesse@google.com 1f87b5feba Revert r40623, "Refactor bigint _sqrTo in preparation of intrinsification."
This reverts commit r40623, https://codereview.chromium.org//600533002, which
is failing snapshot generation on x64 and arm architectures.

BUG=dartbug.com/21061
R=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40628 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-24 09:40:19 +00:00
regis@google.com edd503f7d0 Refactor bigint _sqrTo in preparation of intrinsification.
Provide _sqrAdd intrinsic on ia32.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40623 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-24 01:51:04 +00:00
rmacnak@google.com 7899a9cc64 Mark _Bigint._mulAdd and conversion methods in typed_data as invisible. Strengthen the mirror invocation fuzzer.
BUG=http://dartbug.com/21046
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40609 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-23 22:01:45 +00:00
rmacnak@google.com 645b5a0d2b Revert "Add _Bigint._mulAdd to the invisible list. Strengthen the mirror invocation fuzzer."
Review URL: https://codereview.chromium.org//590703003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40580 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-23 00:01:33 +00:00
rmacnak@google.com 7e7d568be5 Add _Bigint._mulAdd to the invisible list. Strengthen the mirror invocation fuzzer.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40576 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-22 22:46:40 +00:00
asiva@google.com 8762719b28 Remove some of the unused classes stored in the object store.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40531 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-19 23:48:49 +00:00
asiva@google.com 302c93b050 1. Add user tag to the pointers traversed in the object store
2. Added support for UserTag objects in a full snapshot.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40508 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-19 18:00:13 +00:00
srdjan@google.com 5ef243e688 Make sure Bigint._digits is always a Uint32List and bever null. Adapt type information for get:_digits.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40463 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-18 21:18:25 +00:00
asiva@google.com 3f6e337e87 Fix issue 20983 (https://code.google.com/p/dart/issues/detail?id=20983)
The check for load error on completion of async load was very inefficient.
Added a Hash set to ensure we don't repeatedly traverse through a library
when trying to establish transitive load errors.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40422 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-18 02:01:26 +00:00
vegorov@google.com d61a330d7c Initial steps towards cleaning up integer arithmetic IR.
Introduce base classes for binary and unary integer operations and move all shared logic (e.g. canonicalization) into these classes.

Start removing special cases dispatch from instructions patterns - it goes into Canonicalization pass.

Start removing duplication between instruction patterns where meaningful and possible.

Cleanup the notion of truncation in the operations: is_truncating implies !can_overflow, not the other way around.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40375 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-17 13:31:13 +00:00
srdjan@google.com 4bb01949bc Fix to allocation stub invalidation: we cannot just remove it as it will be collected even though code still may reference it. Since we should probably have two different allocation stubs, keep two in the class and switch between them. Future work will put intelligence in the allocation stub selection. Added Daniel's test flag & code.
R=koda@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40327 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-16 17:01:17 +00:00
hausner@google.com 48807614ee Eliminate 99% of allocated ExceptionHandler objects
The vast majority of functions have no exception handlers, thus they can all
share a single ExceptionHandler descriptor.

This CL reduces the number of ExceptionHandler objects on the heap from
about 8400 to 16, from 132KB to less than 1KB, when running dart2js.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40323 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-16 16:27:04 +00:00
hausner@google.com d8a70f2932 Save more memory by compacting LocalVarDescriptors
(Re-landing this change after assertions fixed.)

Instead of allocating an array for the names of local variables,
store the names in the LocalVarDescriptors structure directly.

Using dart2js to compile a small dart program results in about 7200
LVDs on the heap.

Retained memory before: 568KB
Retained memory after: 432KB (75%)

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40276 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 21:34:58 +00:00
ricow@google.com 941403f9c7 Revert revision 40228
This is making us crash across platforms in debug mode, see e.g., 
http://build.chromium.org/p/client.dart/builders/vm-linux-debug-x64-be/builds/2967

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40231 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 06:37:18 +00:00
hausner@google.com acf28bc37e Save more memory by compacting LocalVarDescriptors
Instead of allocating an array for the names of local variables,
store the names in the LocalVarDescriptors structure directly.

Using dart2js to compile a small dart program results in about 7200
LVDs on the heap.

Retained memory before: 568KB
Retained memory after: 432KB (75%)

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40228 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-12 23:53:03 +00:00
regis@google.com 7bdc60aa36 Resurrect tests from deleted bigint_operations_test.cc into new bigint_test.cc
and into existing big_integer_vm_test.dart.
Fix a rounding error allocating digit array in Bigint::NewFromDecCString.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40188 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 22:34:02 +00:00
rmacnak@google.com cefb21b6a3 Narrow String::CharAt from int32_t to uint16_t.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40178 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 20:55:36 +00:00
rmacnak@google.com 128148aafc Preserve the contents of Dart strings with unmatched surrogate halfs by avoiding a UTF16 -> UTF8 -> UTF16 conversion.
Clean up some confusion between code points and code units.

BUG=http://dartbug.com/20583
BUG=http://dartbug.com/20874
R=turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40174 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 18:42:04 +00:00
srdjan@google.com dd9c0ef25e Allow invalidation and recompilation of instance allocation stubs. Requested in order to implement better pretenuring strategy.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40168 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 17:56:42 +00:00
hausner@google.com 2f2cedfa42 Optimize LocalVarDescriptor objects for functions that have no local variables
Allocate a canonical “empty” variable descriptor object. Saves about 10% of
variable descriptor space when running dart2js.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40158 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 16:08:59 +00:00
regis@google.com 9ff3cd3342 Fix wrong conversion from double to bigint in overriden operators of new bigint.
Fix ambiguous call to pow on Windows.
Fix big_integer_vm_test to use numbers large enough to actually be bigint.
Re-enable dart2js tests.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40122 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-10 22:26:59 +00:00
johnmccutchan@google.com 22144dbed2 Add support for TokenStream, LocalVarDescriptors, and PcDescriptors to service lib
Add generic 'Object' ref and view element. This will work for any ServiceObject with type == 'Object'.

Ref element uses the vmType as the link text if there is no name.
View element is mostly just <object-common> but that allows calculating retaining path, retained size, etc.

BUG=
R=rmacnak@google.com, turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40119 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-10 21:20:59 +00:00
regis@google.com dcb201f22c Fix Windows build.
R=koda@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40075 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-10 01:19:49 +00:00
regis@google.com 0220e41d72 New bigint implementation in the vm.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40061 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-09 21:47:44 +00:00
rmacnak@google.com 27b99b257c Don't double-escape strings in the VM Service, and don't use \u0000 to determine the string length.
This makes characters above ASCII to display as themselves in Observatory, strings with \u0000 in the middle not to be truncated, and avoids a bug in the previous escaping where a non-ASCII character in the last position would have its escaped representation cut off.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40060 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-09 21:34:06 +00:00