Commit Graph

2925 Commits

Author SHA1 Message Date
iposva@google.com 99d563982c - Support for patching of class methods and fields.
Review URL: https://chromiumcodereview.appspot.com//10827288

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10616 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 00:38:01 +00:00
srdjan@google.com 8299db1ff0 Optimize equality for case when all targets are Object.equals.
Also fixes a couple of issues with https://chromiumcodereview.appspot.com/10830275/
Review URL: https://chromiumcodereview.appspot.com//10826285

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10615 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 23:44:07 +00:00
iposva@google.com f29e6bb659 - Split Dart core libraries into shared sources and patch sources.
Currently this split goes along the runtime vs. library directories,
  eventually more shared code will be sitting in the shared library
  sources.
Review URL: https://chromiumcodereview.appspot.com//10834284

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10612 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 23:01:20 +00:00
asiva@google.com 00dd8aa761 Remove functions_cache_ and it's references as it is not being used anymore.
Review URL: https://chromiumcodereview.appspot.com//10824266

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10542 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 23:33:37 +00:00
asiva@google.com 5fd180cdfc 1. Register canonical names for internal VM classes and get rid of the method GetSingletonClassName
2. Create the empty_array object as a singleton in the VM isolate and remove it from the object store
3. Remove eager population of the functions_cache entry in the class. This results in a pretty impressive reduction of the initial isolate heap size:
    - on IA32 it goes from 1331k to 1071k
    - on X64 it goes from 2431k to 1911k
    - snapshot size also is reduced from 859219 bytes to 789147 bytes.
    (as a follow up change I will consider completely removing functions cache)
Review URL: https://chromiumcodereview.appspot.com//10827249

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10535 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 21:43:00 +00:00
asiva@google.com d218086729 1. Write out only the kind_tag_ field of a function in the snapshot instead of the individual bits as boolean values. This reduces the snapshot size by about 4k
2. Move the kind_tag_ accessor functions from RawFunction to Function (we try not to have any code in the Raw classes).
Review URL: https://chromiumcodereview.appspot.com//10831248

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10528 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 20:35:59 +00:00
iposva@google.com f0862ed7d0 - Improve generated sources:
+ Strip private key from identifiers.
  + Properly handle strings with interpolation.
- Keep private key in the token stream and properly snapshot. 
Review URL: https://chromiumcodereview.appspot.com//10823269

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10515 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 17:01:08 +00:00
regis@google.com f1bdaf504a Retrying r10475 (now with null check):
Continue work on type propagation in optimizing compiler (still WIP).
Propagated types are cached in ssa definition nodes.
Type propagation iterates until fix point is reached.
Type checks are marked as eliminated when possible.
Review URL: https://chromiumcodereview.appspot.com//10854084

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10478 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 01:26:13 +00:00
regis@google.com 7e27be6b90 Revert r10475.
Review URL: https://chromiumcodereview.appspot.com//10831252

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10476 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 00:39:42 +00:00
regis@google.com 28bd435419 Continue work on type propagation in optimizing compiler (still WIP).
Propagated types are cached in ssa definition nodes.
Type propagation iterates until fix point is reached.
Type checks are marked as eliminated when possible.
Review URL: https://chromiumcodereview.appspot.com//10829270

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10475 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 00:07:21 +00:00
srdjan@google.com 32d5673c05 Move deopt reason into PcDescriptor so the EAX/RAX register is not destroyed. Some cleanups in PC descriptor.
Review URL: https://chromiumcodereview.appspot.com//10832214

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10424 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 22:15:38 +00:00
asiva@google.com d4d781d636 - Unify class ids and snapshot object ids list so that we don't have disparate
and sometimes confusing values.
- Remove instance_kind_ field from RawClass.
- Rename all class id names to have a Cid suffix.
- Remove code from object.h and object_store.h which dealt with object ids
  of predefined classes for snapshots.
Review URL: https://chromiumcodereview.appspot.com//10827209

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10418 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 19:46:23 +00:00
turnidge@google.com 2d1435f615 Don't call IdentifierPrettyName with signature classes.
Review URL: https://chromiumcodereview.appspot.com//10855052

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10415 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 18:28:14 +00:00
iposva@google.com de7f866c4a - Allow patching of top-level methods and accessors.
Review URL: https://chromiumcodereview.appspot.com//10824209

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10409 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 17:29:49 +00:00
turnidge@google.com 2d70c7a5eb Improve the stack trace output to be more readable.
BEFORE

