Commit Graph

2925 Commits

Author SHA1 Message Date
asiva@google.com 3f14a14ee7 Implement 'dart:typeddata' directly in the VM instead of using 'dart:scalarlist'
Review URL: https://codereview.chromium.org//12544015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19656 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-07 21:50:33 +00:00
regis@google.com f644ba9791 Complete implementation of bounds checking in the vm, by introducing a vm object
BoundedType that represents a type that could not be checked against an upper
bound at compile time. A BoundedType is verified at run time when used,
typically when it (and/or its bound) gets instantiated.
This fixes issues 7075 and 7625.
Added one test.
Review URL: https://codereview.chromium.org//12473002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19519 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-05 22:04:23 +00:00
asiva@google.com 97f6dee777 First step towards implementing dart:typeddata library.
Review URL: https://codereview.chromium.org//12313088

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19427 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-04 22:11:45 +00:00
fschneider@google.com 7ea9189805 Fix null-termination bug in Stacktrace::ToCString.
Under certain conditions Stacktrace::ToCString can return
a not null-terminated string.

This is the case when ToCStringInternal is invoked with a stacktrace
of length 0.

BUG=dart:8850
TEST=tests/language/stacktrace_test.dart
Review URL: https://codereview.chromium.org//12387019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19282 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-01 09:03:45 +00:00
asiva@google.com 48418a75f7 Fix stack frame index numbers for full stack traces
It used to be:
#0      getCurrentStackTrace (file:///tmp/junk.dart:3:5)
#0      func1 (file:///tmp/junk.dart:10:29)
#1      func2 (file:///tmp/junk.dart:14:8)
#2      func3 (file:///tmp/junk.dart:18:8)
#3      func4 (file:///tmp/junk.dart:22:8)
#4      main (file:///tmp/junk.dart:26:8)
(Notice the two #0 frames on top).

Now it will print this as:
#0      getCurrentStackTrace (file:///tmp/junk.dart:3:5)
#1      func1 (file:///tmp/junk.dart:10:29)
#2      func2 (file:///tmp/junk.dart:14:8)
#3      func3 (file:///tmp/junk.dart:18:8)
#4      func4 (file:///tmp/junk.dart:22:8)
#5      main (file:///tmp/junk.dart:26:8)
Review URL: https://codereview.chromium.org//12381030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19272 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-01 03:00:52 +00:00
tball@google.com 15f62a9361 Fixed debugger stacktrace generation that failed a VM assertion.
Added LocalVarDescriptors.ToCString(), which is just used when
debugging debugger issues, and is not referenced by any public APIs.
Review URL: https://codereview.chromium.org//12380031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19255 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-28 20:45:37 +00:00
srdjan@google.com 59386b206c Intrinsify OnebyteString's hashcode. Next step is to inline it.
Review URL: https://codereview.chromium.org//12335138

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19182 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 22:58:59 +00:00
asiva@google.com 3c90369ba6 Add functionality to get full stack trace when exceptions are thrown.
This should address the issue raised in 7813.

try {
 ...
 ...
} on Object catch(e, s) {
 print(s.fullStackTrace);  // This should print the full stack trace.
}
Review URL: https://codereview.chromium.org//12316116

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19179 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 22:47:06 +00:00
iposva@google.com 5c71abedff - Do not use the ? operator in the List factory.
Review URL: https://codereview.chromium.org//12335146

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19178 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 22:36:22 +00:00
regis@google.com 7c4eec75ed Fix bad optimization prematurely marking types as instantiated (issue 8710).
Add test.
Review URL: https://codereview.chromium.org//12314132

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19101 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 00:32:31 +00:00
srdjan@google.com 85b8a8742b Improve performance of Onebytestring allocation and hascode computatio. About 10% improvement on a JSON benhchmark.
Review URL: https://codereview.chromium.org//12315117

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19099 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 00:03:53 +00:00
asiva@google.com 614b946f8a Resubmit change 19074.
Review URL: https://codereview.chromium.org//12335111

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19096 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-26 23:24:24 +00:00
asiva@google.com 487e5fa10a Revert change 19074 until the windows build is fixed.
Review URL: https://codereview.chromium.org//12335107

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19084 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-26 21:41:29 +00:00
asiva@google.com fcd78010e7 Fix for bug 6767 - Limit stack trace collection for stack overflow exceptions.
Use pre allocated stack object for collecting strack trace in the case of OOM
and stack overflow exceptions.
Review URL: https://codereview.chromium.org//12320103

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19074 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-26 19:07:40 +00:00
iposva@google.com 666675fc9e - The dart:json library is now using patches.
Review URL: https://codereview.chromium.org//12335082

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19019 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 23:31:57 +00:00
iposva@google.com b564104ea5 - Properly load the core libraries as libraries and not as scripts.
This will honor their imports and library names.
Review URL: https://codereview.chromium.org//12321082

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19017 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 23:25:29 +00:00
johnmccutchan@google.com 2e216391f3 Simd128Float32, Simd128Mask, and Simd128Float32List additions for dart:scalarlist
Review URL: https://codereview.chromium.org//12303013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19001 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 21:12:50 +00:00
sra@google.com 039864883a Revert "Revert "Use browsers JSON.parse for parsing JSON (#3)""
Fix more IE special cases

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18933 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-23 00:21:24 +00:00
srdjan@google.com ad6a87d6ad Improve performance of String::ToCString for OneByteStrings and parsing of doubles. Leads to significant speedups in json parsing.
Review URL: https://codereview.chromium.org//12317076

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18925 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-22 22:43:36 +00:00
sra@google.com 0d95ced3dc Revert "Use browsers JSON.parse for parsing JSON (#3)"
Review URL: https://codereview.chromium.org//12313069

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18911 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-22 19:34:08 +00:00
sra@google.com 1b988548de Use browsers JSON.parse for parsing JSON (#3)
Original CL: https://codereview.chromium.org//12114021

This version modified to take advantage of dart:json being moved to VM.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18908 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-22 19:21:18 +00:00
asiva@google.com 97ef3c86d3 Move json, uri, utf and crypto libraries into the VM.
This should ensure that we would not need a patch per embedder for these libraries in case somebody decides to patch these.
Review URL: https://codereview.chromium.org//12318031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18865 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-22 01:24:57 +00:00
iposva@google.com c900112af7 - Improve the message for NoSuchMethodErrors that are
determined statically at compile time.
Review URL: https://codereview.chromium.org//12328019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18848 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 18:53:27 +00:00
fschneider@google.com 8fa3140676 Inline ByteArray._setIndexed in the flow graph optimizer.
Review URL: https://codereview.chromium.org//12317011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18818 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 11:35:19 +00:00
regis@google.com 8c44be4313 Add support for object pool that will be used on ARM and MIPS architectures.
Modify code patching infrastructure to accept code object, which is necessary to
get to the object pool containing patchable target addresses.
Modify assembler test infrastructure to provide associated code object.
Review URL: https://codereview.chromium.org//12260026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18604 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-15 23:55:31 +00:00
srdjan@google.com 39713f0efc The code size does not scale with architecture word size, set code size cutoff limit to 200,000 bytes for all architectures
Review URL: https://codereview.chromium.org//12256028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18492 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-13 23:00:09 +00:00
srdjan@google.com 4f285ac0a8 Add flag to block optimizations of large implicit getters. Implicit getters have a 0 size in tokens, therefore also check the size of unoptimized code to decide if a function is optimizable. Print more data with --trace-compiler.
Review URL: https://codereview.chromium.org//12263017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18485 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-13 21:52:02 +00:00
hausner@google.com b4527a7465 First stab at mixins in VM compiler
Things not yet supported:
- Type parameters for super class and mixin class
- super call limitation check
Review URL: https://codereview.chromium.org//12210127

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18479 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-13 21:08:15 +00:00
vegorov@google.com baa0347253 Reapply r18377 it was reverted due to the unrelated bug it surfaced.
Remove SminessPropagator and FlowGraphTypePropagator and all associated infrastructure and fields.

Replace multiple fields (result_cid_, propagated_cid_, propagated_type_, reaching_cid_) with a single field of type CompileType which represents an element of type analysis lattice and incorporates information about: value's nullability, concrete class id and abstract super type. This ensures that propagated cid and type are always in sync and complement each other

Implement a new FlowGraphPropagator that propagates types over the CompileType-lattice.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18456 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-13 17:16:35 +00:00
vegorov@google.com 487c73e01f Revert "Remove SminessPropagator and FlowGraphTypePropagator and all associated infrastructure and fields."
This reverts commit r12365.

Reason: failure on vm-mac-debug (debug_ia32 standalone/io/file_fuzz_test).

TBR=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18378 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-12 12:36:21 +00:00
vegorov@google.com f8d9a90b2c Remove SminessPropagator and FlowGraphTypePropagator and all associated infrastructure and fields.
Replace multiple fields (result_cid_, propagated_cid_, propagated_type_, reaching_cid_) with a single field of type CompileType which represents an element of type analysis lattice and incorporates information about: value's nullability, concrete class id and abstract super type. This ensures that propagated cid and type are always in sync and complement each other

Implement a new FlowGraphPropagator that propagates types over the CompileType-lattice.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18377 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-12 12:06:47 +00:00
iposva@google.com d421507d55 - Remove redundant type parameters for internal data.
Review URL: https://codereview.chromium.org//12218082

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18287 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-08 23:27:50 +00:00
iposva@google.com fe95f789c8 - Add handling of private dart:_ libraries.
- Make dart:collection-dev a private library by renaming it to dart:_collection-dev.
- Predefine the URIs of dart: libraries as VM symbols.
Review URL: https://codereview.chromium.org//12220027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18159 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-06 00:29:48 +00:00
hausner@google.com 9d42f829f2 Save 0.00001% memory
Release the functions and fields array after patching classes.
Review URL: https://codereview.chromium.org//12207028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18158 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-05 22:43:57 +00:00
hausner@google.com e56a1fc324 Remember owner class of patch code
This is a step towards using PatchClass for mixins
Review URL: https://codereview.chromium.org//12213020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18155 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-05 20:19:32 +00:00
regis@google.com ca927278dc Resubmit reverted r17962, but, for now, only report error about unfinalized
types if flag --error_on_malformed_type is specified.
Fix one more case of unfinalized signature type.
Review URL: https://codereview.chromium.org//12183014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18033 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-04 05:51:02 +00:00
asiva@google.com 20f821b4cb Instead of setting up the can intrinsify state lazily setup eagerly
in Object::Init() so that the snapshot will carry it and when
running from a snapshot Intrinsifier::CanIntrinsify can be just a bit check.
Review URL: https://codereview.chromium.org//12096105

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17995 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-01 19:16:34 +00:00
antonm@google.com 5a9cc92093 Revert changes 17962-3 which break Dartium Debug build.
TBR=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17977 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-01 12:45:42 +00:00
regis@google.com 650ae359a4 Fix class patching involving type parameters: type parameters of patched classes
were not finalized.
Simplify and fix function type alias finalization (remove dummy alias owner).
Make sure no unfinalized types or unresolved classes are written to a snapshot.
Verify that all pending classes are finalized before writing a snapshot.
Make snapshot_test more resilient to finalization errors.
Add missing import to snapshot_test.dart.
Fix typo in growable_array.dart.
Review URL: https://codereview.chromium.org//12123002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17962 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-01 02:40:16 +00:00
asiva@google.com c64871d699 First set of changes towards cleaning up the bytearray access APIs
- Added unimplemented versions of Dart_ByteArrayAcquireData and
  Dart_ByteArrayReleaseData
- Added infrastructure to prevent callbacks into an API function that
  allocates a new object on the Dart heap or invokes dart code.
- Removed the old Dart_ByteArrayGet* access functions as it was felt that
  they have become redundant once we provide direct access to the internal
  data pointers.
- Removed DARTSCOPE_NOCHECKS as it seems to be redundant after the change
  to not create explicit stack zones on each Dart API call.
Review URL: https://codereview.chromium.org//12036098

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17958 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-31 23:56:48 +00:00
asiva@google.com c2cafbbe33 - Change the layout of external typed array objects to avoid the extra indirection when accessing elements in the array.
- Change the Dart API which create these external arrays to account for this change
Review URL: https://codereview.chromium.org//12093071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17937 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-31 18:53:21 +00:00
fschneider@google.com 74a6a35e1d Do not add smis to the store buffer when cloning objects.
StoreBufferObjectPointerVisitor did not check for smis. It is
  used from Object::Clone.

Also assert that IsNewObject and IsOldObject is only called
on heap objects.
Review URL: https://codereview.chromium.org//12089049

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17804 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-29 20:12:00 +00:00
fschneider@google.com 00d11158e7 Address comments about safely casting handles.
The debug version exactly follows the original code. Release mode
avoid creating a temporary handle.
Review URL: https://codereview.chromium.org//11500004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17703 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-28 12:02:07 +00:00
asiva@google.com f4fe42c280 Added macros OBJECT_IMPLEMENTATION and FINAL_OBJECT_IMPLEMENTATION
which have different implementations of 'operator=' and 'operator^='.
In the case of FINAL_OBJECT_IMPLEMENTATION we do not do the vtable setting
in these methods (Note the |= operator functionality is now subsumed into
the new implementation of "operator^=")
Review URL: https://codereview.chromium.org//12052033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17491 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-23 20:01:31 +00:00
srdjan@google.com f2d02edd3f Hide private corelib's method from stack trace in exceptions.
Review URL: https://codereview.chromium.org//12025038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17489 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-23 19:52:26 +00:00
asiva@google.com 4c796304dd Move verification of builtin_vtables into Dart::InitializeIsolate.
This ensures that we don't ASSERT on every handle assignment
(not an issue with release builds but should help the debug builds some).
Review URL: https://codereview.chromium.org//11867015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17438 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-23 06:13:18 +00:00
asiva@google.com 8579ac9bb5 Allow externalization of canonical strings also. Only restrict canonical strings
in the VM isolate heap.
Review URL: https://codereview.chromium.org//11969029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17437 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-23 05:57:29 +00:00
srdjan@google.com aec77f4d71 Use new |= operator in object.cc .
Review URL: https://codereview.chromium.org//11938023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17301 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 18:37:06 +00:00
fschneider@google.com 3e94e4a2fa Fix bug in optimization in the presence of externalized strings.
The class-id of string objects can be changed via the Dart API. The optimizer
has to disable hoisting class-id checks across calls. For now, loop-invariant
code motion is disabled for checks of string class-ids.
Review URL: https://codereview.chromium.org//11867020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17288 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 16:29:02 +00:00
floitsch@google.com c2446d4626 Move many iterable classes to collection_dev.
Review URL: https://codereview.chromium.org//11931042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17276 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 14:08:41 +00:00