]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/alien.cpp
io.streams.256color: faster by caching styles
[factor.git] / vm / alien.cpp
index 92eb85c0c3ab063428165fed1f6114f03c34da4f..8b6cc81b765b00773931de952ad205479be4087b 100644 (file)
@@ -12,8 +12,7 @@ char* factor_vm::pinned_alien_offset(cell obj) {
         general_error(ERROR_EXPIRED, obj, false_object);
       if (to_boolean(ptr->base))
         type_error(ALIEN_TYPE, obj);
-      else
-        return (char*)ptr->address;
+      return (char*)ptr->address;
     }
     case F_TYPE:
       return NULL;
@@ -32,7 +31,7 @@ cell factor_vm::allot_alien(cell delegate_, cell displacement) {
   data_root<object> delegate(delegate_, this);
   data_root<alien> new_alien(allot<alien>(sizeof(alien)), this);
 
-  if (delegate.type() == ALIEN_TYPE) {
+  if (TAG(delegate_) == ALIEN_TYPE) {
     tagged<alien> delegate_alien = delegate.as<alien>();
     displacement += delegate_alien->displacement;
     new_alien->base = delegate_alien->base;
@@ -99,7 +98,7 @@ EACH_ALIEN_PRIMITIVE(DEFINE_ALIEN_ACCESSOR)
 // Allocates memory
 void factor_vm::primitive_dlopen() {
   data_root<byte_array> path(ctx->pop(), this);
-  path.untag_check(this);
+  check_tagged(path);
   data_root<dll> library(allot<dll>(sizeof(dll)), this);
   library->path = path.value();
   ffi_dlopen(library.untagged());
@@ -111,7 +110,7 @@ void factor_vm::primitive_dlopen() {
 void factor_vm::primitive_dlsym() {
   data_root<object> library(ctx->pop(), this);
   data_root<byte_array> name(ctx->peek(), this);
-  name.untag_check(this);
+  check_tagged(name);
 
   symbol_char* sym = name->data<symbol_char>();
 
@@ -131,7 +130,7 @@ void factor_vm::primitive_dlsym() {
 void factor_vm::primitive_dlsym_raw() {
   data_root<object> library(ctx->pop(), this);
   data_root<byte_array> name(ctx->peek(), this);
-  name.untag_check(this);
+  check_tagged(name);
 
   symbol_char* sym = name->data<symbol_char>();