Commit Graph

109 Commits

Author SHA1 Message Date
fschneider@google.com 56853c6bc9 Undo unnecessary changes to ARM assembler.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43596 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-09 16:14:11 +00:00
fschneider@google.com df94b27666 VM: Align implementations of assembler constant pools.
Add Support for adding patchable/non-patchable entries on ARM/MIPS like
already done for x64/ARM64.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43589 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-09 11:47:36 +00:00
koda@google.com 6bb285d5d9 ARM port of r42723.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42962 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-16 16:51:23 +00:00
fschneider@google.com 1e7310d48f Improve constant pool implementation in the assembler.
Instead of using RawObject* as keys, use Object*. Using handles eliminates any assumption
about the underlying GC implementation (e.g. requiring that old objects don't move).

Remove special handling of null_object by making HashMap more generic and
allowing the trait to specify the value used to indicate an empty element.

The goal is to use one unified, efficient implementation of the constant
pool on all architectures that require one (x64, arm64, mips).

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42901 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-15 10:43:36 +00:00
vegorov@google.com aa48bd4759 Range feedback for arithmetic operations.
In addition to tracking input and output ranges in the IC-stubs with a Smi fastpath (SmiAdd and SmiSub, currently) this CL also introduces two IC stubs that have no fast-path by still track ranges and update the range feedback.

We are able to distinguish between the following ranges (encoding of the lattice is shown in the parens):

- u-smi  (0000)
- smi    (0001)
- uint31 (0010)
- int32  (0011)
- uint32 (0100)
- int64  (1xxx) and (x1x1)

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42370 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-15 18:48:15 +00:00
koda@google.com 56defa8060 Write-barrier verification on ARM.
Add and use methods on Assembler for writing and verifying object fields.
Enable tests in verified_mem mode for simarm.
Also generalize and use InitializeFieldsNoBarrierUnrolled in one more place.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42208 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-09 16:15:33 +00:00
zerny@google.com 4fb54d853d Support use of external strings as inputs to LoadCodeUnitsInstr.
R=vegorov@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42099 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-04 09:26:48 +00:00
koda@google.com e775ee5dac arm: Move unrolled array initialization to Assembler.
This is the final preparation before adding write barrier verification infrastructure on ARM
(which requires all pointer writes to pass through write-barrier aware code).

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41914 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-21 18:09:40 +00:00
koda@google.com 5f688e0465 Dedupe code for array/object initialization on ARM.
This creates fewer places to audit the GC's write barrier logic.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41872 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-20 23:09:21 +00:00
zra@google.com f3a21e3ff3 Uses correct mnemonic for vmrs instructions.
Keeps vmstat as a macro.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41042 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-10 15:30:41 +00:00
regis@google.com 632edf5d55 Implement bigint mulAdd and sqrAdd intrinsics on ARM.
Add support for umaal instruction on ARM (assembler, disassembler, simulator).
Add assembler test for umaal instruction on ARM.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40993 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-08 16:59:59 +00:00
zra@google.com 240afa6afa Expands the use of Immediate and Operand wrappers.
Since Register is an enum type, it is automatically
coerced to integer types when passed as a parameter to
functions expecting an integer argument. This change
expands the use of Immediate and Operand wrappers
for Assembler instructions and macros to avoid this
automatic coercion.

I've also added dummy constructors to Address and
FieldAddress classes to address the same problem,
but in a way that does not increase verbosity,
since Address and FieldAddress are much more
prevalent in the code.

A cleaner solution would involve making Register
no longer coercable to integer types, but this
would likely require many changes to the Assemblers.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40905 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-03 19:46:24 +00:00
zra@google.com d249d68cb1 Splits up dependent loads in update of allocation stats.
Also uses strd for object and array initizlization.

Only on ARM for now. Together, these changes reduce the
number of profiler ticks in allocation stubs ~20%, and give a
small improvement on some benchmarks.

R=johnmccutchan@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40852 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-01 19:47:41 +00:00
iposva@google.com cc13627fc8 - Remove Isolate::CurrentAddress().
- Remove use of INFINITY and -INFINITY.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40700 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-25 23:39:30 +00:00
zra@google.com c6f380ed3d Avoids vmovsr on ARM.
R=johnmccutchan@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40696 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-25 22:09:26 +00:00
koda@google.com 667454a233 Support old-space allocation in generated code (bump block only for now).
First steps towards general pretenuring support.
* Generalize Heap::Top/EndAddress.
* Add testing flag to exercise new code paths.
* Also update the slow-case runtime calls, to ensure a fresh block will be allocated in old.

Next steps are general invalidation of the generated code and adding a policy that doesn't blow up the store buffers), and freelist allocation.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40530 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-19 23:46:22 +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
vegorov@google.com 183abe7207 Fix StoreIndexedInstr input representation requirements for Int32/Uint32 arrays.
Previous implementation changed input representation depending on the propagated type of the value which violated assumptions made by SelectRepresentations phase.

Instead of using tagged/mint input require unboxed Int32/Uint32 input and insert explicit truncating unboxing when building StoreIndexed operation in the optimizer. This also leads to strictly better code and opens possibilities for further optimizations.

Implement Int32/Uint32 representation support on all platforms. This includes boxing, unboxing and unboxed converter operations.

Merge BoxInt32/BoxUint32 and UnboxInt32/UnboxUint32 instruction sequences to minimize duplication.

Improve instruction sequences by utilizing CARRY flag set by smi untagging where possible (ARM, ia32, x86).

Enable all tests that were disabled by r40078, r40079.

BUG=http://dartbug.com/20875
R=fschneider@google.com, johnmccutchan@google.com, srdjan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40143 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 12:32:54 +00:00
fschneider@google.com da0fb6bbe2 More intrinsics in IR.
R=srdjan@google.com, vegorov@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40088 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-10 13:34:58 +00:00
zra@google.com 5d3f4708ec Fixes to support ARMv5 lego mindstorm.
1. Deopts on division when neither vfp nor idiv are present.
   In a subsequent CL, I can add a leaf runtime call for this.

2. Uses a different PC read offset in STR and STM instructions.
   On ARMv5 and earlier, the PC read offset is 8 except in STR
   and STM instructions, where it is implementation defined. On
   lego mindstorm it is 12. This requires changing
   kEntryPointToPcMarkerOffset to be a function.

3. Uses a dummy struct to compute the size of a compressed
   pc descriptor to avoid alignment issues. sizeof(PcDescriptorRec)
   is 16 on ia32 and arm. Subtracting sizeof(int16_t) gives 14,
   which creates alignment problems on ARM, i.e. poor performance on
   ARMv6 and later, and wrong results on ARMv5 and earlier.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39250 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-14 15:42:00 +00:00
fschneider@google.com 36c848d1d7 VM: Optimized context allocation on all platforms.
This change generate inline code for context allocation and makes
the stores to initialize the parent pointer and the context variables
explicit in the optimized flow graph. This allows dead store elimination
to eliminate those stores.

Before, we only had inlined context allocation for ia32.

Furthermore:
* Added an assertion that the exit label of slow-path code
is bound when emitting deferred code. This used to cause random crashes
if forgotten.

* Fixed a bug in allocation stats on ARM.

BUG=dartbug.com/17238
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39202 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-13 15:49:01 +00:00
vegorov@google.com 36cddbd749 Use shorter TryAllocate instruction sequence on ARM/ARM64/MIPS.
On these architectures it's preferable to load Scavenger address into the register and then access top/end fields through this register instead of loading addresses of those fields as immediates --- which takes either two instructions or a memory load through a pool pointer.

Cleanup boxing slow-paths in the optimizing compiler. We had tons of duplicated code that was essentially doing the same thing.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38539 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-24 12:04:21 +00:00
zra@google.com b73310c2c2 Adds intrinsics for Float64Array [] and []=.
Improves performance in unoptimized code.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38483 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-22 23:16:07 +00:00
fschneider@google.com e169c20859 Fix bug in ARM instance field stores.
A large number of fields resulted in wrong offset
computation for the generated code for stores.

BUG=dartbug.com/19649
TEST=tests/language/large_class_declaration_test.dart
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37389 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-17 09:28:24 +00:00
srdjan@google.com e35ecf13e3 Add LoadTaggedClassIdMayBeSmi to assembly and improve performance of inline cache stubs.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37011 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-04 20:37:21 +00:00
zra@google.com 5a1b1a01f4 Eliminates some branches from arm code.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36997 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-04 14:37:20 +00:00
regis@google.com 34dc2dce7a Reduce register pressure on ARM, ARM64, and MIPS.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36764 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-28 20:35:02 +00:00
regis@google.com 8ece446e5a Rename ShifterOperand to Operand on ARM.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36719 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 23:18:17 +00:00
regis@google.com f22ca1e392 Generate better ARM64 code for indexed loads and stores.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36701 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 18:27:54 +00:00
johnmccutchan@google.com 62face24e5 ARM mint cleanups
Add comment about stack slot push order

Add conditional flag to SignFill assembler macro

BUG=
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36606 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-24 05:54:41 +00:00
regis@google.com 1f51fa4413 Generate better ARM code for indexed loads and stores.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36584 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-23 20:22:50 +00:00
johnmccutchan@google.com 8f4cbeaefa Use GPRs for mints.
Changes:

* Register allocator now allocates GPRs for kUnboxedMint.
* Register allocator supports for SameAsFirstInput for register pairs.
* Register allocator properly handles register pairs in environment uses and materialization uses.
* BoxInteger updated on IA32/ARM.
* UnboxInteger updated on IA32/ARM.
* BinaryMintOp updated on IA32/ARM.
* ShiftMintOp updated on IA32/ARM.
* UnaryMintOp updated on IA32/ARM.
* RelationalOp updated on IA32/ARM.
* EqualityCompare updated on IA32/ARM.
* LoadIndexed and StoreIndexed updated on IA32/ARM.
* New Deopt instructions added.
* Update live_registers when an instruction has a fixed register input and a call on the slow path.
* Improve printing of register pairs in flow graph.
* Do not assume live registers in slow paths contain tagged values.
* LiveRange pairs for kUnboxedMint definitions marked as kUntagged representation (reduces stack usage).
* Live register spilling on ARM uses same register order as stack map encoding.
* Spill slots containing tagged and untagged are segregated.
* Print stack maps when printing live ranges with safe points.
* Print allocated spill slot when printing live ranges.

Status:

* IA32 completed. All tests are passing.
* ARM completed. All tests passing.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36468 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-22 06:30:51 +00:00
zra@google.com b39bcf7bf6 Allows unboxed doubles to be disabled.
This helps to support ARMv5TE. Also adds asserts to
ensure that neon and vfp instructions are not generated
when those features are disabled on ARM.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36262 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-16 17:17:52 +00:00
regis@google.com 989aa3348a Fix an undetected Smi overflow on ARM.
Fix wrongly triggered overflow in optimized code on Intel.
Add a test.
Address a few TODOs.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36186 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-14 19:57:04 +00:00
zra@google.com 23e2b61eb8 For ARMv6, works around missing instructions.
mls, mla, umull, smull, etc. are not implemented on
all ARMv6's. This change works around them. For
mls and mla, we just use two instructions. smull
was used to check for overflow in mul, so we have
to do that manually. For umlal in the Random
intrinsic, we just fall through for now, though in
principal it wouldn't be hard to emulate.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35550 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-29 22:31:27 +00:00
zra@google.com 50d50cb5e2 Use more fpu multi-load/store instructions on ARM.
Addressing some TODOs in the ARM code. This appears
to be a slight performance win, and makes things a
bit cleaner.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34312 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-24 15:59:48 +00:00
zra@google.com c323e2ac13 Implements unboxed Mints on ARM.
R=johnmccutchan@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34256 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-21 16:26:21 +00:00
zra@google.com 7c91e88e6e Adds support for ARMv6.
When we detect ARMv6, instead of using movw and
movt, this change loads each individual byte.
Although this is not the best way to achieve this,
a modification to store large constants in the
object pool would be more invasive. Further,
this change will be easier to back-out once
ARMv6 is obsolete.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33442 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-07 19:17:36 +00:00
zra@google.com fd366da1cf Updates refactoring of CPU feature detection
with fix that uses cpuid for Intel/Linux.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32980 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-24 19:28:30 +00:00
zra@google.com 3693beeb6b Reverts refactoring of CPU feature detection for
assertion failure in Dartium.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32560 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-11 16:05:43 +00:00
fschneider@google.com d6178535b2 Landing: Write protect executable pages in the VM.
Change executable pages to be read/execute but not writable by default.

All pages are made temporarily writable just before a full GC, because both
the mark and sweep phases write to the pages. When allocating in a page and
when patching code, the pages are made temporarily writable.

The order of allocation of Code and Instructions objects is changed so that
a GC will not occur after Instructions is allocated. (A full GC would
render the Instructions unwritable.) A scoped object is used to make memory
protection simpler.

Original CL: https://codereview.chromium.org/106593002/

I added a cc test that is expected to crash.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32493 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-10 12:18:06 +00:00
zra@google.com 6f2096face Refactors some CPU feature detection into new class CpuInfo, and uses new information in VM service.
This change rewrites the code from the ARM assembler for parsing /proc/cpuinfo on Linux and Android, and collects it into a CpuInfo class that can be used for other architectures as well. This code is in cpuinfo_*.cc. /proc/cpuinfo equivalents are used for Mac and Windows. CpuInfo is used by the VM service to report on the hardware dart is running on. In the future CpuInfo can also be used here to provide more information.

R=iposva@google.com, johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32468 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-08 22:27:27 +00:00
johnmccutchan@google.com 9ca09b50e7 Track live instance and allocation counts for classes.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31978 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-22 19:21:22 +00:00
zra@google.com 3fd0e585d3 Fixes bug in far branches on MIPS.
Also increases test coverage of far branches on
ARM and MIPS.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31024 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-10 16:43:06 +00:00
asiva@google.com c0ddb83c3b ARM and MIPS changes which correspond to the initial change submitted in
https://codereview.chromium.org/63093003/

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30124 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-08 19:40:07 +00:00
fschneider@google.com aa789a7b27 Merge (x & y) == 0 pattern to emit a single test instruction.
This is based on a previous uncommitted CL by vegorov@
(https://codereview.chromium.org/14251023/).

It is rebased and fixes a bug in the MIPS implementation: BranchOnCondition
requires the comparison result in fixed registers CMPRES1/CMPRES2.

Remove register alias TMP1 (=TMP) and CMPRES (=CMPRES1). It is confusing to
have them around and easy to forget that they are actually the same.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29966 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-06 12:13:29 +00:00
zra@google.com ca82c461a0 Impelments IfThenElse instruction for ARM and MIPS.
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29933 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-05 20:45:25 +00:00
kmillikin@google.com de1519525c Reapply "Do not directly load smi constants larger than a 16 bit..."
Reapply "Do not directly load smi constants larger than a 16 bit payload on
ia32" with a bugfix.  The predicate Assembler::IsSafeSmi incorrectly
returned true for non-smis on non-ia32 platforms.

Original summary: Instead of emitting a large smi constant directly as an
immediate, xor the smi with a random 32-bit cookie at compile time, emit
code to move that into a register and then to xor the register with the
cookie.

Original codereview: https://codereview.chromium.org/48743002/

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29533 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 11:38:39 +00:00
whesse@google.com 0729948569 Revert "Do not directly load smi constants larger than a 16 bit payload on ia32."
There is an assertion failure on debug VM tests.

BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29458 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-29 16:49:42 +00:00
kmillikin@google.com adf6560e82 Do not directly load smi constants larger than a 16 bit payload on ia32.
Instead of emitting a large smi constant directly as an immediate, xor the
smi with a random 32-bit cookie at compile time, emit code to move that into
a register and then to xor the register with the cookie.

1. In unoptimized code constants are always loaded into a register in
   ConstantInstr::EmitNativeCode.  Change it to load safely.

2. In optimized code constants loaded into a register for use by an
   instruction are loaded by ParallelMoveResolver::EmitMove.  Change it to
   load safely.

3. In optimized code some instructions allow constants as inputs.  These are
   reflected with an input location of Location::RegisterOrConstant (or
   similar) or else Location::Constant.  For the former allocate a register
   if the constant is unsafe, and for the latter check for safety before
   allowing the constant input.

BUG=https://code.google.com/p/dart/issues/detail?id=1742
R=iposva@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29439 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-29 12:19:12 +00:00