Skip to content

Commit

Permalink
Removed stale code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustaf Sjöberg committed Sep 22, 2016
1 parent 4cdb200 commit d883d8e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 0 additions & 2 deletions c_src/erlang_v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ size_t PacketLength() {
}

bool NextPacket(Packet* packet) {
TRACE("Ready for next!!\n");
size_t len = PacketLength();
uint32_t ref = 0;
uint32_t timeout = 0;
Expand Down Expand Up @@ -91,7 +90,6 @@ bool CommandLoop(VM& vm) {
case OP_EVAL:
FTRACE("Eval in context: %i\n", packet.ref);
vm.Eval(&packet);
TRACE("Evaled!!!\n");
break;
case OP_CALL:
FTRACE("Call in context: %i\n", packet.ref);
Expand Down
13 changes: 6 additions & 7 deletions c_src/vm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ struct TimeoutHandlerArgs {

void* TimeoutHandler(void *arg) {
struct TimeoutHandlerArgs *args = (struct TimeoutHandlerArgs*)arg;
TRACE("Timeout started.\n");
FTRACE("With timeout: %i\n", args->timeout);

FTRACE("Timeout handler started: %i\n", args->timeout);
usleep(args->timeout);
TRACE("After sleep,\n");
TRACE("Timeout expired. Terminating execution.\n");

pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0x00);
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0x00);
Expand Down Expand Up @@ -135,14 +135,13 @@ void VM::Eval(Packet* packet) {
if (result.IsEmpty()) {
assert(try_catch.HasCaught());
if (try_catch.Message().IsEmpty() && try_catch.StackTrace().IsEmpty()) {
TRACE("It's a timeout!\n");
TRACE("Execution timed out.\n");
Local<String> tt = String::NewFromUtf8(isolate, "timeout");
Report(isolate, tt, OP_TIMEOUT);
} else {
TRACE("It's a regular error\n");
TRACE("Regular error\n");
ReportException(isolate, &try_catch);
}
FTRACE("Replacing context: %i\n", packet->ref);
// vm.CreateContext(packet->ref);
} else {
ReportOK(isolate, result);
Expand All @@ -161,7 +160,7 @@ void VM::Call(Packet* packet) {
contexts[packet->ref]);

if (context.IsEmpty()) {
Local<Value> tt = String::NewFromUtf8(isolate, "empty contextz");
Local<Value> tt = String::NewFromUtf8(isolate, "empty context");
Report(isolate, tt, OP_INVALID_CONTEXT);
} else {
Context::Scope context_scope(context);
Expand Down

0 comments on commit d883d8e

Please sign in to comment.