Commit Graph

206 Commits

Author SHA1 Message Date
asiva@google.com f5b0f9beae Remove deprecated call Dart_Error from the API. There are no uses of it.
R=turnidge@google.com

Review URL: https://codereview.chromium.org//26751005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28944 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-21 19:53:31 +00:00
asiva@google.com 1a2f236fab Fix issue 13942 - Dart_Error function invokes OS::VSNPrint with the "format" string containing data derived from the string
R=iposva@google.com

Review URL: https://codereview.chromium.org//27694005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28809 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-17 17:49:45 +00:00
asiva@google.com 21cefcd726 Add a new method Dart_InvokeConstructor to allow invocation of generative
constructors on an object that has already been allocated using Dart_Allocate.

R=regis@google.com

Review URL: https://codereview.chromium.org//25675009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28276 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-04 20:00:48 +00:00
asiva@google.com 1cd2ad79ec Fix for 12312 (Dartium crash when reloading after running tests).
Add framework for Dart_Cleanup which will cleanup stuff on exit.
Ideally the VM isolate should be shutdown in Dart_Terminate but we don't
seem to have a clean thread pool shutdown as a result of which there are
racing isolates.

R=iposva@google.com

Review URL: https://codereview.chromium.org//25674009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28248 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-03 22:17:48 +00:00
asiva@google.com f4aaf704f0 Change type of Dart_PersistentHandle to be the same as Dart_Handle so that
persistent handles can be passed to regular API methods without having
to do a Dart_NewHandleFromPersistent first.

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

Review URL: https://codereview.chromium.org//24323008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28033 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-28 00:15:06 +00:00
asiva@google.com 292d8c9c21 Fix 13594.
R=iposva@google.com

Review URL: https://codereview.chromium.org//24785002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28017 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-27 16:55:20 +00:00
asiva@google.com 928894a58c - Added Dart_GetNativeIsolateData so that the bindings code can access the IsolateCurrentData
where possible without having to invoke Isolate::Current()
- Modified lookupWrapper to accept DartDOMData as a parameter so that the return to Dart functions
  won't invoke Isolate::Current()

Some Dromaeo numbers before this change:
CONSOLE MESSAGE: RESULT: Dromaeo-drt dartium-dart dom-attr getAttribute runs-per-second 1162.2
CONSOLE MESSAGE: RESULT: Dromaeo-drt dartium-dart dom-attr element_property_access runs-per-second 1255.6

after this change:
CONSOLE MESSAGE: RESULT: Dromaeo-drt dartium-dart dom-attr getAttribute runs-per-second 1237.6
CONSOLE MESSAGE: RESULT: Dromaeo-drt dartium-dart dom-attr element_property_access runs-per-second 1385.4

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

Review URL: https://codereview.chromium.org//24376005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27789 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-23 23:53:39 +00:00
rmacnak@google.com c9eabbcb56 Make Dart_IdentityEqual live up to its sepc and not leak boxing implementation detail. (Reland r27542.)
R=asiva@google.com

Review URL: https://codereview.chromium.org//24254004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27774 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-23 16:23:06 +00:00
rmacnak@google.com 0d6cfb77bd Remove Dart_[Qualified]ClassName.
Review URL: https://codereview.chromium.org//24252014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27724 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-20 21:17:19 +00:00
rmacnak@google.com 89d5616468 Never return a Dart_Handle on a dart::Class from the embedding API.
R=asiva@google.com

Review URL: https://codereview.chromium.org//24210003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27715 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-20 18:29:56 +00:00
jacobr@google.com cac607707a Make Dart_ScriptGetTokenInfo account for line_offset() and col_offset()
Cleanup bugs in wrapExpressionAsClosure Fix bug in how setters were handled and filter out 'this' from local variables list.

BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//23526056

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27581 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-17 20:52:22 +00:00
ricow@google.com fab06df0eb Revert revision 27542 "Make Dart_IdentityEqual live up to its spec and not leak boxing implementation detail."
This is causing checked mode failures on all vm bots.

Review URL: https://codereview.chromium.org//23587024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27545 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-17 06:29:47 +00:00
rmacnak@google.com 8ed7a0367f Make Dart_IdentityEqual live up to its spec and not leak boxing implementation detail.
R=asiva@google.com

