Ivan Posva
b2ac279269
- Use a map to lookup libraries by URL.
...
- Ensure the uniqueness of private keys without having to
search the existing key space.
- Pass a thread parameter where useful to library methods.
BUG=
Review URL: https://codereview.chromium.org/1947393003 .
2016-05-05 10:42:28 -07:00
Ivan Posva
5be5d54529
- Refactor Symbol allocation to expect a thread parameter.
...
- Preallocate all tokens as symbols to avoid repeated lookups.
- Pass thread/zone where useful while doing this change.
- Avoid allocating symbols for error messages.
BUG=
R=fschneider@google.com
Review URL: https://codereview.chromium.org/1870343002 .
2016-04-11 16:28:29 -07: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
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
Srdjan Mitrovic
181e8cc2a9
Move resolving of natives to a late stage (during code emission). That eliminates unnecessary native resolution (e.g., when native gets recognized or rejected in the inliner). Removed tests that are now impossible to implement with AST (fake native functions).
...
BUG=
R=hausner@google.com
Review URL: https://codereview.chromium.org/1420173006 .
2015-11-03 16:18:24 -08:00
Srdjan Mitrovic
304dc3486f
Make default_parameter_values a ZoneGrowableArray instead of an array in new space
...
BUG=
R=hausner@google.com
Review URL: https://codereview.chromium.org//1307943008 .
2015-08-24 17:22:44 -07:00
vegorov@google.com
7525692108
Fix vm/cc/StaticNonNullSumCallCodegen.
...
Instead of passing null wrapped in the Smi handle use Instance handle.
We have the following behavior:
Smi::ZoneHandle().IsSmi() -> true
Smi::Cast(Smi::ZoneHandle()).Value() -> assertion failure
This kind of behavior is completely unexpected in most parts of the system.
TBR=iposva@google.com ,asiva@google.com
Review URL: https://codereview.chromium.org//473913005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39455 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-21 16:07:11 +00:00
regis@google.com
38319b0f33
Fix issue 18435 (2nd attempt).
...
Add regression test.
R=hausner@google.com
Review URL: https://codereview.chromium.org//293013005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36402 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-21 00:32:32 +00:00
zra@google.com
3274258b4d
Enables all codegen tests for arm64.
...
R=regis@google.com
Review URL: https://codereview.chromium.org//259903002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35448 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-25 21:28:48 +00:00
zra@google.com
2dee7e5a6d
Enables all startup code for arm64.
...
Also, enables a few more codegen tests, and adds
a conditional move instruction.
R=regis@google.com
Review URL: https://codereview.chromium.org//253623003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35440 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-25 18:54:46 +00:00
zra@google.com
9fc211af50
Enables simple static call test on arm64.
...
R=regis@google.com
Review URL: https://codereview.chromium.org//255633002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35380 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-24 16:29:11 +00:00
zra@google.com
0995122da8
Enables first codegen test on arm64.
...
R=regis@google.com
Review URL: https://codereview.chromium.org//246293010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35317 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-23 17:50:43 +00:00
zra@google.com
2fe51715e5
Begins work on ARM64, first assembler test.
...
Most new code is in constants_arm64.h and
{assembler,disassembler,simulator}_arm64.{h,cc}
The rest of the CL just #def's out tests, modifies status files,
and adds UNIMPLEMENTED functions, etc.
R=regis@google.com
Review URL: https://codereview.chromium.org//221133002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34654 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-02 17:39:32 +00:00
hausner@google.com
0c434b3073
Rename kDummyTokenIndex to kNoSourcePos
...
Addresses comment to previous change list.
R=regis@google.com
Review URL: https://codereview.chromium.org//144343002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31969 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-21 23:46:26 +00:00
srdjan@google.com
3274f92827
Rename FinalizeTypeHierarchy to ProcessPendingClasses.
...
R=regis@google.com
Review URL: https://codereview.chromium.org//83983004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30688 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-27 00:11:32 +00:00
srdjan@google.com
3485989ae7
Do not eagerly finalize classes in CHA, instead regard unfinalized classes as ’non-existent’ and only invalidate optimized code at finalization of the class.
...
Rename FinalizePendingClasses to FinalizePendingClassInterfaces as the class finalization occurs lazily.
TODO: add dependency information to deoptimize/remove only relevant optimized code.
R=regis@google.com
Review URL: https://codereview.chromium.org//81333003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30582 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-22 17:59:23 +00:00
hausner@google.com
fd57843900
Update handling of ambiguous name references
...
Update VM to latest spec. Referencing a name that is imported
from more than one library is no longer a compile-time error.
If one of the sources of an ambiguous reference is a dart library,
the dart library declaration is automatically hidden.
Also fixes a bug where looking up a getter name in a library
found the getter even though the name is filtered out in the
'hide' combinator.
Long-term we should fix the need for repeatedly convert between
the mangled getter and setter names and the untangled name.
Fixes 12915, 12913, 12724.
R=regis@google.com
Review URL: https://codereview.chromium.org//23484020
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27312 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-09 21:52:40 +00:00
fschneider@google.com
ba0f59d1bc
Polymorphic inlining for some recognized methods in the optimizing compiler.
...
The optimizing compiler currently recognizes a certain frequent native methods
like array length or string length and provides an inlined implementation.
Inlining does currently not work for polymorphic call sites of these methods.
This CL enables also polymorphic inlining in the case of .length getters for
arrays and strings.
1. The method is recognized at flow graph build time. The builder creates
the body of the method for both compilers (non-optimizing and optimizing).
Native methods that are not recognized, are translated as before using a NativeCall
IL instruction.
2. The flow graph inliner handles recognized methods in the same manner as normal methods.
Until now intrinsic and recognized method could not be inlined. This CL enables it.
3. There is no need for an intrinsic assembly implementation because recognized methods
have an IL implementation that does not call into the C++ runtime. I left the intrinsics
in for now, but they can be removed if there is not noticable performance benefit anymore.
4. The inlining heuristics are tweaked in a way that enables more aggressive inlining
of recognized methods: +1 level of inlining depths, call sites of recognized methods are
not counted in the inlining heuristic.
R=kmillikin@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//22839003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26429 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-21 12:58:08 +00:00
asiva@google.com
b4d9e0d620
Auto create ApiLocalScope before calling native functions, this ensures that
...
native functions do not have to call Dart_EnterScope/Dart_ExitScope
when they callback into the VM.
Remove Dart_EnterScope/Dart_ExitScope calls around native functions in 'bin'
directory.
R=regis@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//22303002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25827 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-06 19:27:48 +00:00
regis@google.com
9581071936
Refactor resolution code in the vm to properly handle ambiguity errors.
...
Add test.
R=asiva@google.com
Review URL: https://codereview.chromium.org//19662003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25324 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-23 00:19:39 +00:00
fschneider@google.com
9a6657cd4d
Eliminate temporary locals for some expressions
...
This CL affects a subset of expressions that use temporary locals: constructor
calls, array literals and and instance getter postfix-ops.
For expressions that are de-sugared in the parser I added LetNode.
It creates a scoped temporary local bound to an initializing expression.
For expressions where we need a temporary local at graph-building time,
I added a helper class TempLocalScope to easily create a single temporary
local in the graph builder since this is a frequently recurring pattern.
This simplifies code in the parser and the graph builder and also fixes a
bug with indexed-super invocation and NoSuchMethod.
BUG=dart:8918
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//14942010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23401 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-30 12:19:21 +00:00
hausner@google.com
8e29370a1b
BREAKING CHANGE: enforce part of directive
...
For historical reasons, the VM is currently too lenient when parsing library parts. Files that get loaded through a 'part' directive must start with a 'part of libraryname;' clause. The VM so far has not reported an error if the clause is missing.
This change enforces the grammar as the Spec mandates it. Library parts that do not start with 'part of' will no longer compile.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//14791005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22278 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-01 20:46:48 +00:00
zra@google.com
e411541296
Implements exception handler stub on MIPS.
...
Also enables codegen and object tests on MIPS.
Review URL: https://codereview.chromium.org//14273015
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21839 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-22 21:15:54 +00:00
regis@google.com
d79c7c1969
Implement long jump in ARM and MIPS simulators.
...
Implement error and exception handler stubs on ARM.
Hook up simulator for object tests.
Enable codegen and object tests on ARM.
Review URL: https://codereview.chromium.org//14309004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21680 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-18 16:23:25 +00:00
zra@google.com
c4b55c1276
Third codegen test passing for simulated MIPS.
...
Review URL: https://codereview.chromium.org//13407003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20794 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-02 16:40:14 +00:00
zra@google.com
35aeebcd8c
First two codegen tests passing on SIMMIPS
...
Review URL: https://codereview.chromium.org//13228002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20734 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-01 17:02:44 +00:00
regis@google.com
a879bba2ff
Second codegen test passing on ARM (simulated).
...
This required support on ARM for:
- compilation of static calls
- patching of static calls
- stub to call into runtime
- redirection support for calls from simulator to host runtime
- stack frame iteration
Review URL: https://codereview.chromium.org//12381034
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19405 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-04 18:08:38 +00:00
regis@google.com
3b374ead4b
Compile and simulate first dart function on arm generated from ast.
...
Review URL: https://codereview.chromium.org//12335102
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19152 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 17:13:51 +00:00
regis@google.com
163db76189
Hook up simulator (if needed) when calling Dart code.
...
Merge identical InvokeDynamic and InvokeStatic to InvokeFunction.
Remove redundant argument from InvokeClosure.
Review URL: https://codereview.chromium.org//12315087
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18994 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 19:30:29 +00:00
asiva@google.com
f4fe42c280
Added macros OBJECT_IMPLEMENTATION and FINAL_OBJECT_IMPLEMENTATION
...
which have different implementations of 'operator=' and 'operator^='.
In the case of FINAL_OBJECT_IMPLEMENTATION we do not do the vtable setting
in these methods (Note the |= operator functionality is now subsumed into
the new implementation of "operator^=")
Review URL: https://codereview.chromium.org//12052033
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17491 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-23 20:01:31 +00:00
srdjan@google.com
d1c4735609
Transition ^= to |=
...
Review URL: https://codereview.chromium.org//11867022
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17309 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 19:53:17 +00:00
asiva@google.com
4c069867e4
- Make Boolean 'true' and 'false' singleton VM isolate objects.
...
- Change all uses of it
Review URL: https://codereview.chromium.org//11745022
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16623 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-04 01:52:05 +00:00
asiva@google.com
7ea520f10f
Create read only handles for empty_array and sentinel objects
...
(trying out a basic framework and will extend it to others once this
works).
Review URL: https://codereview.chromium.org//11648006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16416 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-21 02:33:05 +00:00
asiva@google.com
2c6de68680
Changed the API in DartEntry for invoking dart code from C++ to make it more compatible with the requirements of the runtime.
...
Deleted all the code duplication that was added to circumvent the old DartEntry API requirements.
Review URL: https://codereview.chromium.org//11613009
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16288 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-18 21:36:01 +00:00
regis@google.com
dd6a0ec349
Rename GET_NATIVE_ARGUMENT macro to GET_NON_NULL_NATIVE_ARGUMENT.
...
Introduce new GET_NATIVE_ARGUMENT macro accepting null.
Add test.
Review URL: https://codereview.chromium.org//11468016
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15919 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-10 17:59:40 +00:00
regis@google.com
d372a816bb
Pass closure object as first implicit argument to closure functions.
...
Remove code passing captured receiver to native instance closures; instead,
access captured receiver in context, as non-native functions do.
Review URL: https://codereview.chromium.org//11360116
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14698 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-08 18:28:07 +00:00
hausner@google.com
384115d235
Remove built-in identifier 'negate' from VM
...
Keep the token kNEGATE for the backend to distinguish between
unary and binary - operator.
Review URL: https://codereview.chromium.org//11199002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13700 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-16 20:19:06 +00:00
hausner@google.com
201bce4219
Support for show/hide combinators
...
- Add a new VM object called a Namespace.
- A Namespace is a library, and two list of names to hide/show.
- Convert Library and LibraryPrefix to contain Namespace
objects instead of Libraries in their import list.
Review URL: https://codereview.chromium.org//10967052
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12804 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 20:46:56 +00:00
asiva@google.com
4140ed9d5b
Fix for issue 5223 : Import 'dart:core' implicitly only if it has not been
...
already explicitly imported in the script.
Review URL: https://codereview.chromium.org//10949028
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12673 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 00:43:08 +00:00
regis@google.com
e860f819a0
Limit the maximum number of formal parameters (32K fixed and 32K optional)
...
in order to save space in function objects.
Naming cleanup.
Review URL: https://codereview.chromium.org//10928160
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12288 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 23:35:05 +00:00
regis@google.com
7cc84c2892
Implement new optional parameters syntax in the vm (issue 4290).
...
Provide --reject_named_argument_as_positional flag to ease transition to new
syntax (default is false).
Add tests.
Review URL: https://chromiumcodereview.appspot.com//10910119
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12004 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 01:13:27 +00:00
turnidge@google.com
14f614da12
Use the return value of vm native methods to set the return value,
...
based on Siva's earlier suggestion (he actually suggested putting it
in the generated stub, which I haven't done).
Added SetReturnUnsafe and use it exactly one place so far.
Review URL: https://chromiumcodereview.appspot.com//10874072
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11633 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 17:41:19 +00:00
regis@google.com
bf7540da98
Store pointer instead of reference to LocalVariable in ast and flow graph.
...
Address comments of already committed r10203.
Review URL: https://chromiumcodereview.appspot.com//10832126
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10321 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 23:17:04 +00:00
asiva@google.com
ec7f44f025
Create frequently used symbols in the vm isolate
...
- Avoids the need for doing a NewSymbol on these everytime
- saves space as they get shared by isolates
Review URL: https://chromiumcodereview.appspot.com//10783035
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9834 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-24 00:01:50 +00:00
asiva@google.com
ef67b96777
Rename some of the enum definitions inside classes to avoid conflict with the ObjectKind enum.
...
Review URL: https://chromiumcodereview.appspot.com//10808064
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9792 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-20 22:24:49 +00:00
cshapiro@google.com
e964989681
Ensure objects emitted in code are allocated in old space.
...
BUG=3866
Review URL: https://chromiumcodereview.appspot.com//10786003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9649 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-13 23:23:45 +00:00
asiva@google.com
73bfbc5da4
Allow implicit 'close your eyes' of native methods. This will hopefully fix issue 3466.
...
- when resolving the native method which has been closurized account for the 'this' argument in the count of arguments.
- explicitly copy the 'this' parameter in the closure context as the first parameter before calling the native function. This is done by piggy backing on the CopyParameters code used for functions with optional parameters.
Review URL: https://chromiumcodereview.appspot.com//10535180
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8816 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-18 19:56:06 +00:00
hausner@google.com
6ddf54511d
Replace linked list of loaded libraries
...
Replace the linked list of loaded libraries with a growable array
or libraries in the object store. This array will be used in the
debugger, where we use the index of a library in the array as an
id number, similarly to the class id and the table of loaded classes.
Review URL: https://chromiumcodereview.appspot.com//10414084
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7923 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-23 20:28:21 +00:00
srdjan@google.com
54f73f0365
Remove TuckTemp, PickTemp, use temporary locals instead.
...
Review URL: https://chromiumcodereview.appspot.com//10310132
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7624 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-14 20:01:35 +00:00
regis@google.com
113c4b6626
Add missing calls to class finalizer in various tests.
...
Make 'sentinel' and 'transition_sentinel' instances of class Null.
Review URL: https://chromiumcodereview.appspot.com//10034019
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6421 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-11 18:12:28 +00:00