Flutter Engine
The Flutter Engine
Classes | Namespaces | Macros | Functions
dart_api_impl.h File Reference
#include <memory>
#include "vm/allocation.h"
#include "vm/heap/safepoint.h"
#include "vm/native_arguments.h"
#include "vm/object.h"
#include "vm/timeline.h"

Go to the source code of this file.

Classes

class  dart::Api
 
class  dart::Api::Scope
 

Namespaces

namespace  dart
 

Macros

#define CURRENT_FUNC   CanonicalFunction(__FUNCTION__)
 
#define CHECK_ISOLATE_GROUP(isolate_group)
 
#define CHECK_ISOLATE(isolate)
 
#define CHECK_NO_ISOLATE(isolate)
 
#define CHECK_API_SCOPE(thread)
 
#define DARTSCOPE(thread)
 
#define RETURN_TYPE_ERROR(zone, dart_handle, type)
 
#define RETURN_NULL_ERROR(parameter)
 
#define CHECK_NULL(parameter)
 
#define CHECK_LENGTH(length, max_elements)
 
#define API_TIMELINE_DURATION(thread)
 
#define API_TIMELINE_BEGIN_END(thread)
 
#define DECLARE_UNWRAP(Type)    static const Type& Unwrap##Type##Handle(Zone* zone, Dart_Handle object);
 
#define START_NO_CALLBACK_SCOPE(thread)   thread->IncrementNoCallbackScopeDepth()
 
#define END_NO_CALLBACK_SCOPE(thread)
 
#define CHECK_CALLBACK_STATE(thread)
 
#define ASSERT_CALLBACK_STATE(thread)    ASSERT(thread->no_callback_scope_depth() == 0)
 

Functions

const char * dart::CanonicalFunction (const char *func)
 
Isolate * dart::CreateWithinExistingIsolateGroup (IsolateGroup *group, const char *name, char **error)
 

Macro Definition Documentation

◆ API_TIMELINE_BEGIN_END

#define API_TIMELINE_BEGIN_END (   thread)
Value:
do { \
} while (false)

Definition at line 128 of file dart_api_impl.h.

◆ API_TIMELINE_DURATION

#define API_TIMELINE_DURATION (   thread)
Value:
do { \
} while (false)

Definition at line 125 of file dart_api_impl.h.

◆ ASSERT_CALLBACK_STATE

#define ASSERT_CALLBACK_STATE (   thread)     ASSERT(thread->no_callback_scope_depth() == 0)

Definition at line 352 of file dart_api_impl.h.

◆ CHECK_API_SCOPE

