Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  WasmBCClass-inl.h   Sprache: C

 
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: set ts=8 sts=2 et sw=2 tw=80:
 *
 * Copyright 2016 Mozilla Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


// This is an INTERNAL header for Wasm baseline compiler: inline BaseCompiler
// methods that don't fit in any other group in particular.

#ifndef wasm_wasm_baseline_object_inl_h
#define wasm_wasm_baseline_object_inl_h

namespace js {
namespace wasm {

const FuncType& BaseCompiler::funcType() const {
  return codeMeta_.getFuncType(func_.index);
}

bool BaseCompiler::usesMemory() const {
  return codeMeta_.memories.length() > 0;
}

bool BaseCompiler::usesSharedMemory(uint32_t memoryIndex) const {
  return codeMeta_.usesSharedMemory(memoryIndex);
}

const Local& BaseCompiler::localFromSlot(uint32_t slot, MIRType type) {
  MOZ_ASSERT(localInfo_[slot].type == type);
  return localInfo_[slot];
}

BytecodeOffset BaseCompiler::bytecodeOffset() const {
  return iter_.bytecodeOffset();
}

TrapSiteDesc BaseCompiler::trapSiteDesc() const {
  return TrapSiteDesc(bytecodeOffset());
}

bool BaseCompiler::isMem32(uint32_t memoryIndex) const {
  return codeMeta_.memories[memoryIndex].addressType() == AddressType::I32;
}

bool BaseCompiler::isMem64(uint32_t memoryIndex) const {
  return codeMeta_.memories[memoryIndex].addressType() == AddressType::I64;
}

bool BaseCompiler::hugeMemoryEnabled(uint32_t memoryIndex) const {
  return codeMeta_.hugeMemoryEnabled(memoryIndex);
}

uint32_t BaseCompiler::instanceOffsetOfMemoryBase(uint32_t memoryIndex) const {
  if (memoryIndex == 0) {
    return Instance::offsetOfMemory0Base();
  }
  return Instance::offsetInData(
      codeMeta_.offsetOfMemoryInstanceData(memoryIndex) +
      offsetof(MemoryInstanceData, base));
}

uint32_t BaseCompiler::instanceOffsetOfBoundsCheckLimit(
    uint32_t memoryIndex) const {
  if (memoryIndex == 0) {
    return Instance::offsetOfMemory0BoundsCheckLimit();
  }
  return Instance::offsetInData(
      codeMeta_.offsetOfMemoryInstanceData(memoryIndex) +
      offsetof(MemoryInstanceData, boundsCheckLimit));
}

// The results parameter for BaseCompiler::emitCallArgs is used for
// regular Wasm calls.
struct NormalCallResults final {
  const StackResultsLoc& results;
  explicit NormalCallResults(const StackResultsLoc& results)
      : results(results) {}
  inline uint32_t onStackCount() const { return results.count(); }
  inline StackResults stackResults() const { return results.stackResults(); }
  inline void getStackResultArea(BaseStackFrame fr, RegPtr dest) const {
    fr.computeOutgoingStackResultAreaPtr(results, dest);
  }
};

// The results parameter for BaseCompiler::emitCallArgs is used for
// Wasm return/tail calls.
struct TailCallResults final {
  bool hasStackResults;
  explicit TailCallResults(const FuncType& funcType) {
    hasStackResults =
        ABIResultIter::HasStackResults(ResultType::Vector(funcType.results()));
  }
  inline uint32_t onStackCount() const { return 0; }
  inline StackResults stackResults() const {
    return hasStackResults ? StackResults::HasStackResults
                           : StackResults::NoStackResults;
  }
  inline void getStackResultArea(BaseStackFrame fr, RegPtr dest) const {
    fr.loadIncomingStackResultAreaPtr(dest);
  }
};

// The results parameter for BaseCompiler::emitCallArgs is used when
// no result (area) is expected.
struct NoCallResults final {
  inline uint32_t onStackCount() const { return 0; }
  inline StackResults stackResults() const {
    return StackResults::NoStackResults;
  }
  inline void getStackResultArea(BaseStackFrame fr, RegPtr dest) const {
    MOZ_CRASH();
  }
};

}  // namespace wasm
}  // namespace js

#endif  // wasm_wasm_baseline_object_inl_h

Messung V0.5
C=92 H=99 G=95

¤ Dauer der Verarbeitung: 0.25 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge