Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1512)

Unified Diff: runtime/vm/dart_entry.h

Issue 9316071: Dart_PropagateError, take 2. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/dart_entry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_entry.h
===================================================================
--- runtime/vm/dart_entry.h (revision 3862)
+++ runtime/vm/dart_entry.h (working copy)
@@ -19,42 +19,37 @@
class Integer;
class Object;
class RawInstance;
+class RawObject;
class String;
// DartEntry abstracts functionality needed to resolve dart functions
// and invoke them from C++.
-//
-// TODO(turnidge): Make these functions assert that there is an active
-// setjmp. Or make these functions do the setjmps themselves and
-// represent compile errors with an explict object type.
-//
-// TODO(turnidge): Make these functions return RawObject instead of
-// RawInstance.
class DartEntry : public AllStatic {
public:
- typedef RawInstance* (*invokestub)(uword entry_point,
- const Array& arguments_descriptor,
- const Object** arguments,
- const Context& context);
+ // On success, returns a RawInstance. On failure, a RawError.
+ typedef RawObject* (*invokestub)(uword entry_point,
+ const Array& arguments_descriptor,
+ const Object** arguments,
+ const Context& context);
- // Invoke the specified instance function on the receiver.
- // Returns object returned by the dart instance function.
- static RawInstance* InvokeDynamic(
+ // Invokes the specified instance function on the receiver.
+ // On success, returns a RawInstance. On failure, a RawError.
+ static RawObject* InvokeDynamic(
const Instance& receiver,
const Function& function,
const GrowableArray<const Object*>& arguments,
const Array& optional_arguments_names);
// Invoke the specified static function.
- // Returns object returned by the dart static function.
- static RawInstance* InvokeStatic(
+ // On success, returns a RawInstance. On failure, a RawError.
+ static RawObject* InvokeStatic(
const Function& function,
const GrowableArray<const Object*>& arguments,
const Array& optional_arguments_names);
// Invoke the specified closure object.
- // Returns object returned by the closure.
- static RawInstance* InvokeClosure(
+ // On success, returns a RawInstance. On failure, a RawError.
+ static RawObject* InvokeClosure(
const Closure& closure,
const GrowableArray<const Object*>& arguments,
const Array& optional_arguments_names);
@@ -65,13 +60,18 @@
// Each may return an exception object.
class DartLibraryCalls : public AllStatic {
public:
- static RawInstance* ExceptionCreate(
+ // On success, returns a RawInstance. On failure, a RawError.
+ static RawObject* ExceptionCreate(
const String& exception_name,
const GrowableArray<const Object*>& arguments);
- static RawInstance* ToString(const Instance& receiver);
- static RawInstance* Equals(const Instance& left, const Instance& right);
- // Returns either an unhandled exception or null.
+ // On success, returns a RawInstance. On failure, a RawError.
+ static RawObject* ToString(const Instance& receiver);
+
+ // On success, returns a RawInstance. On failure, a RawError.
+ static RawObject* Equals(const Instance& left, const Instance& right);
+
+ // Returns null on success, a RawError on failure.
static RawObject* HandleMessage(Dart_Port dest_port_id,
Dart_Port reply_port_id,
const Instance& dart_message);
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/dart_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698