Remove immstack.cpp

It's dead but I missed it in my previous diff
Esse commit está contido em:
bsimmers
2013-05-31 16:30:29 -07:00
commit de Sara Golemon
commit 8987de3e84
4 arquivos alterados com 0 adições e 177 exclusões
-103
Ver Arquivo
@@ -1,103 +0,0 @@
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
*/
#include "hphp/runtime/vm/jit/immstack.h"
namespace HPHP {
///////////////////////////////////////////////////////////////////////////////
void ImmStack::processOpcode(const Opcode* opcode) {
StackTransInfo sti = instrStackTransInfo(opcode);
if (sti.kind == StackTransInfo::PushPop) {
for (int i = 0; i < sti.numPops; i++) {
pop();
}
for (int i = 0; i < sti.numPushes; i++) {
pushUnknown();
}
} else if (sti.kind == StackTransInfo::InsertMid) {
insUnknown(sti.pos);
} else {
assert(false);
}
}
void ImmStack::pushUnknown() {
StackItem item;
item.type = StackItem::StackType_Unknown;
m_stack.push_back(item);
}
void ImmStack::insUnknown(int pos) {
int k = m_stack.size() - 1 - pos;
if (k >= 0 && k < (int)m_stack.size()) {
StackItem item;
item.type = StackItem::StackType_Unknown;
m_stack.insert(m_stack.begin() + k, item);
}
}
void ImmStack::pop() {
// Since we only process on the basic block level, we obviously can pop
// locations that we don't track. We treat all these locations as unknowns.
if (!m_stack.empty()) {
m_stack.pop_back();
}
}
void ImmStack::pushInt(int64_t value) {
StackItem item;
item.type = StackItem::StackType_Int;
item.i64a = value;
m_stack.push_back(item);
}
void ImmStack::pushLitstr(Id value) {
StackItem item;
item.type = StackItem::StackType_Litstr;
item.sa = value;
m_stack.push_back(item);
}
ImmStack::StackItem &ImmStack::get(int above) {
always_assert(above >= 0 && (size_t)above < m_stack.size());
return m_stack[m_stack.size() - above - 1];
}
bool ImmStack::isInt(int above) {
if (above >= (int)m_stack.size()) {
return false;
}
return get(above).type == StackItem::StackType_Int;
}
bool ImmStack::isLitstr(int above) {
if (above >= (int)m_stack.size()) {
return false;
}
return get(above).type == StackItem::StackType_Litstr;
}
}
-72
Ver Arquivo
@@ -1,72 +0,0 @@
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
*/
#ifndef incl_HPHP_IMMSTACK_H_
#define incl_HPHP_IMMSTACK_H_
#include "hphp/runtime/vm/bytecode.h"
namespace HPHP {
///////////////////////////////////////////////////////////////////////////////
class ImmStack {
private:
struct StackItem {
enum StackType {
StackType_Unknown,
StackType_Int,
StackType_Litstr,
};
StackType type;
union {
int64_t i64a;
Id sa;
};
};
public:
// calls pop(), and pushUnknown() appropriately
void processOpcode(const Opcode* opcode);
void pushUnknown();
void insUnknown(int pos);
void pop();
// By using these methods (instead of the popUknown() above) you signify that
// the instruction most recently added via addInstr() is side-effect free,
// i.e. that if this particular value on the stack is not needed then
// the corresponding opcode can be removed. Thus we also cannot use
// these methods for opcodes which push multiple values on to the stack,
// such as dup.
void pushInt(int64_t value);
void pushLitstr(Id value);
// 0 is the item most recently pushed on to the stack, followed by 1 etc.
bool isInt(int above);
bool isLitstr(Id above);
StackItem &get(int above);
private:
std::vector<StackItem> m_stack;
};
///////////////////////////////////////////////////////////////////////////////
}
#endif
-1
Ver Arquivo
@@ -3228,7 +3228,6 @@ std::unique_ptr<Tracelet> Translator::analyze(SrcKey sk,
TRACE(1, "Translator::analyze %s:%d %s\n", file, lineNum, funcName);
TraceletContext tas(&t, initialTypes);
ImmStack immStack;
int stackFrameOffset = 0;
int oldStackFrameOffset = 0;
-1
Ver Arquivo
@@ -32,7 +32,6 @@
#include "hphp/util/timer.h"
#include "hphp/runtime/base/execution_context.h"
#include "hphp/runtime/vm/bytecode.h"
#include "hphp/runtime/vm/jit/immstack.h"
#include "hphp/runtime/vm/jit/runtime-type.h"
#include "hphp/runtime/vm/jit/fixup.h"
#include "hphp/runtime/vm/jit/writelease.h"