Flutter Engine
The Flutter Engine
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
14namespace dart {
15
17 ASSERT(top_ == nullptr);
18 top_ = Thread::Current()->top_resource();
19 return &environment_;
20}
21
23 ASSERT(!error.IsNull());
24
25 // Remember the error in the sticky error of this isolate.
27
28 Jump(value);
29}
30
32 // A zero is the default return value from setting up a LongJumpScope
33 // using Set.
34 ASSERT(value != 0);
35
37 DEBUG_ASSERT(thread->TopErrorHandlerIsSetJump());
38
39 // Destruct all the active StackResource objects.
41 longjmp(environment_, value);
43}
44
45} // namespace dart
#define UNREACHABLE()
Definition: assert.h:248
#define DEBUG_ASSERT(cond)
Definition: assert.h:321
DART_NORETURN void Jump(int value, const Error &error)
Definition: longjump.cc:22
jmp_buf * Set()
Definition: longjump.cc:16
ThreadState * thread() const
Definition: allocation.h:33
static void UnwindAbove(ThreadState *thread, StackResource *new_top)
Definition: allocation.cc:56
StackResource * top_resource() const
Definition: thread_state.h:41
static Thread * Current()
Definition: thread.h:362
void set_sticky_error(const Error &value)
Definition: thread.cc:236
#define ASSERT(E)
const uint8_t uint32_t uint32_t GError ** error
uint8_t value
Definition: dart_vm.cc:33