]> gitweb.factorcode.org Git - factor.git/commitdiff
VM: code_block::optimized_p() method isn't needed
authorBjörn Lindqvist <bjourne@gmail.com>
Mon, 31 Oct 2016 13:18:15 +0000 (14:18 +0100)
committerBjörn Lindqvist <bjourne@gmail.com>
Mon, 31 Oct 2016 13:18:39 +0000 (14:18 +0100)
vm/code_blocks.cpp
vm/code_blocks.hpp
vm/words.cpp

index 309b2967efe2cc0def5bc4c4380f792c49ac54f6..d9d774f9f961e1bca3a093d48a2f43c054e0bf11 100644 (file)
@@ -38,7 +38,7 @@ static cell compute_here_address(cell arg, cell offset, code_block* compiled) {
 }
 
 cell code_block::owner_quot() const {
-  if (!optimized_p() && TAG(owner) == WORD_TYPE)
+  if (type() != CODE_BLOCK_OPTIMIZED && TAG(owner) == WORD_TYPE)
     return untag<word>(owner)->def;
   return owner;
 }
index e1fb735191b9d53757141134603775092f4abc2f..09b0dc4a47806eb48694ec5c6bb775cb6a5056b8 100644 (file)
@@ -27,8 +27,6 @@ struct code_block {
 
   bool pic_p() const { return type() == CODE_BLOCK_PIC; }
 
-  bool optimized_p() const { return type() == CODE_BLOCK_OPTIMIZED; }
-
   cell size() const {
     cell size;
     if (free_p())
index ad87dfe96e59e93a91768458a7ff707722ec052c..cce37446ed5ce91926388172a2eb9480560aec83 100644 (file)
@@ -67,7 +67,8 @@ void factor_vm::primitive_word_code() {
 
 void factor_vm::primitive_word_optimized_p() {
   word* w = untag_check<word>(ctx->peek());
-  ctx->replace(tag_boolean(w->code()->optimized_p()));
+  cell t = w->code()->type();
+  ctx->replace(tag_boolean(t == CODE_BLOCK_OPTIMIZED));
 }
 
 // Allocates memory