tor-browser

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

BytecodeIterator-inl.h (1070B)


      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 vm_BytecodeIterator_inl_h
      8 #define vm_BytecodeIterator_inl_h
      9 
     10 #include "vm/BytecodeIterator.h"
     11 
     12 #include "vm/JSScript.h"
     13 
     14 namespace js {
     15 
     16 inline BytecodeIterator::BytecodeIterator(const JSScript* script)
     17    : current_(script, script->code()) {}
     18 
     19 // AllBytecodesIterable
     20 
     21 inline BytecodeIterator AllBytecodesIterable::begin() {
     22  return BytecodeIterator(script_);
     23 }
     24 
     25 inline BytecodeIterator AllBytecodesIterable::end() {
     26  return BytecodeIterator(BytecodeLocation(script_, script_->codeEnd()));
     27 }
     28 
     29 // BytecodeLocationRange
     30 
     31 inline BytecodeIterator BytecodeLocationRange::begin() {
     32  return BytecodeIterator(beginLoc_);
     33 }
     34 
     35 inline BytecodeIterator BytecodeLocationRange::end() {
     36  return BytecodeIterator(endLoc_);
     37 }
     38 
     39 }  // namespace js
     40 #endif