Commit Graph

964 Commits

Author SHA1 Message Date
Florian Schneider 631ac120bb VM: Fix --noopt build by using ZoneHandle.
BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1777093003 .
2016-03-10 13:47:07 +01:00
Regis Crelier ba69c8a898 Enumerate URIs of all types in type errors in order to help the user diagnose
the error (it was previously only printed for types with identical names).
Cleanup and simplify construction of type errors.

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

Review URL: https://codereview.chromium.org/1778133002 .
2016-03-09 15:16:47 -08:00
Matthias Hausner 5a0a097188 Fix issues in name resolution
Looking up a name x in the library scope or in a prefix can also return
the setter name x=. There were several situations that were not handled
right.

- a getter x and a setter x= should not result in a duplicate name
  error (and thus a resolution error at runtime).

- when looking for an untangled name x but a setter x= is found first,
  keep looking for x.

BUG=25625
R=regis@google.com

Review URL: https://codereview.chromium.org/1752203002 .
2016-03-02 10:44:28 -08:00
John McCutchan d08d4d8dba Dump functions on circular dependency parser error
Help with: https://github.com/dart-lang/sdk/issues/25545

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1751523003 .
2016-02-29 12:32:20 -08:00
Florian Loitsch 55630a5e90 Support 'dart.library.X' env variables in the VM.
BUG= http://dartbug.com/24587
R=iposva@google.com, johnmccutchan@google.com

Committed: https://github.com/dart-lang/sdk/commit/c2a06e22cb83f491fd3accc33d7738c87490c26d
Reverted: https://github.com/dart-lang/sdk/commit/5eb5b429895987519a00daa81b5ab261debbca3f

Review URL: https://codereview.chromium.org/1640853004 .
2016-02-29 20:58:32 +01:00
Srdjan Mitrovic 5a69e3661b In background compilation make a copy of Field in order to freeze its state. Add flag --force_clone_compiler_objects for debugging purpose.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1722733002 .
2016-02-26 09:07:49 -08:00
Ivan Posva 8d18298fed - Remove Isolate::Flags structure and store flags directly in isolate.
- Make enable_asserts, enable_type_checks, error_on_bad_override and
  error_on_bad_type release mode flags only.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1737693003 .
2016-02-25 18:06:56 -08:00
Regis Crelier 3ffe9922b7 Simplify various name flavors in VM.
R=asiva@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1723733002 .
2016-02-25 11:21:27 -08:00
Florian Schneider d8677964a3 Move precompilation-related flags to flags list.
They become compile-time constants in the precompiled runtime, and in product mode.

In precompiled product mode, the precompiled value has precedence.

BUG=
R=rmacnak@google.com

Committed: https://github.com/dart-lang/sdk/commit/5c9f18c6c87284395564051a052cc4acc9b6f59a

Review URL: https://codereview.chromium.org/1731743003 .
2016-02-25 07:53:39 -08:00
Ryan Macnak bd85deaf4e Revert "Move precompilation-related flags to flags list."
The default value of print_stop_message was architecture specific.

TBR=fschneider@google.com

Review URL: https://codereview.chromium.org/1739593002 .
2016-02-24 18:08:01 -08:00
Florian Schneider 5c9f18c6c8 Move precompilation-related flags to flags list.
They become compile-time constants in the precompiled runtime, and in product mode.

In precompiled product mode, the precompiled value has precedence.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1731743003 .
2016-02-24 17:31:08 -08:00
Florian Schneider b870dafa4f VM: Separate precompilation-specific code, make flags const.
Move optimizations for precompilation into separate file.

Remove precompilation-specific code from flow_graph_optimizer.cc.

Add precompilation-flags: They are const in the precompiled runtime. Started moving flags to use the new flag-definition macros.

Add libdart_lib_precompiled target.

Define PRECOMPILED_RUNTIME_MACRO in more places (dart_precompiled_runtime)

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1714743002 .
2016-02-23 08:48:08 -08:00
John McCutchan 8266501a72 Remove mirrors in product mode
(stripped) dart_product before: 5307888
(stripped) dart_product after: 5232976

