Add a PLACEHOLDER code kind.
authortitzer <titzer@chromium.org>
Tue, 25 Aug 2015 10:17:26 +0000 (03:17 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 25 Aug 2015 10:17:33 +0000 (10:17 +0000)
The PLACEHOLDER code kind is used when compiling a code object that has
direct calls to other code objects, but those other code objects do not
yet exist because they have not yet been compiled. It serves as a
placeholder to break the cycle, e.g. in WASM.

R=yangguo@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1308393003

Cr-Commit-Position: refs/heads/master@{#30348}

src/log.cc
src/objects.h
src/snapshot/serialize.cc

index 2bf27da..0e932cf 100644 (file)
@@ -1643,6 +1643,10 @@ void Logger::LogCodeObject(Object* object) {
       description = "A keyed store IC from the snapshot";
       tag = Logger::KEYED_STORE_IC_TAG;
       break;
+    case Code::PLACEHOLDER:
+      description = "A placeholder for linking later code";
+      tag = Logger::STUB_TAG;
+      break;
     case Code::NUMBER_OF_KINDS:
       break;
   }
index eafa6c1..f93f521 100644 (file)
@@ -4461,7 +4461,8 @@ class Code: public HeapObject {
   V(STUB)                   \
   V(HANDLER)                \
   V(BUILTIN)                \
-  V(REGEXP)
+  V(REGEXP)                 \
+  V(PLACEHOLDER)
 
 #define IC_KIND_LIST(V) \
   V(LOAD_IC)            \
index 0e67276..9097dba 100644 (file)
@@ -2478,6 +2478,8 @@ void CodeSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,
           SerializeGeneric(code_object, how_to_code, where_to_point);
         }
         return;
+      case Code::PLACEHOLDER:
+        UNREACHABLE();
     }
     UNREACHABLE();
   }