Unhandled exception:
MyException
 0. Function: '::baz' url: 'file:///Users/turnidge/dart/bug.dart' line:2 col:3
 1. Function: '_OtherClass@11f7ef14._OtherClass@11f7ef14._named@11f7ef14' url: 'file:///Users/turnidge/dart/bug.dart' line:7 col:8
 2. Function: '::set:globalVar' url: 'file:///Users/turnidge/dart/bug.dart' line:12 col:3
 3. Function: '::_bar@11f7ef14' url: 'file:///Users/turnidge/dart/bug.dart' line:16 col:3
 4. Function: 'MyClass.get:field' url: 'file:///Users/turnidge/dart/bug.dart' line:25 col:9
 5. Function: 'MyClass.fooHelper' url: 'file:///Users/turnidge/dart/bug.dart' line:30 col:7
 6. Function: 'MyClass.foo' url: 'file:///Users/turnidge/dart/bug.dart' line:32 col:14
 7. Function: 'MyClass.function' url: 'file:///Users/turnidge/dart/bug.dart' line:21 col:15
 8. Function: 'MyClass.MyClass.' url: 'file:///Users/turnidge/dart/bug.dart' line:21 col:18
 9. Function: '::function' url: 'file:///Users/turnidge/dart/bug.dart' line:38 col:10
 10. Function: '::main' url: 'file:///Users/turnidge/dart/bug.dart' line:38 col:24

AFTER

Unhandled exception:
MyException
#0      baz (file:///Users/turnidge/dart/bug.dart:2:3)
#1      _OtherClass._OtherClass._named (file:///Users/turnidge/dart/bug.dart:7:8)
#2      globalVar= (file:///Users/turnidge/dart/bug.dart:12:3)
#3      _bar (file:///Users/turnidge/dart/bug.dart:16:3)
#4      MyClass.field (file:///Users/turnidge/dart/bug.dart:25:9)
#5      MyClass.foo.fooHelper (file:///Users/turnidge/dart/bug.dart:30:7)
#6      MyClass.foo (file:///Users/turnidge/dart/bug.dart:32:14)
#7      MyClass.MyClass.<anonymous closure> (file:///Users/turnidge/dart/bug.dart:21:15)
#8      MyClass.MyClass (file:///Users/turnidge/dart/bug.dart:21:18)
#9      main.<anonymous closure> (file:///Users/turnidge/dart/bug.dart:38:10)
#10     main (file:///Users/turnidge/dart/bug.dart:38:24)
Review URL: https://chromiumcodereview.appspot.com//10826191

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10408 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 17:22:26 +00:00
srdjan@google.com 3dfabb26ea Verify at method exit that stack size is the same as at entry, except for methods with finally clauses. Mark functions that have finally clauses as they may produce extra values on stack. Note that we currently do not optimize methods with finally clauses and therefore there are no issues related to incorrect stack size at deoptimization.
Review URL: https://chromiumcodereview.appspot.com//10824201

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10351 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-07 20:15:17 +00:00
kmillikin@google.com 9f5f977732 Account for '\0' string terminator in allocated buffers.
OS::SNPrint takes a size in bytes argument that includes the null
terminator, it returns the number of characters printed not including
the null terminator.  Unfortunately we don't have a uniform way of
writing this.

This change fixes three sites that do not account for the terminator
when writing, with the effect of dropping the last character before
the terminator.

R=srdjan@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10823181

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10329 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-07 10:19:33 +00:00
srdjan@google.com 10b1928a3d Add deopt info to code object and print it. Still missing is the code to 'execute' the deopt instructions and thus deoptimize.
Review URL: https://chromiumcodereview.appspot.com//10823131

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10308 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 21:15:26 +00:00
regis@google.com 6f5281c404 Get rid of ast node ids.
Rename cid to deopt_id.
Review URL: https://chromiumcodereview.appspot.com//10832150

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10306 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 20:24:03 +00:00
kmillikin@google.com 70bd677417 Reapply "Use platform-independent format specifiers when disassembling code objects."
This reapplies svn revision 10163 with a (tested) fix for Windows.

