Commit Graph

39 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 953daeaf89 Add more timing information.
Review URL: https://chromiumcodereview.appspot.com//10116012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6697 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-18 15:53:20 +00:00
iposva@google.com 74201ff9fd Fix issue 2621:
- Properly restore long_jump_base when returning early.
Review URL: https://chromiumcodereview.appspot.com//10083046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6693 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-18 15:08:59 +00:00
srdjan@google.com e68746422f Fix issue 2125: do not reparse a function being deoptimized.
Review URL: https://chromiumcodereview.appspot.com//10103005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6604 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-16 21:37:45 +00:00
srdjan@google.com 242b4facdd Measure code generation time as well.
Review URL: https://chromiumcodereview.appspot.com//10084014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6534 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-13 17:39:07 +00:00
srdjan@google.com d154a7ffce Try/catch in new compiler. Added try index to appropriate instructions. If any instruction throws an exception, the try index tells us which catch entry the exception belongs to.
Review URL: https://chromiumcodereview.appspot.com//10014006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6389 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-10 23:22:40 +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
turnidge@google.com e610ab662b Revert my last change due to problems on other platforms.
Review URL: https://chromiumcodereview.appspot.com//9968088

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6129 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-03 17:51:20 +00:00
turnidge@google.com 11d29be5e1 Detect recursion during compilation of const constructors.
We now give a message like this:

    Illegal recursion in const constructor 'A.'.
Review URL: https://chromiumcodereview.appspot.com//9965081

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6128 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-03 17:32:39 +00:00
hausner@google.com 356870a3c8 Stop ignoring compilation errors on compile_all
When compiling all code, stop compiling after the first error.
Previously, we ignored compilation errors.

This was a feature wish so we can detect errors in libraries.
In fact, there are errors in the library, e.g. references
to non-existing top-level functions in utf16 code. And possibly
others. If this code gets checked in, any tests that depends on
--compile_all will break.

First problem:

'dart:utf': Error: line 607 pos 7: identifier 'is16BitCodeUnit' is not declared in this scope
  if (is16BitCodeUnit()) {
      ^

If I hack that, the next one is:

'dart:utf': Error: line 613 pos 9: identifier 'utf16CodeUnitsToCodepoints' is not declared in this scope
        utf16CodeUnitsToCodepoints(codeunits, 0, null, replacementCodepoint));
        ^

Didn't investigate any more than that...
Review URL: https://chromiumcodereview.appspot.com//9836064

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5835 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-26 15:51:25 +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
kmillikin@google.com 6653fd66eb Compute preorder as well as postorder basic block orderings.
The Lengauer-Tarjan dominator/dominance frontier algorithm needs to
visit the blocks in reverse preorder (in the first pass) and preorder
(in the second).  Compute that at the same time as postorder (e.g.,
using the same spanning tree).

Take this chance to make the flow graph visitors always operate on a
forward block ordering.

R=srdjan@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5598 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-16 22:20:04 +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
asiva@google.com 588aaf6530 Use GrowableObjectArray in ic-data.
Review URL: https://chromiumcodereview.appspot.com//9630003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5189 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-08 19:23:24 +00:00
hausner@google.com e58b6e4d4c Splitting debugger breakpoints into two parts
Splitting breakpoints into SourceBreakpoint that represent
a user-defined source location of a breakpoint, and
CodeBreakpoint, which represents a code location. There can
be more than one CodeBreakpoint per SourceBreakpoint, e.g.
for functions that are also called as closures (and are thus
compiled twice.)

Functions are no longer compiled as a side effect of setting
a breakpoint. When they eventually get compiled, the previously
recorded SourceBreakpoint is found and a CodeBreakpoint is set.
Review URL: https://chromiumcodereview.appspot.com//9581013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4891 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-02 18:01:38 +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
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
kmillikin@google.com 862dc2f03c Add enough compiler support to compile empty functions on x64.
Implement a simple compilation visitor for the intermediate language.  Copy
code from the x64 code generator to support compilation of functions with no
arguments, no locals, and that return a literal.

Compiled code is not used, but it can be disassembled and visually checked
against the code from the old code generator.

