Flutter Engine
The Flutter Engine
third_party
dart-lang
sdk
runtime
vm
longjump.cc
Go to the documentation of this file.
1
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2
// for details. All rights reserved. Use of this source code is governed by a
3
// BSD-style license that can be found in the LICENSE file.
4
5
#include "
vm/longjump.h
"
6
7
#include "
include/dart_api.h
"
8
9
#include "
vm/dart_api_impl.h
"
10
#include "
vm/isolate.h
"
11
#include "
vm/object.h
"
12
#include "
vm/os.h
"
13
14
namespace
dart
{
15
16
jmp_buf*
LongJumpScope::Set
() {
17
ASSERT
(top_ ==
nullptr
);
18
top_ =
Thread::Current
()->
top_resource
();
19
return
&environment_;
20
}
21
22
void
LongJumpScope::Jump
(
int
value
,
const
Error
&
error
) {
23
ASSERT
(!
error
.IsNull());
24
25
// Remember the error in the sticky error of this isolate.
26
Thread::Current
()->
set_sticky_error
(
error
);
27
28
Jump
(
value
);
29
}
30
31
void
LongJumpScope::Jump
(
int
value
) {
32
// A zero is the default return value from setting up a LongJumpScope
33
// using Set.
34
ASSERT
(
value
!= 0);
35
36
Thread
*
thread
=
Thread::Current
();
37
DEBUG_ASSERT
(
thread
->TopErrorHandlerIsSetJump());
38
39
// Destruct all the active StackResource objects.
40
StackResource::UnwindAbove
(
thread
, top_);
41
longjmp(environment_,
value
);
42
UNREACHABLE
();
43
}
44
45
}
// namespace dart
UNREACHABLE
#define UNREACHABLE()
Definition:
assert.h:248
DEBUG_ASSERT
#define DEBUG_ASSERT(cond)
Definition:
assert.h:321
dart::Error
Definition:
object.h:8049
dart::LongJumpScope::Jump
DART_NORETURN void Jump(int value, const Error &error)
Definition:
longjump.cc:22
dart::LongJumpScope::Set
jmp_buf * Set()
Definition:
longjump.cc:16
dart::StackResource::thread
ThreadState * thread() const
Definition:
allocation.h:33
dart::StackResource::UnwindAbove
static void UnwindAbove(ThreadState *thread, StackResource *new_top)
Definition:
allocation.cc:56
dart::ThreadState::top_resource
StackResource * top_resource() const
Definition:
thread_state.h:41
dart::Thread
Definition:
thread.h:342
dart::Thread::Current
static Thread * Current()
Definition:
thread.h:362
dart::Thread::set_sticky_error
void set_sticky_error(const Error &value)
Definition:
thread.cc:236
dart_api.h
dart_api_impl.h
ASSERT
#define ASSERT(E)
Definition:
entrypoints_verification_test.cc:25
error
const uint8_t uint32_t uint32_t GError ** error
Definition:
fl_pixel_buffer_texture_test.cc:40
value
uint8_t value
Definition:
fl_standard_message_codec.cc:36
isolate.h
longjump.h
dart
Definition:
dart_vm.cc:33
object.h
os.h
Generated on Sun Jun 23 2024 21:55:43 for Flutter Engine by
1.9.4