Commit Graph

46 Commits

Author SHA1 Message Date
srdjan@google.com 344aba1e75 Assign ids to incoming arguments (to be used in checked mode).
Review URL: https://chromiumcodereview.appspot.com//10115053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6718 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 00:04:47 +00:00
srdjan@google.com 64226e65ac Share intrinsification framework across architectures, started on instrinsification in the new compiler x64.
Review URL: https://chromiumcodereview.appspot.com//10035006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6661 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-17 22:44:41 +00:00
regis@google.com 3c063c8d4f Eliminate type checks that can successfully be performed at compile time.
Review URL: https://chromiumcodereview.appspot.com//10051011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6420 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-11 17:42:39 +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
srdjan@google.com 570fd35af9 Move HandlerList to shared ExceptionHandlerList.
Review URL: https://chromiumcodereview.appspot.com//9949020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6244 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-05 19:44:49 +00:00
srdjan@google.com 76df5fac83 Implement object allocation/construction as effect (no result), sequence labels and unchaining from context.
Review URL: https://chromiumcodereview.appspot.com//10005010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6226 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-05 16:23:22 +00:00
regis@google.com ab0a25eb1d Add missing type checks for top level static initializers (issue 1980 and
duplicates 1957, 2070, 2224).
Review URL: https://chromiumcodereview.appspot.com//9958091

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6145 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-03 20:23:30 +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
regis@google.com 18bd10e96a Implement StaticGetter and StaticSetter in new compiler.
Review URL: https://chromiumcodereview.appspot.com//9726011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5664 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-19 23:09:06 +00:00
regis@google.com bb20585e0f Use a local variable to save/restore the context on entry/exit, instead of
explicitly pushing/popping.
Review URL: https://chromiumcodereview.appspot.com//9721004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5649 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-19 17:02:40 +00:00
srdjan@google.com d4dcb9fee0 Clean-up CodeGenState: remove unused loop_level and move context_level to CodeGenerator (and add it to FlowGraphBuilder).
Review URL: https://chromiumcodereview.appspot.com//9706086

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5571 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-16 15:38:43 +00:00
regis@google.com 0e5fd9b99c Do not chain the current context on entry in non-closure functions, but
save and restore it on the stack instead, and chain a null context (issue 1613).
Review URL: https://chromiumcodereview.appspot.com//9705004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5446 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 00:16:22 +00:00
srdjan@google.com 01b27d8f6f Fix build.
Review URL: https://chromiumcodereview.appspot.com//9689068

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5421 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 17:51:02 +00:00
srdjan@google.com aca2d7ffe0 Optional arguments in new compiler.
Includes Issue 9664062: Support allocating and calling closures in the new non-optimizing compiler (with fixes)
Review URL: https://chromiumcodereview.appspot.com//9693020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5419 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 17:35:05 +00:00
kmillikin@google.com b05d117185 Support allocating and calling closures in the new non-optimizing compiler.
As part of this change, variable allocation is split out from the backend
code generator.

R=srdjan@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5392 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 12:31:45 +00:00
regis@google.com e05a6a04ba Fix type checks that wrongly ignored malformed types.
Fix corresponding test.
Fix comment in gypi file.
Fix undeclared type in stream_util.dart.
Review URL: https://chromiumcodereview.appspot.com//9649010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5243 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-09 18:14:02 +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
srdjan@google.com d6abdfb6b8 Eliminate IncrOpStaticFieldNode, replace a set of nodes.
Review URL: https://chromiumcodereview.appspot.com//9592031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5063 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-07 00:40:48 +00:00
srdjan@google.com 923ed6eb53 It is the setter that can have a result, but not the StoreInstanceFieldNode.
Review URL: https://chromiumcodereview.appspot.com//9581016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4902 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-02 21:52:03 +00:00
srdjan@google.com e2ab4d25fd Added stack overflow checks at backward branches in order to allow interrupting endless loops. Better code will detect if the loop calready contains calls and therefore can omit the extra check (in next compiler).
Review URL: https://chromiumcodereview.appspot.com//9562045

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4889 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-02 17:53:28 +00:00
regis@google.com 47724a8491 Add support for malformed types and postpone some related errors from compile
time to execution time.

Still to do (once spec is clarified):
- properly handle generic type bounds errors
- properly handle 'instance of' type checks involving malformed types
- fix bad tests
Review URL: https://chromiumcodereview.appspot.com//9515011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4732 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-29 02:14:18 +00:00
kmillikin@google.com 888a35df7f Add a stubbed-out implementation of FlowGraphCompiler for ia32 and arm.
It bails out if FlowGraphCompiler::CompileGraph is called, all other public
API functions are UNIMPLEMENTED.

R=srdjan@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4685 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 14:17:17 +00:00
kmillikin@google.com 66d243ea7d Allocate and finalize a code object on x64 if the new compiler succeeds.
If the new compiler completed, use the code that it produced.

