Commit Graph

2925 Commits

Author SHA1 Message Date
asiva@google.com 8e27430ddd - Create isolate specific resuable handles and use them in the hot lookup paths.
- Create a ResuableHandleScope class which ensures that we do not end up
  recursively reusing handles leading to corruption.

This change shows Dart2JSCompileAll runtime change from 739931 to about
645035 on my local machine.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24373 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-24 22:41:01 +00:00
fschneider@google.com 0bf7251d1a Reland: Optimizing noSuchMethod invocation with no arguments.
This is the same CL as https://codereview.chromium.org/17315008/ with
one bug fixed:

If a method is invoked with a mismatching number of arguments, we don't
add a no-such-method-dispatcher function since the dispatcher currently
can only invoke noSuchMethod and would not work if the method
is invoked with correct arguments at a later point.

I extended the test to cover that case.

TEST=tests/language/no_such_method_dispatcher_test.dart
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24351 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-24 17:18:51 +00:00
srdjan@google.com fa7817bf79 Change static calls in unoptimized code to always call via a stub. Using ICData, the call count of static calls is collected as well.
TODO: Use call frequency to guide inlining.

R=asiva@google.com, hausner@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24307 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 23:35:10 +00:00
zra@google.com 06abf98b1f In FiftyThreeBitOverflow, stores overflowing value as a string.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24295 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 16:43:43 +00:00
fschneider@google.com 48555c83ac Back out r24266 to investigate dartium test failure.
TBR=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24284 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 11:56:32 +00:00
fschneider@google.com ab1981b421 Optimizing noSuchMethod invocation with no arguments.
On each call that triggers a noSuchMethod invocation we 
attach a custom dispatch function that allocates the 
invocation object and invokes noSuchMethod. This dispatcher
is compiled and optimized like a normal Dart function.

Similar to method-extractors, these implicit dispatchers
do not show up as normal functions.

As a first step this CL only handles invocations of getters
and methods with no like o.foo or o.foo().  This CL gives
a >25x speedup of such noSuchMethod invocations. Calls with
multiple arguments still go through the slow path.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24266 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 07:31:51 +00:00
asiva@google.com 16c945cb88 Minor cleanups to use null_array(), null_object() and null_string() handles.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24247 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-20 19:49:30 +00:00
srdjan@google.com 47de186e76 Store arguments descriptor in ICData. Remove loading of arguments descriptor at unoptimized call site (the ones using ICData).
R=asiva@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24239 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-20 16:29:39 +00:00
kmillikin@google.com 3e78b2ad4a Reapply "Initial implementation of on-stack replacement (OSR)."
This reapplies SVN r24024 with a bugfix.

After OSR compilation, restore the pre-OSR code (which might be already
optimized) rather than the unoptimized code (which might have its entry
patched).  When the optimized code entry is patched it is only safe to call
it as a static call, not as an instance call.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24088 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-17 11:05:15 +00:00
srdjan@google.com 7192d42f46 Fix a bug in instance canonicalization and add debug mode checks that we are not missing any fields.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24059 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 22:58:48 +00:00
hausner@google.com 457bb1bdcb Remove support for + prefix in number literals
Also fix some tests that expected + prefix in hex numbers to be illegal. According to our documentation, int.parse() accepts + for numbers in all formats/radixes.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24051 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 21:16:46 +00:00
kmillikin@google.com d6f3eccdf2 Revert "Initial implementation of on-stack replacement (OSR)."
This reverts commit 24024.

TBR=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24025 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 10:30:53 +00:00
kmillikin@google.com 0b39927d30 Initial implementation of on-stack replacement (OSR).
Add profiling support to select OSR candidates and launch the compiler
for OSR, followed by entry to the function at the OSR entry point.

Implemented only on IA32 and X64.  The initial implementation can be
improved in various ways --- specifically: tuning of profiling
parameters and incorporation of feedback about the actual values seen
at OSR entry.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24024 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 10:10:55 +00:00
fschneider@google.com 3208230580 Revert r23330 and r23136 because of a bug with loop invariant code motion.
This CL temporarily remove deoptimzation history which was put in to prevent
repeated deoptimization caused by loop invariant code motion. It caused
illegal code motion under certain conditions.

