Commit 258e42cd authored by jgruber's avatar jgruber Committed by Commit Bot

[bootstrapper] Reliably set SFI::lazy_deserialization_builtin_id

The lazy deserialization builtin id is usually set when the shared
function info is created in Factory::NewSharedFunctionInfo, which looks
at the given code object to grab the builtin id.

However, this doesn't work when the shared function info is created
after deserialization, as is the case for harmony features that can be
toggled with runtime flags. At this point, lazy builtins have already
been replaced by DeserializeLazy in the builtins table.

To ensure that the lazy deserialization id is correct in this case,
explicitly set it in bootstrapper functions.

Bug: v8:6624, v8:6788
Change-Id: Ia6ac3a4842d2659d5de6d92f378ea221b5508040
Reviewed-on: https://chromium-review.googlesource.com/652477
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47867}
parent 7d890c11
This diff is collapsed.
......@@ -336,6 +336,14 @@ int SharedFunctionInfo::lazy_deserialization_builtin_id() const {
return id;
}
void SharedFunctionInfo::set_lazy_deserialization_builtin_id(int builtin_id) {
DCHECK(function_data()->IsUndefined(GetIsolate()) ||
HasLazyDeserializationBuiltinId());
DCHECK(Builtins::IsBuiltinId(builtin_id));
DCHECK(Builtins::IsLazy(builtin_id));
set_function_data(Smi::FromInt(builtin_id));
}
bool SharedFunctionInfo::HasBuiltinFunctionId() {
return function_identifier()->IsSmi();
}
......
......@@ -167,6 +167,7 @@ class SharedFunctionInfo : public HeapObject {
// mainly used during optimization).
inline bool HasLazyDeserializationBuiltinId() const;
inline int lazy_deserialization_builtin_id() const;
inline void set_lazy_deserialization_builtin_id(int builtin_id);
// [function identifier]: This field holds an additional identifier for the
// function.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment