tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Jit.h (1149B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
      2 * vim: set ts=8 sts=2 et sw=2 tw=80:
      3 * This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef jit_Jit_h
      8 #define jit_Jit_h
      9 
     10 #include "jstypes.h"
     11 
     12 struct JS_PUBLIC_API JSContext;
     13 
     14 namespace js {
     15 
     16 class RunState;
     17 
     18 namespace jit {
     19 
     20 enum class EnterJitStatus {
     21  // An error occurred, either before we entered JIT code or the script threw
     22  // an exception. Usually the context will have a pending exception, except
     23  // for uncatchable exceptions (interrupts).
     24  Error,
     25 
     26  // Entered and returned from JIT code.
     27  Ok,
     28 
     29  // We didn't enter JIT code, for instance because the script still has to
     30  // warm up or cannot be compiled.
     31  NotEntered,
     32 };
     33 
     34 extern bool EnterInterpreterEntryTrampoline(uint8_t* code, JSContext* cx,
     35                                            RunState* state);
     36 extern EnterJitStatus MaybeEnterJit(JSContext* cx, RunState& state);
     37 
     38 }  // namespace jit
     39 }  // namespace js
     40 
     41 #endif /* jit_Jit_h */