R=srdjan@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4674 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 11:34:27 +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
hausner@google.com 1ecc0a9e97 Fix handling of unresolved names
Fixes issue 1805 (http://code.google.com/p/dart/issues/detail?id=1805)

The VM didn't turn unresolved identifiers into instance getter calls in all cases. Refactored the code that handles primary expressions.
Review URL: https://chromiumcodereview.appspot.com//9453020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4550 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-23 19:55:57 +00:00
srdjan@google.com 251439618f Disable invocation of otpimizing compiler on x64 regardless of optimization_invocation_threshold value.
Review URL: https://chromiumcodereview.appspot.com//9431036

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4478 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 17:54:57 +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
regis@google.com 5933826ae8 Fix context unchaining (issue 5991015).
Add test.
Review URL: https://chromiumcodereview.appspot.com//9392020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4201 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-14 00:58:56 +00:00
hausner@google.com 4d3a5f658a Add PC descriptor for ret instruction
Adding a new kind of PcDescriptor to mark the location of
function returns in generated code. This will be needed to
put a single-step breakpoint just before the function return.

Also adding a NOP instruction after the ret, so that the
function return code pattern adds up to 5 bytes, which is needed
to patch in a breakpoint call.
Review URL: https://chromiumcodereview.appspot.com//9385022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4159 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-11 01:02:09 +00:00
regis@google.com 2edb4ae9c7 Add token index position to classes and types for more accurate error reporting.
Review URL: https://chromiumcodereview.appspot.com//9325047

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3965 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-06 19:52:02 +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
turnidge@google.com ae88492093 Revert Dart_PropagateError until I can track down the problems in
checked mode tests.

Sorry for the hubbub.
Review URL: https://chromiumcodereview.appspot.com//9314053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3823 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 23:39:28 +00:00
turnidge@google.com 9da62c5fea Add Dart_PropagateError.
This function can be used in native functions to properly pass all
errors up the stack.

Set the long jump base in the Compiler instead of outside of the
compiler.  A bunch of errors that used to be propagated through the
sticky_error are now propagated through return values.  This includes
all of the DartEntry and DartLibraryCall functions.

In particular, we no longer use the long jump to cross dart frames.
Instead errors are propagated across dart frames using the same
mechanism that we use for unhandled exceptions.  I've added assertions
to make sure that we only use the long jump when it is "safe".
Review URL: https://chromiumcodereview.appspot.com//9169102

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3815 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 22:34:16 +00:00
regis@google.com 980cbf9c74 Store resolved library prefix in unresolved class object in order not to repeat
unnecessary library prefix resolution.
Remove redundant Type::NewParameterizedType() helper.
Simplify parsing of qualified identifiers.
Cleanup parsing of factory methods.
Fix resolution of imported types (add tests).
Review URL: https://chromiumcodereview.appspot.com//9233039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3703 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-31 00:07:07 +00:00
regis@google.com f9e785eb29 Remove support for obsolete syntax of factory methods and default classes.
Review URL: https://chromiumcodereview.appspot.com//9285031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3578 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-24 22:37:45 +00:00
asiva@google.com bf1b2bbeb9 Improve compile times for swarm application startup
- Avoid creation of getter/setter symbol when all we need to do is a lookup
- Add LookupGetterFunction/LookupSetterFunction to avoid having to create the getter name/setter name before doing a lookup
Review URL: https://chromiumcodereview.appspot.com//9265021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3453 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-20 00:55:39 +00:00
hausner@google.com a9f221ebc2 Improve error message for some unresolved identifiers
Review URL: https://chromiumcodereview.appspot.com//9246001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3368 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-17 21:16:27 +00:00
turnidge@google.com 53ba5c402e Make the "sticky error" an Error instead of a String.
I do this in preparation for using the sticky error to implement
isolate unwinding.
Review URL: https://chromiumcodereview.appspot.com//9186058

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3367 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-17 19:54:02 +00:00
regis@google.com 2d1f63af47 Port a couple more stubs to x64.
Fix integer implementation issues.
Enable all tests on x64.
Review URL: http://codereview.chromium.org//9114054

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3307 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-13 20:07:54 +00:00
iposva@google.com e72f0af364 - Fix a couple near branches that were out of reach.
- Implement slow case for AllocateContext and AllocateClosure stubs.
Review URL: http://codereview.chromium.org//9046009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2836 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-27 22:59:54 +00:00
srdjan@google.com 8ad051c2f3 X64: check all cases with "__ movq(FieldAddress" and converted them to StoreIntoObject if appropriate.
Review URL: http://codereview.chromium.org//9017024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2725 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-21 21:35:25 +00:00
hausner@google.com 503e2219b8 First part of inspecting local variables
This change introduces variable descriptors that describe the name, stack slot index, and source code stretch in which a variable is valid.

Activation frames in the stack trace now can enumerate the variables that are active in that frame.

Next step: fetch the value of variables from the stack.
Review URL: http://codereview.chromium.org//8992020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2671 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-20 21:40:28 +00:00
regis@google.com a577991ad5 Port code generator to x64.
Review URL: http://codereview.chromium.org//8984003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2557 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-17 00:56:02 +00:00