#define CHECK_API_SCOPE (   thread)
Value:
do { \
Thread* tmpT = (thread); \
Isolate* tmpI = tmpT == nullptr ? nullptr : tmpT->isolate(); \
CHECK_ISOLATE(tmpI); \
if (tmpT->api_top_scope() == nullptr) { \
FATAL( \
"%s expects to find a current scope. Did you forget to call " \
"Dart_EnterScope?", \
} \
} while (0);
#define CURRENT_FUNC
Definition: dart_api_impl.h:28

Definition at line 64 of file dart_api_impl.h.

◆ CHECK_CALLBACK_STATE

#define CHECK_CALLBACK_STATE (   thread)
Value:
if (thread->no_callback_scope_depth() != 0) { \
return reinterpret_cast<Dart_Handle>(Api::NoCallbacksError()); \
} \
if (thread->is_unwind_in_progress()) { \
return reinterpret_cast<Dart_Handle>(Api::UnwindInProgressError()); \
}
struct _Dart_Handle * Dart_Handle
Definition: dart_api.h:258

Definition at line 344 of file dart_api_impl.h.

◆ CHECK_ISOLATE

#define CHECK_ISOLATE (   isolate)
Value:
do { \
if ((isolate) == nullptr) { \
FATAL( \
"%s expects there to be a current isolate. Did you " \
"forget to call Dart_CreateIsolateGroup or Dart_EnterIsolate?", \
} \
} while (0)

Definition at line 42 of file dart_api_impl.h.

◆ CHECK_ISOLATE_GROUP

#define CHECK_ISOLATE_GROUP (   isolate_group)
Value:
do { \
if ((isolate_group) == nullptr) { \
FATAL( \
"%s expects there to be a current isolate group. Did you " \
"forget to call Dart_CreateIsolateGroup or Dart_EnterIsolate?", \
} \
} while (0)

Definition at line 31 of file dart_api_impl.h.

◆ CHECK_LENGTH

#define CHECK_LENGTH (   length,
  max_elements 
)
Value:
do { \
intptr_t len = (length); \
intptr_t max = (max_elements); \
if (len < 0 || len > max) { \
return Api::NewError( \
"%s expects argument '%s' to be in the range [0..%" Pd "].", \
} \
} while (0)
static float max(float r, float g, float b)
Definition: hsl.cpp:49
size_t length
#define Pd
Definition: globals.h:408

Definition at line 106 of file dart_api_impl.h.

◆ CHECK_NO_ISOLATE

#define CHECK_NO_ISOLATE (   isolate)
Value:
do { \
if ((isolate) != nullptr) { \
FATAL( \
"%s expects there to be no current isolate. Did you " \
"forget to call Dart_ExitIsolate?", \
} \
} while (0)

Definition at line 53 of file dart_api_impl.h.

◆ CHECK_NULL

#define CHECK_NULL (   parameter)
Value:
if (parameter == nullptr) { \
RETURN_NULL_ERROR(parameter); \
}

Definition at line 101 of file dart_api_impl.h.

◆ CURRENT_FUNC

#define CURRENT_FUNC   CanonicalFunction(__FUNCTION__)

Definition at line 28 of file dart_api_impl.h.

◆ DARTSCOPE

#define DARTSCOPE (   thread)
Value:
Thread* T = (thread); \
CHECK_API_SCOPE(T); \
TransitionNativeToVM transition(T); \
HANDLESCOPE(T);
#define T
Definition: precompiler.cc:65

Definition at line 77 of file dart_api_impl.h.

◆ DECLARE_UNWRAP

#define DECLARE_UNWRAP (   Type)     static const Type& Unwrap##Type##Handle(Zone* zone, Dart_Handle object);

Definition at line 155 of file dart_api_impl.h.

◆ END_NO_CALLBACK_SCOPE

#define END_NO_CALLBACK_SCOPE (   thread)
Value:
do { \
thread->DecrementNoCallbackScopeDepth(); \
if (thread->no_callback_scope_depth() == 0) { \
thread->heap()->CheckExternalGC(thread); \
} \
} while (false)

Definition at line 336 of file dart_api_impl.h.

◆ RETURN_NULL_ERROR

#define RETURN_NULL_ERROR (   parameter)
Value:
return Api::NewError("%s expects argument '%s' to be non-null.", \
CURRENT_FUNC, #parameter)

Definition at line 97 of file dart_api_impl.h.

◆ RETURN_TYPE_ERROR

#define RETURN_TYPE_ERROR (   zone,
  dart_handle,
  type 
)
Value:
do { \
const Object& tmp = \
Object::Handle(zone, Api::UnwrapHandle((dart_handle))); \
if (tmp.IsNull()) { \
return Api::NewArgumentError("%s expects argument '%s' to be non-null.", \
CURRENT_FUNC, #dart_handle); \
} else if (tmp.IsError()) { \
return dart_handle; \
} \
return Api::NewArgumentError("%s expects argument '%s' to be of type %s.", \
CURRENT_FUNC, #dart_handle, #type); \
} while (0)
GLenum type

Definition at line 83 of file dart_api_impl.h.

◆ START_NO_CALLBACK_SCOPE

#define START_NO_CALLBACK_SCOPE (   thread)    thread->IncrementNoCallbackScopeDepth()

Definition at line 333 of file dart_api_impl.h.