Commit Graph

75 Commits

Author SHA1 Message Date
Ivan Posva b2ac279269 - Use a map to lookup libraries by URL.
- Ensure the uniqueness of private keys without having to
  search the existing key space.
- Pass a thread parameter where useful to library methods.

BUG=

Review URL: https://codereview.chromium.org/1947393003 .
2016-05-05 10:42:28 -07:00
Florian Schneider 1217e539e9 VM: Remove _leftShiftWithMask32.
It was used for the Javascript integer overflow warnings which were already
removed from the VM.

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

Review URL: https://codereview.chromium.org/1900863004 .
2016-04-19 19:06:53 +02:00
Vyacheslav Egorov ee0f608ce4 Dart Byte Code interpreter.
This version is Clang/GCC only and does not support Windows because it uses computed goto's.

Only unoptimized mode is supported.

Architecture is described in constants_dbc.h and stack_frame_dbc.h.

R=fschneider@google.com, zra@google.com

Review URL: https://codereview.chromium.org/1858283002 .
2016-04-18 23:02:01 +02:00
John McCutchan 24230689df Intrinsify some double operations, helps in AOT
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1832343003 .
2016-03-28 13:09:40 -07:00
Florian Schneider 6d27476cd1 VM: Fix a couple of issues in the AOT optimizer, add fast path smi multiply.
1. Add fast path smi multiply

2. Recognize more operands as likely smi: If they are the result
  another CheckedSmiOp, or the result of a phi that has a known smi.

3. Fix guessing receiver cids of getters/setters based.

4. Try to specialize calls based on propagated receiver type first before
  using guessed cids (which generates a call with checks + megamorphic slow path)

BUG=

Review URL: https://codereview.chromium.org/1824023002 .
2016-03-25 08:52:15 -07:00
John McCutchan 0a8c668e5c Add graph intrinsics for many math library functions:
- sin, cos, tan, asin, acos, atan, and atan2.

Other fixes:

- support calling from intrinsic code

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1823263002 .
2016-03-23 06:58:12 -07:00
John McCutchan 1e0abf4df0 Revert "Add graph intrinsics for many math library functions"
This reverts commit f5bc8fa353.

BUG=

Review URL: https://codereview.chromium.org/1825603002 .
2016-03-22 12:45:46 -07:00
John McCutchan f5bc8fa353 Add graph intrinsics for many math library functions
- sin, cos, tan, asin, acos, atan, and atan2.

This is my original CL including the CheckClass instruction.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1821783002 .
2016-03-22 09:28:49 -07:00
Ryan Macnak b070d98f6e Simpler regex names:
C++ JSRegExp -> RegExp
  Dart _JSSyntaxRegExp -> _RegExp
  Function RegExp.:irregexp: pattern -> RegExp.:matcher: pattern

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1815333002 .
2016-03-21 17:21:05 -07:00
John McCutchan f1db5b25d0 Revert "Add graph intrinsics for many math library functions"
This reverts commit 7dc6bdefa3.

BUG=

Review URL: https://codereview.chromium.org/1816193002 .
2016-03-21 10:58:45 -07:00
John McCutchan 7dc6bdefa3 Add graph intrinsics for many math library functions
- sin, cos, tan, asin, acos, atan, and atan2.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1808503003 .
2016-03-21 10:23:50 -07:00
Florian Schneider f3de2377ab Move the VM's typed_data implementation to runtime/lib.
This removes the additional indirection to the VM's implementation
for all the factory constructors.

Additionally, it removes one class per typed data list type, thus reducing
snapshot and generated code size.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1790593002 .
2016-03-21 13:39:49 +01:00
Florian Schneider bec43a3b8f Simplify the VM's typed_data constructors.
Remove _new native functions to have one indirection less
when constructing typed data lists.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1782003002 .
2016-03-10 09:38:08 +01:00
Regis Crelier e66d65f7b9 Change function source fingerprint calculation to rely on tokens exclusively and
not on the signature type hash anymore. This makes fingerprints insensitive to
implementation details of the type system. The signature type hash was included
because, in the early days, the token stream of a function started at the
opening brace and did not include tokens representing the signature.

R=srdjan@google.com

Review URL: https://codereview.chromium.org/1752503002 .
2016-02-29 14:59:21 -08:00
Florian Schneider 4ab3a12a0c VM: Optimized calls to asin, acos, tan.
Reorganize a long chain of if-else-if into a switch.

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1670113004 .
2016-02-08 14:21:51 +01:00
Florian Schneider 5e680a2938 VM: Support fast calls to atan and atan2 in optimized code.
BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1662153002 .
2016-02-04 13:57:36 -08:00
Matthias Hausner 4ffdcb76df Eliminate phase parameter in constructors
Super initializer calls get implicitly moved to the end of the initializer list, so we don't need the two-phase constructor protocol anymore.

Ryan, can you please look at the mirror changes and check wether I've missed something?

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

