Commit e8ccd254 authored by Victor Yacovlev's avatar Victor Yacovlev

Improved runtime performace

parent 88e72355
......@@ -29,14 +29,11 @@ typedef std::map<uint32_t, ExternReference> ExternsMap;
// module_id|alg_id -> instructions
typedef std::map<uint32_t, Bytecode::TableElem> FunctionMap;
// module_id|global_id
typedef std::pair<uint8_t,uint16_t> GlobalsIndex;
// module_id|global_id -> global variable
typedef std::map<GlobalsIndex, Variable > GlobalsMap;
typedef std::vector< std::vector< Variable > > GlobalsMap;
// constant_id -> constant value
typedef std::map<uint16_t,Variable> ConstantsMap;
typedef std::vector<Variable> ConstantsMap;
typedef std::vector<Variable> VariantArray;
......
......@@ -382,8 +382,25 @@ public:
inline Char toChar() const { return value().toChar(); }
inline String toString() const;
inline String toString(int indeces[4]) const;
inline const Record toRecord() const { return value().toRecord(); }
inline Record & toRecord() { return value().toRecord(); }
inline const Record toRecord() const {
if (m_reference) {
const Record result = m_reference->toRecord();
return result;
}
else {
return m_value.toRecord();
}
}
inline Record & toRecord() {
if (m_reference) {
Record & result = m_reference->toRecord();
return result;
}
else {
Record & result = m_value.toRecord();
return result;
}
}
inline Variable toReference();
inline static Variable toConstReference(const AnyValue & value);
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment