aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-03-05 17:57:03 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-03-05 17:57:40 -0800
commit7b62a180c6985b59ee7df38d3e7358ba574ad7c8 (patch)
tree9ce0d46e51682d61d306091a1993d3981621216a /lib
parent9bef807b3bfa2397fb24f4f9c4df5a633a9717b3 (diff)
emscripten_debugger() intrinsic
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/JSBackend/CallHandlers.h7
-rw-r--r--lib/Target/JSBackend/JSBackend.cpp8
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/Target/JSBackend/CallHandlers.h b/lib/Target/JSBackend/CallHandlers.h
index bfdd86571c..b8ad71662d 100644
--- a/lib/Target/JSBackend/CallHandlers.h
+++ b/lib/Target/JSBackend/CallHandlers.h
@@ -181,6 +181,12 @@ DEF_CALL_HANDLER(emscripten_get_longjmp_result, {
return getAssign(CI) + "tempRet0";
})
+// emscripten instrinsics
+DEF_CALL_HANDLER(emscripten_debugger, {
+ CanValidate = false;
+ return "debugger";
+})
+
// i64 support
DEF_CALL_HANDLER(getHigh32, {
@@ -744,6 +750,7 @@ void setupCallHandlers() {
SETUP_CALL_HANDLER(emscripten_longjmp);
SETUP_CALL_HANDLER(emscripten_check_longjmp);
SETUP_CALL_HANDLER(emscripten_get_longjmp_result);
+ SETUP_CALL_HANDLER(emscripten_debugger);
SETUP_CALL_HANDLER(getHigh32);
SETUP_CALL_HANDLER(setHigh32);
SETUP_CALL_HANDLER(FtoILow);
diff --git a/lib/Target/JSBackend/JSBackend.cpp b/lib/Target/JSBackend/JSBackend.cpp
index 5efd4c5684..eb3a6d1929 100644
--- a/lib/Target/JSBackend/JSBackend.cpp
+++ b/lib/Target/JSBackend/JSBackend.cpp
@@ -129,6 +129,7 @@ namespace {
std::vector<std::string> Exports; // additional exports
BlockAddressMap BlockAddresses;
+ bool CanValidate;
bool UsesSIMD;
int InvokeState; // cycles between 0, 1 after preInvoke, 2 after call, 0 again after postInvoke. hackish, no argument there.
CodeGenOpt::Level OptLevel;
@@ -139,7 +140,7 @@ namespace {
public:
static char ID;
JSWriter(formatted_raw_ostream &o, CodeGenOpt::Level OptLevel)
- : ModulePass(ID), Out(o), UniqueNum(0), UsesSIMD(false), InvokeState(0),
+ : ModulePass(ID), Out(o), UniqueNum(0), CanValidate(true), UsesSIMD(false), InvokeState(0),
OptLevel(OptLevel) {}
virtual const char *getPassName() const { return "JavaScript backend"; }
@@ -355,6 +356,7 @@ namespace {
assert(VT->getElementType()->getPrimitiveSizeInBits() == 32);
assert(VT->getNumElements() == 4);
UsesSIMD = true;
+ CanValidate = false;
}
std::string getPtrLoad(const Value* Ptr);
@@ -2035,6 +2037,10 @@ void JSWriter::printModuleBody() {
}
Out << "],";
+ Out << "\"canValidate\": ";
+ Out << (CanValidate ? "1" : "0");
+ Out << ",";
+
Out << "\"simd\": ";
Out << (UsesSIMD ? "1" : "0");
Out << ",";