Review URL: https://codereview.chromium.org/1569213003 .
2016-01-08 15:41:51 -08:00
Ryan Macnak df72a27f23 Intrinsify _StringBase._substringMatches to speedup indexOf/startsWith/endsWith under precompilation.
Fix some Smi checks in other intrinsics on MIPS.

Raspberry Pi 2
Before
JIT StarryStrings(RunTime): 1851875.5 us.
noopt StarryStrings(RunTime): 23655235.0 us.

After
JIT StarryStrings(RunTime): 1829766.5 us.
noopt StarryStrings(RunTime): 8660442.0 us. (2.7x)

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1450663002 .
2015-11-18 14:38:39 -08:00
Florian Schneider f6b96b3d07 Start remove dependencies on compiler-related files.
Minimize the number of dependencies of compiler-related files.

This is needed to remove whole .cc/.h files from a compiler-less VM binary which
can be used for running precompiled code.

* removed dependencies of object.cc on flow_graph_compiler.h and flow_graph_builder.h

* removed unnecessary includes from object.h

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1411873005 .
2015-11-05 00:08:35 +01:00
Florian Schneider bcde4eee0b VM: Add double unary minus intrinsic.
Also remove an extra indirection in the unary minus operator for Double.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1422753004 .
2015-10-29 22:58:33 +01:00
Florian Schneider 33eed24b57 VM: Always inline typed data list factories, clean up inliner.
They just redirect to the native typed data list constructor. Inlining
them makes type propagation more precise.  There is no size cost with always
inlining these since they just contain a constructor call.

Also, remove dead code from the inliner: Unoptimized code is not accessed during
optimized compilation anymore.

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1416603002 .
2015-10-19 18:03:32 +02:00
Florian Schneider b2be30b4a1 VM: Add uint32 array intrinsics.
Since the VM's compact map implementation uses Uint32List internally, this
helps programs that use hash maps and -sets.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1372863003 .
2015-10-06 10:17:29 +02:00
Florian Schneider 60b4e00770 VM: Intrinsify some common SIMD methods to speed up precompiled SIMD code.
This speeds up precompiled code using SIMD (around 2x on Tracer).

Also fix printing of recognized methods which was off-by-one.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1347203005 .
2015-09-22 18:28:01 +02:00
Srdjan Mitrovic c0b359db6c Intrinsic version of Object.runtimeType
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1217323002.
2015-07-01 10:13:14 -07:00
Lasse R.H. Nielsen cf4eaae5a6 Change RangeError instances to use RangeError.range.
This avoids using the (sometimes confusing) "[...)" notation for half-open ranges.
Also change argument tests to simpler interval tests, and move error handling to the end of the functions.

Mostly in VM typed-data libraries.

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

Committed: https://github.com/dart-lang/sdk/commit/932bcc6901d70492c6f1b8d000b9555a0db62f4b

Review URL: https://codereview.chromium.org//1132603003
2015-05-29 10:50:20 +02:00
Daniel Andersson ea46192ca3 VM-internalize the default Map implementation.
Make the compact linked hash map, which is the default implementation for Map
(including map literals), a VM-internal class.

This makes it easy to have more efficient serialization of maps (although for
now, the implementation is straight-forward).

Refactor the compact hash class hierarchy to enable the VM-internal class and
the rest (also the Set classes) to share a maximal amount of code, by using
two different bases for implicit/explicit fields.

Remove existing proof-of-concept, C++-based internal VM-class.

BUG=http://dartbug.com/22982
R=asiva@google.com

Review URL: https://codereview.chromium.org//1151523002
2015-05-28 09:32:54 -07:00
Matthias Hausner bdf8124301 Add 3 new tokens and fix all the fallout from changing token values.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1142423003
2015-05-21 09:06:11 -07:00
John McCutchan 6e42aec4f6 Deprecate 'dart:profiler' and move functionality to 'dart:developer'
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1133713006
2015-05-18 11:31:20 -07:00
johnmccutchan@google.com f01c1490f7 Revert 45783
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45784 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-14 00:32:32 +00:00
johnmccutchan@google.com 95515238cc Move 'dart:profiler' contents into 'dart:developer' and remove 'dart:profiler'
BUG=
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45783 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-13 23:48:04 +00:00
asiva@google.com 579fc0fd2e Some more cleanup of the finger print checking code.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45742 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 18:14:18 +00:00
asiva@google.com 8f9eee3f22 - Use conditional code inclusion for the dart_no_snapshot and dart executables using the MACRO DART_NO_SNAPSHOT
- Do some minor modifications to the intrinsifier code to not do redundant fingerprint checks and avoid code duplication.

These changes result in a text segment size savings of about 110k.

Old Sizes:
   text    data     bss     dec     hex filename
3801418    7696   19261 3828375  3a6a97 (TOTALS)

New sizes:
   text    data     bss     dec     hex filename
3690342    7696   19261 3717299  38b8b3 (TOTALS)

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45704 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 18:31:55 +00:00
sra@google.com 39dfecbfb5 Revert "Change ListIterator to only check for concurrent modification at each iteration"
Revert "Fix ListIterator.iterator function hash for VM."

