Commit Graph

93 Commits

Author SHA1 Message Date
regis@google.com 8997078334 Remove old code generator.
Review URL: https://chromiumcodereview.appspot.com//10665038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9122 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-26 17:43:44 +00:00
asiva@google.com 88243dfce2 Rework leaf calls as just simple C calls with a signature and not the NativeArgumentDescriptor.
Review URL: https://chromiumcodereview.appspot.com//10592006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8881 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-19 23:57:40 +00:00
srdjan@google.com 60fa0b27ca More ICData cleanups: try to use ICData instead of converting it to another intermediate representation. This sets the stage for more & simpler optimizations based on collected type feedback.
Review URL: https://chromiumcodereview.appspot.com//10594002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8877 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-19 21:49:11 +00:00
srdjan@google.com 7f8cbb12b7 This is https://chromiumcodereview.appspot.com/10581006/ that I forgot to submit, and messed up the original accidentally. Submitting as TBR
Review URL: https://chromiumcodereview.appspot.com//10580024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8871 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-19 21:19:00 +00:00
vegorov@google.com 959cf98b00 Implement a simple register allocator that tries to keep instruction results in registers.
Add --optimization-filter flag that allows to disbable optimizations for all function which do not match prefix. This allows to quickly localize problems with code generation.

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8811 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-18 18:04:22 +00:00
cshapiro@google.com e78250ca37 Generate code for store buffer updates in open-coded object field stores.
Review URL: https://chromiumcodereview.appspot.com//10536067

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8755 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-15 23:45:15 +00:00
srdjan@google.com 69be8e6f0b Add righ shift test for corner cases, use macro for deopt reasons (all suggested by Slava in a previous CL)
Review URL: https://chromiumcodereview.appspot.com//10539068

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8459 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-08 18:20:45 +00:00
hausner@google.com eebec2a081 Debugger break on TypeError, AssertionError
Add debugger functionality to pause the VM whenever a TypeError
or AssertionError exception happens.

This is a first step towards breaking on handled and unhanded
exceptions in general. We first need to generate more debug info
for catch handlers so we can determine whether an exception will
be handled or not before we unwind the stack to run the catch
clauses.
Review URL: https://chromiumcodereview.appspot.com//10537065

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8457 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-08 17:51:50 +00:00
srdjan@google.com 1a94d4d94d Implement Smi binops ia32 (new compiler).
Review URL: https://chromiumcodereview.appspot.com//10542079

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8450 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-08 16:59:49 +00:00
srdjan@google.com a8664d7420 When methods cannot be optimized initialize their count to a large negative number, otherwise they keep calling the runtime.
Review URL: https://chromiumcodereview.appspot.com//10421028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7969 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-24 23:57:44 +00:00
asiva@google.com c71a8cc1ee Change dart frame and stub frame layout to include the PC of the code executing on the frame. The stack frame layout is as follows:
ret PC
  saved EBP                          <== EBP
  PC (used to locate RawInstruction) <== ESP
Review URL: https://chromiumcodereview.appspot.com//10375059

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7675 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-16 00:47:05 +00:00
srdjan@google.com ad95f248cb Improve type checking, remove unused stub (removed also in x64 in preparation of porting the better type checking code from ia 32 to x64).
Review URL: https://chromiumcodereview.appspot.com//10381045

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7399 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-07 21:37:39 +00:00
srdjan@google.com 318742e413 Inline type checks for complex uninstantiated types, e.g., List<T>.
Review URL: https://chromiumcodereview.appspot.com//10317026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7353 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 23:28:26 +00:00
regis@google.com 5e99edcea7 Properly set the element type of literal lists.
Add test.
Keep element type consistent between growable array and backing array.
Fix snapshot reader to set the element type in growable array
Remove run time call checking rest argument.
Review URL: https://chromiumcodereview.appspot.com//10368004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7337 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 16:36:27 +00:00
srdjan@google.com 6fc1247bb6 Using SubtypeTestCache object instead of an array, that way we do not need to patch and can communicate to type tests if there is a cache to update (quicker than looking up code).
Review URL: https://chromiumcodereview.appspot.com//10352012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7304 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-03 22:00:52 +00:00
srdjan@google.com a53d7c1d03 Temporary fix for GrowableArray type arguments: use the type arguments stores in GrowableArray instead of the one in the data container (there is a bug that Regis is fixing where data container is always null). Fix assembly subtype cache lookup lookup.
Review URL: https://chromiumcodereview.appspot.com//10345003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7255 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-02 20:49:46 +00:00
regis@google.com 7793191032 Check upper bounds of type arguments when allocating objects of a generic type
at run time when they cannot be checked at compile time.
Review URL: https://chromiumcodereview.appspot.com//10280007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7211 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-02 01:57:22 +00:00
srdjan@google.com 33b4d35412 Simpler and better inlined type checks as discussed. Changed inline type test cache arrays to contain instance class, instance type argument and instantiator type argument (not yet used).
Review URL: https://chromiumcodereview.appspot.com//10243013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7113 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-28 00:06:37 +00:00
srdjan@google.com 87128e61e5 Inline type check where type argument that we check against is instantiated.
Review URL: https://chromiumcodereview.appspot.com//10134069

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7046 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-26 22:17:53 +00:00
asiva@google.com 09adb99a85 Add a stub_code_space in the heap alongside code_space so that stub code generation happens here and it is easy to determine if a PC is a stub code or not.
This gets rid of the temporary change made in code_generator.cc for fast access to the top dart frame. In addition it will not pollute the pc ==> code cache that I plan to add next as we don't have to store stub pcs in that table.
Review URL: https://chromiumcodereview.appspot.com//10223015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7033 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-26 18:00:53 +00:00
srdjan@google.com 72e21058ee (Redoing the change 6946) Progress toward inlined type checks for classes with type arguments: factor out
code, optimize type arguments of an instance.
Review URL: https://chromiumcodereview.appspot.com//10227006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6975 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-25 21:19:08 +00:00
asiva@google.com e046be3f87 Address perf regression by using the expected frame layout when traversing frames in the code generator. This is a temporary fix until we have a cache to speed up LookupCode.
Review URL: https://chromiumcodereview.appspot.com//10228010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6972 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-25 20:20:29 +00:00
srdjan@google.com be4b479d8b Revert change 6946.
Review URL: https://chromiumcodereview.appspot.com//10191020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6953 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-25 15:43:44 +00:00
srdjan@google.com b34787b742 Progress toward inlined type checks for classes with type arguments: factor out code, optimize type arguments of an instance.
Review URL: https://chromiumcodereview.appspot.com//10209002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6946 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-25 15:21:40 +00:00
asiva@google.com 3107319e40 Simplify representation of stack frames. Remove the special types DartFrame/StubFrame and instead use StackFrame with methods IsDartFrame and IsStubFrame for frames representing Dart or Stub Code. This eliminates all the complexity that was added to ensure that we always see only one stub frame before hitting a dart frame during iteration.
Fixes bug 6380625 which was another case when we had two stub frames before hitting the dart frame.
Review URL: https://chromiumcodereview.appspot.com//10173008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6920 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-25 01:15:28 +00:00
srdjan@google.com a78d8f32dc Redo r6764.
Review URL: https://chromiumcodereview.appspot.com//10095037

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6778 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 23:32:49 +00:00
regis@google.com ac6cb8cb66 Map malformed function result type and malformed function parameter type to
Dynamic in production mode (fix issue 5532534).
Fix bad negative test and make it positive.
Review URL: https://chromiumcodereview.appspot.com//10143004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6777 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 22:59:58 +00:00
srdjan@google.com fb4e40b625 Reverting CL 6764.
Review URL: https://chromiumcodereview.appspot.com//10128009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6766 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 20:37:40 +00:00
srdjan@google.com 1a61e098eb Factored out common cases for type tests, used by instance of and assert assigneable. Using inlined type test cache in assert assigneable.
Review URL: https://chromiumcodereview.appspot.com//10025031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6764 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 20:17:44 +00:00
turnidge@google.com 9d72035ce5 Use the ThreadPool for all isolates and native ports. Previously,
each isolate or native port had a dedicated thread.

Refactored the MessageHandler api...

- Added a Run function to allow a MessageHandler to run on a
  ThreadPool.  These functions take a start and end callback to allow for
  isolate initialization and shutdown.

- Made the queue private to the MessageHandler and moved all message
  processing code inside the MessageHandler (got rid of all of the
  different flavors of RunLoop).  This helps remove some code
  duplication and hides the details of how messages are handled.

- Moved all locking and notification out of MessageQueue and moved it
  up to MessageHandler.  Moved OOB support out of MessageQueue and up
  to MessageHandler.  These changes make the MessageQueue much
  simpler.

- Refactored native port and isolate MessageHandlers to share more code.

- Improved --trace_isolates output.

- Added tests for MessageHandler.

Refactored lib/isolate code...

- Use the new MessageHandler::Run api.

- Got rid of the LongJump stuff in RunIsolate.  No longer needed.

- Use the new StartIsolateScope/SwitchIsolateScope to make the code
  less verbose and less error-prone.

- Store top-level isolate errors in the sticky_error.

Added StartIsolateScope/SwitchIsolateScope classes.
Review URL: https://chromiumcodereview.appspot.com//9924015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6762 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 19:47:27 +00:00
asiva@google.com 2d3775a1b1 Resubmit change 6302 after fixing the compiler warning on older GCC compiler versions:
Change 6302 description:
- Wire the stack frame iterator to use stack maps for traversing objects if
there are stack maps in the code object. If there are no stack maps it still
does the old style stack frame traversal between fp and sp looking for tagged
pointers.
- Added a mechanism to be able to iterate over the code space and look for a
particular object.
Review URL: https://chromiumcodereview.appspot.com//10030001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6331 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-09 18:20:23 +00:00
asiva@google.com c79da818cc Revert change 6302 until the compiler warning is addressed.
Review URL: https://chromiumcodereview.appspot.com//10025003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6304 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-07 02:04:28 +00:00
asiva@google.com c27cec5b6e - Wire the stack frame iterator to use stack maps for traversing objects if there are stack maps in the code object. If there are no stack maps it still does the old style stack frame traversal between fp and sp looking for tagged pointers.
- Added a mechanism to be able to iterate over the code space and look for a particular object.

- Remove registration of code objects into the code index table.
Review URL: https://chromiumcodereview.appspot.com//9791048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6302 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-07 01:44:48 +00:00
srdjan@google.com 1125846660 When checking against non-parametrized types use a cache to hold result tuples (class, result). That cache is stored in the instruction stream. Currently implemented for instanceof, ia32 only. Should migrate to other type tests and architectures.
70x improvement on a benchmark (similar to what is seen in html _unwrap).
Review URL: https://chromiumcodereview.appspot.com//10010029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6281 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-06 16:05:55 +00:00
regis@google.com 5282e44fb2 Use null type argument vector instead of vector of Dynamic for a generic raw
type when possible.
Fix type finalization of type parameters (always finalize in the context of the
class being parameterized and not in the enclosing class where the type
parameter is used).
Fix wrong generic optimization and added a test (a generic type instantiated
from a raw instantiator is not always raw).
Added printing of type argument vectors.
Review URL: https://chromiumcodereview.appspot.com//9939003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6068 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-30 22:16:52 +00:00
asiva@google.com e360e4d1c9 Second set of changes for implementation of stack map support.
- Added functionality to be able to build stack maps in the compiler and register them into the Code object during Code finalization.
- Merged code_generator_ia32_test.cc and code_generator_x64_test.cc into code_generator_test.cc as the two files were identical.
Review URL: https://chromiumcodereview.appspot.com//9721006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5764 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-23 01:27:35 +00:00
srdjan@google.com 0832db6261 Fix 2172: report 'int' instead of Smi, Mint and Bigint when throwing TypeError.
Review URL: https://chromiumcodereview.appspot.com//9705041

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5525 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-15 15:54:59 +00:00
hausner@google.com cd6e29a898 Deoptimize functions before setting breakpoints
Does not yet handle cases where the functions have active frames
on the stack.
Review URL: https://chromiumcodereview.appspot.com//9696020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5436 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 20:37:49 +00:00
regis@google.com d74c2008be Fix type check to perform a subtype test at top level instead of an
assignability test. This only makes a difference when assigning an instance of
a function type.
Fix a bad language test.
Disable a bad co19 test (issue 99 filed).
Change error message for dynamic type error.
Review URL: https://chromiumcodereview.appspot.com//9664029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5413 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 16:16:12 +00:00
turnidge@google.com ff26341fd6 Heartbeat implementation of dart:mirrors.
Add the skeleton for the dart:mirrors library in all the appropriate
places.  The only thing we can do right now is ask an Isolate for its
debugName.  Add a few tests.
Review URL: https://chromiumcodereview.appspot.com//9420038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5370 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-12 23:51:03 +00:00
regis@google.com f4ddc43cdf Generate dynamic type errors according to spec.
Fix a few bad tests.
Turn a couple negative tests in multi-tests.
Triage a few co19 failing tests.

Still to do:
Check bounds of generic types at runtime in checked mode.
Stop reporting bounds error in new operator as a compile time error.
Review URL: https://chromiumcodereview.appspot.com//9615035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5064 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-07 02:23:12 +00:00
asiva@google.com 4f7f9021c5 - Always write a Null Object for Code objects
- Do not populate the FunctionsCache array as it causes the function cache
  to become inconsistent if we execute some dart code before capturing a
  snapshot.
- Allow preallocation of objects even when generating snapshot and remove the
  flag preallocate_objects_called_ (use a null test instead).
Review URL: https://chromiumcodereview.appspot.com//9580036

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4915 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-03 01:53:26 +00:00
srdjan@google.com 17537cf230 Fix crash in inline cache: forgot to GC properly RawICData. Various cleanups.
Review URL: https://chromiumcodereview.appspot.com//9567023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4832 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 22:02:41 +00:00
srdjan@google.com f6dfa63c9a Cleaned up usage of Function::code, since it may be misunderstood that it points to the only Code object that belongs to that function. That is not the case, there can be several Code object generated for the same function. "Renamed" "code()" to "CurrentCode()", use unoptimized_code where it is clear that we are using unoptimized code only. If compiled, there is a 1:1 correspondence between function and unoptimized code.
Review URL: https://chromiumcodereview.appspot.com//9475031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4656 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 01:31:44 +00:00
hausner@google.com 6d9abc5e3b StepOver, StepInto, StepOut
Implement single stepping in the debugger.
- Add PC descriptors for function return
- functions to set temporary breakpoints on all
  locations in a function.
- patching/restoring of function return code pattern
- determine call target of instance calls
Review URL: https://chromiumcodereview.appspot.com//9484002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4639 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-27 22:00:28 +00:00
srdjan@google.com a343a49338 Do not count invocations but usage of a function, i.e., increment a function's counter at IC calls and at return operations in unoptimized code. (TODO: increment count at static calls as well). There is no checking at method entry any more. The function counter reporting is not measuring the invocation count but much more how much time we spend in a method. Removed counter at backward branches.
Renamed flags to:
--optimization_counter_threshold (default 2000)
--report_usage_count
Review URL: https://chromiumcodereview.appspot.com//9460015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4583 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-25 00:33:25 +00:00
srdjan@google.com 1eaef108b9 Move CodeGenerator::DescriptorList into shared part.
Review URL: https://chromiumcodereview.appspot.com//9465028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4582 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-24 23:27:24 +00:00
srdjan@google.com e6d87ec63f When tracing type checks in runtime, also print the method where the type check occured.
Review URL: https://chromiumcodereview.appspot.com//9447028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4551 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-23 20:03:02 +00:00
srdjan@google.com a54f33bf92 ICData is now a wrapper object that refers to the calling function, target name, ic data array, etc. The old ICData C++ class that wrapped around an Array is removed. The advantage is that the ICData object remains the same, only its ic_data array object is being modified as classes are added..
TODO: store ICData-s into function so that the type feedback can be easily extracted (currently must traverse the unoptimized code).
Review URL: https://chromiumcodereview.appspot.com//9395016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4417 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 00:40:03 +00:00
turnidge@google.com 0ddd4c04e9 Dart_PropagateError, take 2.
This change hopefully takes care of the non-mac build issues.  The
checked mode failures are fixed in a separate cl.
Review URL: https://chromiumcodereview.appspot.com//9316071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3863 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-02 19:05:06 +00:00