From e4bcc3363f2db15bbc0ba57b91676ce7f1c4adb1 Mon Sep 17 00:00:00 2001 From: titzer Date: Tue, 25 Aug 2015 03:17:26 -0700 Subject: [PATCH] Add a PLACEHOLDER code kind. 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 | 4 ++++ src/objects.h | 3 ++- src/snapshot/serialize.cc | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/log.cc b/src/log.cc index 2bf27da14..0e932cfad 100644 --- a/src/log.cc +++ b/src/log.cc @@ -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; } diff --git a/src/objects.h b/src/objects.h index eafa6c157..f93f52189 100644 --- a/src/objects.h +++ b/src/objects.h @@ -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) \ diff --git a/src/snapshot/serialize.cc b/src/snapshot/serialize.cc index 0e672760b..9097dba2c 100644 --- a/src/snapshot/serialize.cc +++ b/src/snapshot/serialize.cc @@ -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(); } -- 2.34.1