R=srdjan@google.com
BUG=
TEST=expected to pass all tests on x64

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4601 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-27 08:28:51 +00:00
srdjan@google.com e3c98a5e19 Enable new compiler in x64 mode (bail-out all the time, but we can use automated testing).
Disable CodeIndexTable test inde debug x64. This CL includes a pending CL from Kevin (will wait for it to be submitted).
Review URL: https://chromiumcodereview.appspot.com//9443021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4549 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-23 19:24:14 +00:00
srdjan@google.com d89a53417b Added LongJump for bailout. When trying to fix all crashes, CHECK_ALIVE did not scale well as bailing out mechanism.
Implemented UnaryOpNode. Fix crashes.
(this CL also includes the patches from https://chromiumcodereview.appspot.com/9429056/, will remove them once syncing with submitted 9429056)
Review URL: https://chromiumcodereview.appspot.com//9443002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4541 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-23 16:14:01 +00:00
kmillikin@google.com 41e77a0a9e Initial implementation of a flow-graph builder for Dart's AST.
Visit the AST and generate an instruction (ie, not basic-block) flow
graph.

The flow graph for the simple function:

main() {
  var f = 1;
  var n = 5;
  while (n > 0) {
    f = f * n;
    n = n - 1;
  }
  print(f);
}

is:

       1: StoreLocal(f, #1)
       2: StoreLocal(n, #5)
       3: [join]
       4: t0 <-LoadLocal(n)
       5: t0 <-InstanceCall(>, t0, #0)
       6: if t0 goto(7, 15)
       7: [target]
       8: t0 <-LoadLocal(f)
       9: t1 <-LoadLocal(n)
      10: t0 <-InstanceCall(*, t0, t1)
      11: StoreLocal(f, t0)
      12: t0 <-LoadLocal(n)
      13: t0 <-InstanceCall(-, t0, #1)
      14: StoreLocal(n, t0) goto 3
      15: [target]
      16: t0 <-LoadLocal(f)
      17: StaticCall(print, t0)
      18: return #null

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4460 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 15:20:13 +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
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
srdjan@google.com df94bc5fa5 Use inlined double temporary object for unary operation, add tests. Fix disassembler crash.
Review URL: https://chromiumcodereview.appspot.com//9297026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3666 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-27 21:04:12 +00:00
hausner@google.com f4dee306e5 Fix local variable info in debugger stack trace.
Review URL: https://chromiumcodereview.appspot.com//9117042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3572 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-24 21:33:40 +00:00
hausner@google.com 4ee7c947aa Getting value of local variables on stack trace
Introduce concept of scope in local variable info, according
to mirror proposal.
Review URL: http://codereview.chromium.org//8983034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3017 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-05 22:33:37 +00:00
srdjan@google.com 0e435be09c Add (debug) printing when IC is used in optimized code (must eliminate it).
Do Smi binary op only on two Smi-s.
Increase deopt counter limit to 5., which still may be too low. Deopt counter is here mainly to prevent drastic performance degradations because of bugs or missing implementations.
Review URL: http://codereview.chromium.org//9007027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2673 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-20 22:05:41 +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 c0a9b76a67 Add missing argument to HANDLESCOPE().
Siva is investigating why this is only failing now and only on Win32.
Review URL: http://codereview.chromium.org//8547013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1711 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-21 17:47:49 +00:00
regis@google.com 1df8ca858e Rename the VM internal 'var' type to 'Dynamic' type.
This change does not implement support for the built-in identifier 'Dynamic'.
Review URL: http://codereview.chromium.org//8403003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@779 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-26 20:58:34 +00:00
srdjan@google.com ffaec5255d Store IC data instead of array of classes in AST node, so that we can easier access targets and future multi-check IC data.
Review URL: http://codereview.chromium.org//8394061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@770 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-26 18:47:17 +00:00
srdjan@google.com 5f43c05de7 Implement new inline cache. Delete a lot of unused code (most of change).
Review URL: http://codereview.chromium.org//8379013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@706 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-25 18:35:49 +00:00
regis@google.com db3a736c33 Support optional named arguments at the dart_entry level in the VM.
Fix bug 5422033: Const expressions don't work with named arguments.
Review URL: https://chromereviews.googleplex.com/3552015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@168 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-06 22:40:45 +00:00
dgrove@google.com 4c0f559d23 Initial checkin.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00