BUG=https://code.google.com/p/dart/issues/detail?id=11245
TEST=tests/language/licm3_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23989 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-13 15:52:33 +00:00
iposva@google.com 287f80bb1f - Make sure BoundedType and MixinAppType have a name.
- Reenable test from r23964.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23975 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-13 13:02:46 +00:00
bak@google.com 5cb3b20063 Object histogramin the vm (--print-object-histogram).
Reviewed and LGTMed in:
https://codereview.chromium.org/16077018/

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23954 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-13 09:06:43 +00:00
srdjan@google.com 5543ce104c When canonicalize instances check if all fields are canonical. If a field is a non-canonical number or strings, canonicalize it. Otherwise report an error if a field is not canonical.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23934 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-12 21:27:37 +00:00
hausner@google.com 0374dc9b12 Reified metadata in the VM
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23912 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-12 15:44:57 +00:00
regis@google.com 1c55615741 Fix comment about super type of Object class.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23911 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-12 15:35:55 +00:00
asiva@google.com d8ef2ae701 Fix issue 11214 avoid length overflow in String::ConcatAll
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23886 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 23:07:57 +00:00
asiva@google.com 7f8320e042 Make ImmutableArray a sub class of AllStatic.
This enables Array to be a FINAL_HEAP_OBJECT and the operators
'=' and '^=' would be a simpler implementation which does not
require a call to initializeHandle().

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23884 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 21:52:39 +00:00
regis@google.com 09bb36b8db Move code setting super type of class Object to null from object.cc to parser.cc
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23847 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 12:22:04 +00:00
asiva@google.com 69b5efffd2 Create specific null read only handles for the frequently used types
Array, String, Instance, Object and use them.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23785 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-08 00:47:35 +00:00
zra@google.com 68f4a66a3d Improvements to 53-bit overflow checking.
- Integer literals that require more than 53 bits will cause a compile-time error.
- Checking is added to unary negate for the case that the most negative
  53-bit integer is negated.
- The tests are improved to also check optimized code.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23774 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-07 21:28:49 +00:00
zra@google.com cfea7c3c9a Implements checks for 53-bit overflow for x64.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23721 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-06 22:48:20 +00:00
asiva@google.com 703bad2d2a Revert change 23636 as it is causing issues on dartium. Will resubmit after investigating the dartium failure.
Review URL: https://codereview.chromium.org//16378004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23641 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-05 17:28:01 +00:00
zra@google.com 78ed504ed0 Adds a flag to the standalone vm to throw an exception on 53-bit integer overflow.
R=asiva@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23640 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-05 17:18:07 +00:00
asiva@google.com bd14296eb7 Fix for issue 1755.
Use 'new' in all the snapshot reallocation functions instead of realloc.
This would result in program termination when allocation fails and will
ensure that a NULL will not be returned.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23636 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-05 16:21:04 +00:00
srdjan@google.com d1fbe2117d Fix Issue 11047: use binary search instead of linear search to locate a pc-offset in the static call table.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23614 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-04 20:16:29 +00:00
asiva@google.com c3268027bb Simplyfy the NumTypeArguments check.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23509 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-01 00:41:24 +00:00
asiva@google.com 3f97d1492a More cleanup to avoid creation of redundant handles
- create read only handles for null object and sentinel smi value
- add a RawCast function to allow direct casting of Raw pointers without the
  need to create a Handle for it