Review URL: https://codereview.chromium.org//23464073

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27542 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-17 01:30:30 +00:00
rmacnak@google.com c7460aff0f Add Dart_QualifiedClassName.
R=asiva@google.com

Review URL: https://codereview.chromium.org//23851038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27539 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-17 00:06:28 +00:00
jacobr@google.com d9f7cc5099 Add "function" as an argument to Dart_ActivationFrameInfo
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//23609032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27440 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-12 17:45:42 +00:00
mlippautz@google.com 94502c10ea Checks CObject lengths in native API.
Also converts the API to use intptr_t instead of a mixture of int64_t and int. Internally all variable length objects have lengths and maximum values represented as intptr_t (actually Smi ranges). In order to check for these maximum lengths we need to have a common type for 32 and 64 bit platforms.

Helping constructs like IOBuffer can still use 64bit lengths, but have to check that there values are actually in the domain of intptr_t as soon as internal objects are created.

Addresses issue 4314.

BUG=
R=asiva@google.com, sgjesse@google.com

Review URL: https://codereview.chromium.org//23532048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27395 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-11 16:56:12 +00:00
hausner@google.com f82de66060 Evaluation of expression in context of library top-level
Third and final part of expression evaluation in the context
of an (object|class|library).

R=iposva@google.com

Review URL: https://codereview.chromium.org//23514020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26898 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-29 23:24:23 +00:00
hausner@google.com 2642b1e522 Evaluate expression in the context of a class
Allows debugger to evaluate an expression in the context of a
static method of a class.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//23102019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26617 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-23 22:42:41 +00:00
asiva@google.com 848291cea7 - Setup a peer for read only strings that are not externalized in
Dart_MakeExternalString so that it is not necessary to create
a new reference for it everytime it is accessed in native code.

- Removed unused function Dart_ExternalStringGetPeer

R=iposva@google.com

Review URL: https://codereview.chromium.org//22980022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26538 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-22 17:10:37 +00:00
asiva@google.com 543d80f5f8 Fix signature of Dart_SetIntegerReturnValue.
R=vsm@google.com

Review URL: https://codereview.chromium.org//22897020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26487 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-21 23:45:02 +00:00
asiva@google.com 497152cc26 Added Dart API methods:
Dart_GetNativeIntegerArgument
Dart_GetNativeDoubleArgument
Dart_GetNativeBooleanArgument

R=srdjan@google.com

Review URL: https://codereview.chromium.org//23300004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26485 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-21 23:20:30 +00:00
hausner@google.com d62ea57f8e Evaluate expression in context of an object
This is the core functionality needed for the debugger.

Review URL: https://codereview.chromium.org//23067006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26328 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-19 22:17:09 +00:00
asiva@google.com 4b2c10ae32 Added following dart API changes to enable more efficient access based
on the dartium usage pattern:
- Dart_GetNativeStringArgument (gets a String object, peer etc. directly from
  the native arguments)
- Dart_SetWeakHandleReturnValue (allows a weak handle to be passed to the
  return value, this ensures a new local handle does not have to be created
  from a weak handle just to return a value)
- Dart_StringGetProperties (gets some common properties of a string, avoids
  multiple API calls to set up a native string)

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

Review URL: https://codereview.chromium.org//22632010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26046 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-13 01:19:25 +00:00
asiva@google.com 17c19b0033 Add Dart_GetNativeReceiver to special case access to the native field
of a receiver argument (helps eliminate number of validity checks).

R=srdjan@google.com

Review URL: https://codereview.chromium.org//21986002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25750 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-02 22:47:26 +00:00
rmacnak@google.com e37a1b46a7 Remove unused functions from dart_mirrors_api.
R=asiva@google.com

Review URL: https://codereview.chromium.org//21623004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25749 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-02 22:28:10 +00:00
asiva@google.com 2c5c1fb855 - Add following additional methods to the API to make returning values
from Dartium easier:
   Dart_SetBooleanReturnValue
   Dart_SetIntegerReturnValue
   Dart_SetDoubleReturnValue

- Use Isolate value stored in NativeArguments instead of calling
  Isolate::Current

R=srdjan@google.com