This is not as easy to optimize for dart2js as initially thought.
Revert this change while we discuss.

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45216 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 18:53:39 +00:00
lrn@google.com ef51a58b22 Fix ListIterator.iterator function hash for VM.
Review URL: https://codereview.chromium.org//1094533002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45199 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 09:17:56 +00:00
zra@google.com f6028da01d Fixes bug in typed data read/write for floats and doubles.
When reading from a byte array as floats or doubles, perform the
endianness correction before converting to a float or double
rather than the other way around. This is to avoid floating
point canonicalization changing the bytes before we put them
in the right order.

Unrelatedly, this change also adds armv5te as an architecture
needing extra time for tests to correct an oversight in my
last CL.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44871 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-02 20:22:39 +00:00
regis@google.com b5ec6bb9b6 Move zero-ing code out of shift intrinsic (not needed if destination is new).
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44849 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-01 22:37:47 +00:00
regis@google.com 80410ae6d7 Implement bigint shift intrinsics on x64.
Add assembler support and tests for shld and shrd instructions on x64.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44834 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-01 17:35:52 +00:00
regis@google.com a5ee233d1b Make Bigint instances immutable by removing all setters.
This required rewriting a large portion of bigint.dart.

R=rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43492 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 23:56:23 +00:00
fschneider@google.com f83837193f VM: Refactor more intrinsics of GrowableList to use IR builder.
Removing the platform-specific code.

Also contains an unrelated clean-up in snapshot code.

R=zerny@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43283 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-29 13:39:25 +00:00
vegorov@google.com e31313efea Refactor _ByteDataView.[set|get]<Type> methods to improve their performance.
- don't manually truncate values before passing them to TypedData._[set|get]<Type> - these methods already have truncating semantics;

- don't call into runtime for endianess conversion, implement it in pure Dart instead (with an intent to provide optimized version on platforms that support fast byte-swapping instructions);

- force inlining of these methods (change the order of checks in the ShouldWeInline to guarantee inlining of whitelisted methods).

Unrelated change:

- tweak output of Function::CheckSourceFingerprint to be immediately copy&paste useful.

R=fschneider@google.com
BUG=http://dartbug.com/22107

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43038 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-21 14:21:49 +00:00
fschneider@google.com c99e78af72 Reland and fix r42951: Tweaks in the VM's typed_data implementations.
Fixed checked mode failure and correct function fingerprints.

R=zerny@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42980 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-19 09:59:45 +00:00
vegorov@google.com 6c597dadbf Revert "Tweaks in the VM's typed_data implementations."
This reverts commit r42951.

Reason: checked mode breakage.

TBR=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42952 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-16 12:14:47 +00:00
fschneider@google.com 1f5208e648 Tweaks in the VM's typed_data implementations.
Moving the throw of RangeError out of the _throwRangeError helper
may benefit LICM, since that block is now considered a method exit (and
not part of a enclosing loop).

_throwRangeError was not inlined because the call site was considered
cold by invocation counters (most programs don't throw RangeError).

Also, I renamed some misleading names in the optimizer.

R=zerny@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42951 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-16 11:30:49 +00:00
regis@google.com 03fa3d1ff4 Mark mutator methods of canonical constants as invisible to reflective access.
R=rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42747 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-09 18:03:31 +00:00
regis@google.com 4dc4caa34d Modify Bigint _mulAdd, _sqrAdd, _estQuotientDigit, and Montgomery _mulMod
methods to return the number of digits processed, so that their intrinsified
versions on 64-bit platforms can process digit pairs.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42568 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-29 18:40:44 +00:00
fschneider@google.com a49870e721 VM: Remove use of IterableMixinWorkaround from _List, _ImmutableList and _GrowableList.
_List, _ImmutableList and _GrowableList now extend ListBase which uses ListMixin.

Note that typed data lists are still using IterableMixinWorkaround for now.
They will be changed in a separate CL since it involves a few more changes
to the VM.

BUG=dartbug.com/13647
R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42061 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-02 10:38:51 +00:00
zerny@google.com 8e807c8550 Integrate the Irregexp Regular Expression Engine.
BUG=http://dartbug.com/19090
R=fschneider@google.com

Committed: https://code.google.com/p/dart/source/detail?r=41949

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41983 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-26 09:32:43 +00:00
zerny@google.com 84a4135901 Revert "Integrate the Irregexp Regular Expression Engine."
This reverts commit https://code.google.com/p/dart/source/detail?r=41949

TBR=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41950 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-25 13:36:40 +00:00
zerny@google.com 43ac0c6f33 Integrate the Irregexp Regular Expression Engine.
BUG=http://dartbug.com/19090
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41949 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-25 13:10:21 +00:00
srdjan@google.com eddeb860eb Restructure inlining of Bigint accessors, use consistent approach, fixes a potential crash.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41840 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-19 22:28:49 +00:00