R=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10834155

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10282 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 10:50:38 +00:00
asiva@google.com cd5b8f890c Address review comments.
Review URL: https://chromiumcodereview.appspot.com//10829177

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10264 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-03 22:30:53 +00:00
turnidge@google.com 2803d78dfd Change the zone allocation api.
Instead of passing a size in bytes to the allocation function, we now
have a templatized Alloc function:

  zone->Alloc<Type>(len)

This is better for security, as we can check for integer overflow in
the size computation before performing the allocation.  Before, we
often failed to check this.
Review URL: https://chromiumcodereview.appspot.com//10836061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10254 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-03 21:51:44 +00:00
asiva@google.com 540b01f66f Eagerly get the function and code corresponding to the frame elements in a stack trace so that we won't be doing expensive code object lookups when setting up the stack trace.
Review URL: https://chromiumcodereview.appspot.com//10824128

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10248 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-03 20:30:08 +00:00
regis@google.com 12de02cbab Associate the correct type to method receivers (instead of Dynamic type).
Properly name the first implicit parameter to factories as ':type_arguments'
(instead of 'this', which made it accessible to user code).
Various cleanup.
Review URL: https://chromiumcodereview.appspot.com//10831142

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10203 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 23:00:55 +00:00
srdjan@google.com 85f242dbb1 Adding deopt info to code object.
Review URL: https://chromiumcodereview.appspot.com//10830131

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10189 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 18:28:11 +00:00
kmillikin@google.com effc29cd25 Revert "Use platform-independent format specifiers when disassembling code objects."
This is still broken on Windows.

TBR=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10826116

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10175 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 15:52:05 +00:00
kmillikin@google.com b73d4d2af2 Reapply "Use platform-independent format specifiers when disassembling code objects."
This reapplies svn revision 10163 with a fix for Windows.

R=ager@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10824148

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10174 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 15:45:00 +00:00
kmillikin@google.com 20083dfd85 Revert "Use platform-independent format specifiers when disassembling code objects."
Revert svn revision 10163 while working on a Windows fix.

R=ager@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10850017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10169 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 13:51:23 +00:00
kmillikin@google.com 515f92ea3f Use platform-independent format specifiers when disassembling code objects.
R=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10824144

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10163 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 13:19:28 +00:00
turnidge@google.com 8b68d343c7 Enforce length/size limits for variable size heap object in order to
avoid overflow.

For each variable size heap object, compute the maximum number of
elements and use that in the ::New functions to avoid overflow.  If a
bad length/size reaches a ::New function, that is a FATAL error -- the
problem should have been caught earlier by the dart api or by the
library code.

Add "border guards" in the dart api and in library calls which cause
new variable size heap objects to be allocated.  We check for invalid
length/size and throw explanatory error messages.
Review URL: https://chromiumcodereview.appspot.com//10782016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10130 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-01 18:22:30 +00:00
hausner@google.com b3917271aa Optimize away most implicit const getter functions
If a static field has a very simple initializer expression
(a literal number or string for example) we initialize the field
directly while compiling instead of generating an implicit
getter. We only do this if the type of the expression is
assignment compatible with the field. If the expression is not
compatible, we let the implicit getter do the error checking.

This eliminates about 330 implicit getters in the core libraries
and saves 35k in the snapshot (830k, down from 865k).
Review URL: https://chromiumcodereview.appspot.com//10826090

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10098 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-31 23:33:48 +00:00
turnidge@google.com a3a73029f0 Consolidate a few fields in RawFunction using bitfields.
Remove kAbstract from the list of function kinds.  It now has its own
dedicated bit.  This allows us to distinguish abstract methods from
abstract getters and setters.
Review URL: https://chromiumcodereview.appspot.com//10796004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10087 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-31 21:26:28 +00:00
srdjan@google.com ac8041f15d First step toward deoptimization using deoptimization info: splits deoptimization into two steps: copy frame to buffer, fill unoptimized frame from buffer. The only changes in the frame are the return address and the PC marker.
Second step will add deoptimization info 'instructions' that will fill the unoptimized frames using the saved registers and frame data.
Review URL: https://chromiumcodereview.appspot.com//10836020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10071 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-31 17:27:15 +00:00
iposva@google.com e5a314d222 - Allow parsing of external methods.
Review URL: https://chromiumcodereview.appspot.com//10821076

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10028 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-30 22:46:24 +00:00
hausner@google.com 2db691aa14 Better breakpoint management
If a function is already compiled, make a source breakpoint at
the actual breakpoint line number, which may be different from the
requested line number.