Review URL: https://codereview.chromium.org//21319002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25676 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-31 18:05:05 +00:00
asiva@google.com eb88e500d2 Add a new Dart API call Dart_GetNativeFieldOfArgument
which combines Dart_GetNativeArgument and Dart_GetNativeInstanceField

Dartium always gets the receiver by first getting the NativeArgument
corresponding to 0 using Dart_GetNativeArgument and then invokes
Dart_GetNativeInstanceField on the returned handle to get the native
field corresponding to the native DOM element.

When Dartium is changed to use this combined API call the numbers for a
sample Dromaeo-drt benchmark is as follows:

Dromaeo-drt getAttribute runs-per-second 653.0
Dromaeo-drt element_property_access runs-per-second 579.0
Dromaeo-drt setAttribute runs-per-second 396.0
Dromaeo-drt element_property_assignment runs-per-second 539.0

When the old API calls are used:
Dromaeo-drt getAttribute runs-per-second 596.0
Dromaeo-drt element_property_access runs-per-second 528.0
Dromaeo-drt setAttribute runs-per-second 385.0
Dromaeo-drt element_property_assignment runs-per-second 513.49

R=srdjan@google.com

Review URL: https://codereview.chromium.org//19563005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25354 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-23 18:57:05 +00:00
asiva@google.com 417a55d314 Allow type objects to be passed in to Dart_GetStaticFields
(This is in sync with the change to have the entire Dart API surface
accept type objects instead of exposing the class objects).

R=jacobr@google.com

Review URL: https://codereview.chromium.org//19713002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25137 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-18 00:28:03 +00:00
johnmccutchan@google.com 4aeef86a3d Call shutdown callback before the isolate is destroyed
R=asiva@google.com

Review URL: https://codereview.chromium.org//18862004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24844 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-09 14:59:01 +00:00
asiva@google.com 5f0c327096 Add Dart_GetSupertype to the dart debugger API so that the dartium
debugger interface can use this instead of Dart_GetSuperClass.

R=regis@google.com

Review URL: https://codereview.chromium.org//18238003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24648 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-01 19:46:42 +00:00
asiva@google.com 106b0847fd Fix for issue 11262.
- Add Dart_InstanceGetType
- Wire Dart_New, Dart_Invoke and Dart_[G|S]etField to use types

R=regis@google.com, vsm@google.com

Review URL: https://codereview.chromium.org//17390008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24195 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-19 18:20:55 +00:00
vsm@google.com 9ddec8e9a1 Add Dart_Allocate to the C++ API
This change allows us to allocate Dart objects from C++ without
invoking a constructor.  In turn, it allows us to declare Dartium DOM
types with no public generative constructor.

Note, the current constructor has to be public as dart:html Element is
subclassed by dart:svg SvgElement (and eventually by user defined
custom elements as well).  This leads to unfortunate holes such as: https://code.google.com/p/dart/issues/detail?id=11277

This should also give a modest boost in DOM perf as the existing
constructor does absolutely nothing.

BUG=11277
R=asiva@google.com

Review URL: https://codereview.chromium.org//16968006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24189 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-19 15:48:23 +00:00
asiva@google.com a01261ef7b Fix for issue 11262.
Provide support for types in the Dart API.

R=regis@google.com

Review URL: https://codereview.chromium.org//17346002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24154 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-18 17:47:15 +00:00
asiva@google.com 51651ee00b Split dart_api.h into multiple parts:
dart_api.h - Has the core API functions
dart_mirrors_api.h - Has API functions to support Mirrors or reflection
dart_native_api.h - Has parts which support the native message handling,
                    profilling and other internal tools

R=sgjesse@google.com, vsm@google.com

Review URL: https://codereview.chromium.org//16973003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24062 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 23:47:40 +00:00
hausner@google.com 0374dc9b12 Reified metadata in the VM
R=asiva@google.com

Review URL: https://codereview.chromium.org//16780008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23912 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-12 15:44:57 +00:00
iposva@google.com 4873540718 - Define bool on Windows when not compiling C++.
Review URL: https://codereview.chromium.org//15907020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23497 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 22:18:29 +00:00
iposva@google.com 1836035266 - Modify dart_api.h to be a proper C API.
- Verify that dart_api.h can be used from C
  by changing the test_extension to be a pure C file.