Reduction in size: 74912 bytes.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1712843002 .
2016-02-22 09:55:20 -08:00
John McCutchan fda3a9bc2b Remove more things
(stripped) dart_product before: 5307888
(stripped) dart_product after: 5275088

Reduction in size: 32800 bytes.

Removed entirely:

- debuginfo*
- elfgen*
- gdbjit*
- TraceBuffer
- vtune support

Removed in product:

- Compiler stats
- Code observers

R=asiva@google.com

Review URL: https://codereview.chromium.org/1711163002 .
2016-02-22 08:53:11 -08:00
Srdjan Mitrovic 0c77e70b49 Cleanup access to guarded_fields
BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1712563006 .
2016-02-19 11:07:44 -08:00
Matthias Hausner 761ee7ec04 ‘Yield* e' should not access e.current eagerly
Match the implementation of dart2js.

BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org/1682173008 .
2016-02-12 13:28:16 -08:00
Regis Crelier bb649318e4 Remove support for Javascript warnings in the VM.
This cl is a clone of cl https://codereview.chromium.org/1683363002/ deleted by
accident. Already LGTM'ed.

Review URL: https://codereview.chromium.org/1690903003 .
2016-02-11 09:16:06 -08:00
Srdjan Mitrovic c5ea105261 Disable reg-exp compilation in background via a flag; abort background compilation if deoptimization needs to be triggered while compiling; Both issues will be fixed later
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1679373002 .
2016-02-09 12:48:31 -08:00
Regis Crelier 7ab578d21f Keep a trail while checking upper bounds in the VM in order to properly handle
cycles via bounds (fixes #25568).
Add a regression test.
Improve handling of recursive types with trails.
Make sure we do not modify already canonicalized types.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1674383002 .
2016-02-09 10:49:43 -08:00
John McCutchan e2e7af1229 Remove more feature in product mode
- Remove Timeline.
- Remove more vmservice code.
- Remove AST printing.
- Remove IL printing.
- Remove profiler.
- Remove thread interrupter.
- Remove disassembler.
- Remove Library::CheckFunctionFingerprints.

- Update test status files for product mode.

Size of dart_bootstrap before: 5287631
Size of dart_bootstrap after: 5112783

Reduction in size: 174848 bytes.

Total reduction in size (382734 + 174848): 557582 bytes.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1678203002 .
2016-02-09 08:45:32 -08:00
Srdjan Mitrovic 4316d1bd17 Move sticky_error_ from isolate to thread
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1672853002 .
2016-02-05 15:46:55 -08:00
Florian Loitsch 5eb5b42989 Revert "Support 'dart.library.X' env variables in the VM."
This reverts commit c2a06e22cb.

Review URL: https://codereview.chromium.org/1668253002 .
2016-02-04 22:26:06 +01:00
Florian Loitsch c2a06e22cb Support 'dart.library.X' env variables in the VM.
BUG= http://dartbug.com/24587
R=iposva@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1640853004 .
2016-02-04 13:04:31 +01:00
Matthias Hausner fef73d59ad Restore try contexts when breaking out of async for loops
Restore the try context in the finally clause of the implicit
try-finally around await-for loops. This ensures that the context
is restored even when breaking out of the loop.

BUG=24935
R=fschneider@google.com, regis@google.com

Review URL: https://codereview.chromium.org/1661433003 .
2016-02-02 13:33:15 -08:00
John McCutchan d77d376124 Replace intptr_t with TokenDescriptor
- Use TokenDescriptor instead of intptr_t for all token positions.
- Use TokenDescriptor in raw_object instead of int32_t.
- TokenDescriptor is a POD with an int32_t (this shrinks the size of AST and IR nodes by 32-bits on 64-bit architectures).

There are some cleanups I plan on doing as a follow up CL:

- Replace TokenDescriptor::value() with TokenDescriptor::TokenPos()

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

Review URL: https://codereview.chromium.org/1644793002 .
2016-02-02 10:15:44 -08:00
Siva Annamalai e72c1fb47d Implement safepointing of threads :
- uses thread execution status transition to track when a thread is in a safepoint or needs to block for a safepoint
 - introduces a monitor per Thread object
 - uses a per thread safepoint handshake between the thread requesting a safepoint and the requested thread.

The ThreadRegistry class now contains only the thread list for an isolate and the functionality of scheduling a thread onto an Isolate and unscheduling it from teh isolate. We could fold this functionality into the Isolate class in a different CL.

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

Review URL: https://codereview.chromium.org/1541073002 .
2016-02-01 10:57:34 -08:00
Matthias Hausner 4ca8417725 Allow methods to be named ‘factory’
Because it’s the law.

BUG=25489
R=regis@google.com

Review URL: https://codereview.chromium.org/1636583003 .
2016-01-25 13:46:52 -08:00
Matthias Hausner 783cc8acae Parser recursion check
Let the parser issue a compile-time error when the C stack is about to overflow, instead of crashing the VM.

BUG=24476
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1620493002 .
2016-01-22 08:59:45 -08:00
Lasse R.H. Nielsen 693628e99e Implement ?? as compile-time constant in VM.
Extracted from https://codereview.chromium.org/1493693002/

R=hausner@google.com

Review URL: https://codereview.chromium.org/1575383002 .
2016-01-22 12:39:16 +01:00
Regis Crelier 7f57ebcfa1 Remove signature classes from the VM.
They were used as the class of closure instances and as the type class of
function types.
All closure instances now have class _Closure and function types are represented
by a new class FunctionType extending AbstractType.
Fix issue 24567 and add regression test.

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

Review URL: https://codereview.chromium.org/1584223006 .
2016-01-19 16:32:59 -08:00
John McCutchan 77101d63e3 Source positions for constructors and lots of async machinery
- Rework token position address space.
- Use ClassifyingTokenPositions::kMethodExtractor for the token position of a method extractor.
- Plumb token positions through all of Ast Transformer.
- Plumb token positions for temporary expressions, etc in Flow Graph Builder.
- Add token positions for parts of the await machinery.
- Move ClassifyingTokenPositions into token.h.
- Remove default token position of Scanner::kNoSourcePos for many IR instructions.
- A couple of unit tests.
- Use synthetic token positions for synthetic AstNodes.
- Fix SLEB128 encoding / decoding + test
- s/Scanner::kNoSourcePos/Token::kNoSourcePos.
- Remove >= 0 and < 0 checks against token positions and use helpers instead.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1589643002 .
2016-01-19 15:01:08 -08:00
Florian Schneider f47839ba09 Rename DART_PRECOMPILED -> DART_PRECOMPILED_RUNTIME
To avoid future confusion with precompiler compiler-related macros/build targets

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1581393008 .
2016-01-19 13:59:49 -08:00
Matthias Hausner 782f7b268b Report missing semicolons after function declarations
Also take the opportunity to add the ability to report an error after a given token position. This way, the missing semicolon gets reported where it should: at the end of the line rather than the first token on the following line, when the error is actually detected.

BUG= 23761
R=regis@google.com

Review URL: https://codereview.chromium.org/1574213005 .
2016-01-19 09:31:33 -08:00
Regis Crelier ca1d105c5a Fix finalization of recursive type graph with bounds (issue 25389).
Add regression test.
Rename malformed_error to bound_error.
Fix internal name of bounded type (broken by a previous cl).

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1580643004 .
2016-01-13 11:19:14 -08:00
John McCutchan bda2b3d2ff Source position tests for switch and try catch finally
- Give AwaitMarkerNode a token position.
- Make it possible to provide a token position for SaveContext, RestoreContext, StoreContext, and CurrentContext.
- Pass in a token position to internally generated StoreLocal and LoadLocal instructions for try-catch-finally.
- Introduce a Context ClassifyingTokenPosition to be used when we can't attribute a context related instruction to a source position.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1575953005 .
2016-01-12 15:02:35 -08:00
Matthias Hausner 0964f26d24 Add flag to make await and yield keywords
Using --await_is_kw forces the parser to treat await and yield as keywords even in synchronous code.

BUG=
R=iposva@google.com, zra@google.com

Review URL: https://codereview.chromium.org/1573153003 .
2016-01-12 09:52:51 -08:00
John McCutchan 3ca0a08117 More source position improvements and tests
- Provide source positions for some ConstantInstrs.
- Classify all other ConstantInstrs.
- Use the token position of ++ rather than x in the expr: "x++;" for the add, constant 1, and final load operations.
- More tests
- Improvements to the test helpers.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1576583003 .
2016-01-11 10:19:08 -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
John McCutchan 789ed02b39 Don't test directly against Scanner::kNoSourcePos instead use >= 0.
A follow up CL will introduce new sentinel token positions that are < Scanner::kNoSourcePos (-1)

Gazoo

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1568353002 .
2016-01-08 12:20:24 -08:00
Florian Loitsch e0fe0c0ed8 Add support for configuration-specific imports to the VM.
R=hausner@google.com, iposva@google.com

Review URL: https://codereview.chromium.org/1380383002 .
2016-01-06 20:16:09 +01:00
Ryan Macnak c4480b6ded More 0 => Scanner::kNoSourcePos.
Arguably method extractors, invoke-field dispatchers and noSuchMethod dispatchers should also have their token position as kNoSourcePos instead of 0, but this would complicate how parser initializes its token iterator, so I'm leaving them as is.

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

Review URL: https://codereview.chromium.org/1566553003 .
2016-01-06 11:12:03 -08:00
Florian Schneider e9968ca5ff Fix VM bug with try-catch inside of try-finally.
There were two exception handlers with the same index added to the code so that only the one added
last was executed. In case of an exception that means that a re-throw may be omitted, causing invalid
control flow.

Also, add assertion to ensure unique try-index for exception handlers.

BUG=#25333
R=hausner@google.com

Review URL: https://codereview.chromium.org/1569523002 .
2016-01-06 18:50:53 +01:00
John McCutchan cb8b641cc9 Make Scanner::kNoSourcePos be a true sentinel value
- It is possible to write a Dart program with a function token_pos of 0.
- Switch Scanner::kNoSourcePos from 0 to -1.

R=hausner@google.com

Review URL: https://codereview.chromium.org/1564493002 .
2016-01-06 09:06:28 -08:00
Matthias Hausner 11a101a325 Canonicalize expressions that may be used as constants
Evaluate and canonicalize the parameters to the built-in function
identical(a,b) if they are strings. This guarantees that
identical(“ab”, “a”+”b”) evaluates to true.

Note: when the parser parses “a”+”b”, it doesn’t know whether the
expression will be used in a context that may require a
constant value. The canonicalization is thus deferred until it is
known that it is required.

BUG=25024
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1558033002 .
2016-01-05 08:51:52 -08:00
Florian Schneider 413ec9682e VM compiler: Remove dead strict-compare instructions in optimized code.
Also, remove two redundant const_casts.

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1554183002 .
2016-01-04 18:22:26 +01:00
Srdjan Mitrovic 6f867815d8 Incremental changes from background compilation work
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1541133003 .
2015-12-22 12:24:01 -08:00
Matthias Hausner cb5e586848 Ignore constructor phase parameter
When --move_super is true (the default value), the super constructor call
is moved to the end of the initializer list. In that case, the phase parameter
is not necessary. This change eliminates the check of the phase parameter in the constructor code, but does not yet eliminate the phase parameter.

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1544703002 .
2015-12-21 15:01:13 -08:00
Matthias Hausner f51f96816d Move super initializer to end of list.
Introduce --warn_super flag to print a warning when a super call is found that is not at the end of the initializer list.

Mark failing tests as Fail, OK.

In a later step, we can eliminate the implicit 'phase' parameter in constructors.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org/1540673002 .
2015-12-18 15:37:07 -08:00
Ryan Macnak c740fea545 VM: Fix crash parsing metadata with a closure as a const constructor argument.
BUG=http://dartbug.com/25240
R=hausner@google.com

Review URL: https://codereview.chromium.org/1534033003 .
2015-12-17 17:18:01 -08:00
Matthias Hausner 8293e9665b Fix owner of mixin forwarding constructors
Not sure why the new test appears to be a change to existing files, rather than an new files. I'm too dumb for git.

BUG=25246
R=regis@google.com

Review URL: https://codereview.chromium.org/1533823004 .
2015-12-17 14:16:40 -08:00