Fixes an issue that was brought up in bug 3782.
Review URL: https://chromiumcodereview.appspot.com//10839002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10027 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-30 22:37:10 +00:00
kmillikin@google.com f440cf8292 Fix an off-by-one error in the stack frame iteration.
When using a stackmap, we mapped stackmap index 0 to the code slot in the
frame.  This code is still unused, but judging from the test the intent is
to map index 0 to the first local slot in the frame.

R=vegorov@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10835034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10013 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-30 13:36:58 +00:00
kmillikin@google.com 726abcb503 Change the stack map search to require an exact match.
R=vegorov@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10829036

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10006 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-30 10:02:16 +00:00
hausner@google.com 741a12cfd6 Support const modifier in fields, variables
Issue 3551

This change adds const as a valid keyword to declare fields and
variables. The mandatory initializer has to be a compile time
const expression.

Static final variables still have to be initialized with
compile time constant expressions. I will add non-const static
finals (issue 3558) in another change.

Other small changes:
- allow null in some compile time constant expressions.
- allow only numbers, booleans, strings and null in compile time
  constant string interpolation.
Review URL: https://chromiumcodereview.appspot.com//10828053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9992 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-27 20:49:24 +00:00
iposva@google.com d68bf3be66 - Add the ability to protect VirtualMemory.
- Write protect the VM isolate once it has been constructed.
Review URL: https://chromiumcodereview.appspot.com//10830045

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9984 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-27 18:07:59 +00:00
regis@google.com af26648b46 Fix Function::NumberOfImplicitParameters() for closure functions.
Related to cl 10831021.
Review URL: https://chromiumcodereview.appspot.com//10829041

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9957 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-26 18:45:54 +00:00
iposva@google.com c34b1216f4 - Improve the formatting of generated source text.
Review URL: https://chromiumcodereview.appspot.com//10823028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9952 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-26 18:07:56 +00:00
regis@google.com 8fe3e69e37 Improve static type propagation.
Review URL: https://chromiumcodereview.appspot.com//10823022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9943 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-26 16:04:36 +00:00
cshapiro@google.com 772a399cab Emit symbol maps for compiled code for use by the Linux perf tool.
Review URL: https://chromiumcodereview.appspot.com//10831005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9922 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-26 00:21:25 +00:00
asiva@google.com ed8db0f611 Move more symbols to the vm isolate.
Review URL: https://chromiumcodereview.appspot.com//10808111

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9905 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-25 20:31:26 +00:00
srdjan@google.com 3402769c7a Use kIllegalObjectKind instead of NULL object to terminate ICData array
Review URL: https://chromiumcodereview.appspot.com//10796103

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9835 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-24 00:31:32 +00:00
asiva@google.com ec7f44f025 Create frequently used symbols in the vm isolate
- Avoids the need for doing a NewSymbol on these everytime
- saves space as they get shared by isolates
Review URL: https://chromiumcodereview.appspot.com//10783035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9834 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-24 00:01:50 +00:00
asiva@google.com ef67b96777 Rename some of the enum definitions inside classes to avoid conflict with the ObjectKind enum.
Review URL: https://chromiumcodereview.appspot.com//10808064

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9792 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-20 22:24:49 +00:00
iposva@google.com 7f843b0fc9 - Start using the collected store buffer entries to find
old->new references during Scavenge.
Review URL: https://chromiumcodereview.appspot.com//10797021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9791 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-20 21:41:55 +00:00
regis@google.com 1eed55c529 Add missing type finalization for function literals not assigned to a function
variable.
Various cleanup.
Review URL: https://chromiumcodereview.appspot.com//10797031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9782 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-20 16:08:43 +00:00
regis@google.com 318edd938c Hide names of internal classes from the user by mapping them to the documented
interfaces they implement.
Review URL: https://chromiumcodereview.appspot.com//10800002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9748 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-18 21:51:27 +00:00