R=asiva@google.com

Review URL: https://codereview.chromium.org//15689013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23476 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 16:36:27 +00:00
iposva@google.com b60d09b1fb - Add different types for persistent and weak persistent handles
in the Dart C API.
- Adapt code in the runtime.

R=asiva@google.com

Review URL: https://codereview.chromium.org//15772005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23421 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-30 15:55:59 +00:00
whesse@google.com fb8471244f dart:io | Add FileSystemEntity.stat() and FileStat class.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//15018011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22685 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-14 16:26:13 +00:00
asiva@google.com ea5a3919c5 Resubmit 22380 after fixing the windows build.
R=hausner@google.com

Review URL: https://codereview.chromium.org//14645025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22396 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-03 22:50:26 +00:00
asiva@google.com dab8758e7a Revert 22380 to investigate windows build break.
Review URL: https://codereview.chromium.org//14927003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22382 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-03 18:26:34 +00:00
asiva@google.com 27e78fb6f8 Second step towards loading core library scripts directly from the sources
- Modify the library source generator to generate a source mapping array
  The generated array is of the following format:
  const char* dart::Bootstrap::corelib_source_paths_[] = {
    "dart:core", "/workspace1/dart-all/dart/sdk/lib/core/core.dart", 

    "bool.dart", "/workspace1/dart-all/dart/sdk/lib/core/bool.dart", 
    ...
    ...
  };

- Read the source file using the source mapping array instead of relying on
  a generated buffer containing the sources

- Modify the gyp files to ensure that all libraries are read directly
  from the sources. This CL does not change the patch part yet.
  Remove the source concatentation step in the gypi files for all the core
  libraries.

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

Review URL: https://codereview.chromium.org//14786012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22380 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-03 18:12:24 +00:00
ager@google.com 431954b584 Rename dart:typeddata to dart:typed_data.
R=asiva@google.com, floitsch@google.com, srdjan@google.com
BUG=

Review URL: https://codereview.chromium.org//14426006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21871 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-23 11:54:54 +00:00
srdjan@google.com 9b53a42536 Add flag --check-function-fingerprints, it checks all function fingerprints of the intrinsifier and method recognizer. Added flag to a test so that the fingerprints will be tested during a regular test.
Review URL: https://codereview.chromium.org//14247005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21711 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-18 23:18:13 +00:00
hausner@google.com df5c543b6f Add library id, location info to breakpointResolved event
Review URL: https://codereview.chromium.org//13940008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21592 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-16 23:24:21 +00:00
hausner@google.com 89949d455b Deprecate old debugger breakpoint handler
- Add new breakpoint handler callback that does not take a
  stack trace
- Remove deprecated handler from debugger core
- Adjust tests
- Old breakpoint handler support remain in code until Dartium
  switches to new handler.

Review URL: https://codereview.chromium.org//14298002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21569 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-16 19:42:39 +00:00
ager@google.com 56cca9e81e Support Float32x4List in the embedding API.
This allows Dartium to use Float32x4List arguments to the webgl
uniform4fv methods.

R=asiva@google.com, iposva@google.com, johnmccutchan@google.com
BUG=

Review URL: https://codereview.chromium.org//14018018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21496 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 18:58:36 +00:00
sgjesse@google.com 83bd0f1aa9 Add support for even more typed data on native ports
The only types missing now are: Float32x4, Float32x4List and
Uint32x4 (currently no Uint32x4List).

R=ager@google.com
BUG=

Review URL: https://codereview.chromium.org//13998008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21455 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 14:19:46 +00:00
sgjesse@google.com 6507357ca0 Add support for more typed data types on native ports
Renamed the kUint8Array type for a Dart_CObject structure to
kByteArray to support all typed data types. The specific type is
stored in a separate type field. No matter what the specific type is,
the length of the byte array is always in bytes.

R=ager@google.com
BUG=

Review URL: https://codereview.chromium.org//14142008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21423 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 09:01:56 +00:00
hausner@google.com 268bdbc85f More cleanups in debugger API and wire protocol
Review URL: https://codereview.chromium.org//13975018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21392 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-12 21:49:24 +00:00