Flutter Engine
The Flutter Engine
longjump.h
Go to the documentation of this file.
1// Copyright (c) 2019, 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#ifndef RUNTIME_VM_LONGJUMP_H_
6#define RUNTIME_VM_LONGJUMP_H_
7
8#include <setjmp.h>
9
10#include "vm/allocation.h"
11#include "vm/thread_state.h"
12
13namespace dart {
14
15class Error;
16
18 public:
20 : StackResource(thread), top_(nullptr), base_(thread->long_jump_base()) {
22 }
23
26 thread()->set_long_jump_base(base_);
27 }
28
29 jmp_buf* Set();
30 DART_NORETURN void Jump(int value, const Error& error);
31 DART_NORETURN void Jump(int value);
32
33 private:
34 jmp_buf environment_;
35 StackResource* top_;
36 LongJumpScope* base_;
37
38 DISALLOW_COPY_AND_ASSIGN(LongJumpScope);
39};
40
41} // namespace dart
42
43#endif // RUNTIME_VM_LONGJUMP_H_
DART_NORETURN void Jump(int value, const Error &error)
Definition: longjump.cc:22
LongJumpScope(ThreadState *thread=ThreadState::Current())
Definition: longjump.h:19
jmp_buf * Set()
Definition: longjump.cc:16
ThreadState * thread() const
Definition: allocation.h:33
void set_long_jump_base(LongJumpScope *value)
Definition: thread_state.h:48
static ThreadState * Current()
Definition: thread_state.h:27
#define ASSERT(E)
const uint8_t uint32_t uint32_t GError ** error
uint8_t value
Definition: dart_vm.cc:33