- use Smi::Value where possible
- hoist out handle creation from some loops

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23502 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 22:55:29 +00:00
iposva@google.com b60d09b1fb - Add different types for persistent and weak persistent handles
in the Dart C API.
- Adapt code in the runtime.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23421 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-30 15:55:59 +00:00
asiva@google.com 7735d59c7c More cleanup based on profile information.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23375 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-30 01:24:09 +00:00
fschneider@google.com fdcae8a772 Add a helper function for allocation of deoptimization history.
This CL addresses DBC comments from my previous CL (https://codereview.chromium.org/15779006/)

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23330 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 09:11:23 +00:00
sgjesse@google.com bb6d8c6d20 Remove library dart:crypto
Moved the contnet of dart:crypto to the package pkg/crypto.

R=dgrove@google.com, floitsch@google.com, iposva@google.com, nweiz@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23322 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 07:29:29 +00:00
sgjesse@google.com 9d6a64e81b Merge the dart:uri library into dart:core and update the Uri class
This merges the dart:uri library into dart:core removing the dart:uri library. Besides moving the library the Url class has been changed.

* Removed existing Uri constructor as it was equivalent with Uri.parse
* Remamed constructor Uri.fromComponents to Uri
* Moved toplevel function encodeUriComponent to static method Uri.encodeComponent
* Moved toplevel function decodeUriComponent to static method Uri.decodeComponent
* Moved toplevel function encodeUri to static method Uri.encodeFull
* Moved toplevel function decodeUri to static method Uri.decodeFull
* Rename domain to host
* Added static methods Uri.encodeQueryComponent and Uri.decodeQueryComponent
* Added support for path generation and splitting
* Added support for query generation and splitting
* Added some level of normalization

R=floitsch@google.com, lrn@google.com, nweiz@google.com, scheglov@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23266 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-28 13:35:01 +00:00
asiva@google.com 26cdebaccf More cleanups to avoid Handle creation in hot paths.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23189 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 23:42:01 +00:00
zra@google.com 40f0800c10 Ensures that Bigints returned to Dart are all checked by Integer::AsValidInteger.
Rather than by ad-hoc checks at the point of return.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23151 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 15:45:17 +00:00
fschneider@google.com 063027cf7c Support inlining function containing throw in the optimizer.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23142 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 12:52:44 +00:00
fschneider@google.com c1a33f3ea6 Add deoptimization history to optimized functions.
Each function that is optimized or inlined into an optimized
functions keeps an array of deoptimization ids.

This history is used to avoid repeated deoptimization caused by
speculative hoisting of check instructions.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23136 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 12:03:40 +00:00
asiva@google.com e33c2d4254 Delay Class parsing until the class is actually used.
Prior to this change the initial heap sizes were as follows:
ia32:
Size of isolate snapshot = 1230921
New space (0k of 32768k) Old space (1446k of 1604k)

X64:
Size of isolate snapshot = 1223943
New space (0k of 32768k) Old space (2630k of 2692k)


After this change the initial heap sizes are as follows:
ia32:
Size of isolate snapshot = 686443
New space (0k of 32768k) Old space (677k of 836k)

X64:
Size of isolate snapshot = 684731
New space (0k of 32768k) Old space (1220k of 1412k)

R=hausner@google.com, iposva@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23115 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 00:13:10 +00:00
asiva@google.com ca3452e4a9 - Allocate symbols for 'get:' and 'set:'
- Remove some redundant handle creation

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23110 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-23 22:59:26 +00:00
hausner@google.com 4b497b0c17 Consolidate debug stubs
The new debug stub BreakpointRuntime gets the original stub address
from the debugger. With this scheme, we don't need a new debug stub
for every runtime stub that the debugger patches.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23094 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-23 18:42:03 +00:00
asiva@google.com de8b3c18b0 Remove some dead code.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23046 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-23 00:26:33 +00:00
asiva@google.com 41b01ececf - Some of the pre registered classes like Int, Double etc. were not being
marked as being prefinalized. Mark them as pre finalized.
- Replaced the check (cls.functions() != Object::empty_array().raw()) as
  indicating it is a pre-registered class.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22914 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-21 01:02:28 +00:00
srdjan@google.com 22624fd4e0 Intrinsify random nextState, improve perfromance significantly.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22912 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-20 23:59:36 +00:00
asiva@google.com 95619dc897 Use handles to save the object being read before calling StorePointer to make
sure we are GC safe.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22889 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-20 05:15:39 +00:00
srdjan@google.com dd6ca671d7 Cleanups: addressed your comments from https://codereview.chromium.org/14962008/
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22881 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-17 23:45:08 +00:00
hausner@google.com 7349a6d611 Make breakpoints on == fire reliably
Add breakpoints in the path taken if one of the operands
in a == b is null.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22857 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-17 17:08:09 +00:00
srdjan@google.com 142b49316a Fix issue 5275: The VM must always generate the most compact form of an integer (Smi, Mint or Bigint). Hide methods that can be used to bypass that assumption and require the use of Integer::NewXXX which is guaranteed to return the most compact integer form.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22816 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-16 20:49:06 +00:00