Commit c55edb44 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[turbofan] Extend and streamline serialization.

- Trigger serialization for more objects, such as some root maps.
- Serialize more data for certain object kinds.
- Add macros for convenience.
- Mark a few functions as const.

R=jarin@chromium.org
Bug: v8:7790

Change-Id: Id39b97e93728c0b3d87d9546bdf68abd04496c05
Reviewed-on: https://chromium-review.googlesource.com/1158572Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54923}
parent 3b3f2bbd
This diff is collapsed.
......@@ -157,7 +157,7 @@ class JSObjectRef : public HeapObjectRef {
FixedArrayBaseRef elements() const;
void EnsureElementsTenured();
ElementsKind GetElementsKind();
ElementsKind GetElementsKind() const;
};
struct SlackTrackingResult {
......@@ -359,7 +359,7 @@ class SharedFunctionInfoRef : public HeapObjectRef {
bool has_duplicate_parameters() const;
int function_map_index() const;
FunctionKind kind() const;
LanguageMode language_mode();
LanguageMode language_mode() const;
bool native() const;
bool HasBreakInfo() const;
bool HasBuiltinId() const;
......
......@@ -28,10 +28,14 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) {
ObjectRef(broker(), HeapConstantOf(node->op()));
break;
}
case IrOpcode::kJSCreateFunctionContext: {
CreateFunctionContextParameters const& p =
CreateFunctionContextParametersOf(node->op());
ScopeInfoRef(broker(), p.scope_info());
case IrOpcode::kJSCreateArray: {
CreateArrayParameters const& p = CreateArrayParametersOf(node->op());
Handle<AllocationSite> site;
if (p.site().ToHandle(&site)) AllocationSiteRef(broker(), site);
break;
}
case IrOpcode::kJSCreateCatchContext: {
ScopeInfoRef(broker(), ScopeInfoOf(node->op()));
break;
}
case IrOpcode::kJSCreateClosure: {
......@@ -41,6 +45,12 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) {
HeapObjectRef(broker(), p.code());
break;
}
case IrOpcode::kJSCreateFunctionContext: {
CreateFunctionContextParameters const& p =
CreateFunctionContextParametersOf(node->op());
ScopeInfoRef(broker(), p.scope_info());
break;
}
case IrOpcode::kJSLoadNamed:
case IrOpcode::kJSStoreNamed: {
NamedAccess const& p = NamedAccessOf(node->op());
......
......@@ -445,8 +445,7 @@ void FixedTypedArray<Traits>::FixedTypedArrayVerify(Isolate* isolate) {
}
}
bool JSObject::ElementsAreSafeToExamine() {
bool JSObject::ElementsAreSafeToExamine() const {
// If a GC was caused while constructing this object, the elements
// pointer may point to a one pointer filler map.
return reinterpret_cast<Map*>(elements()) !=
......
......@@ -2547,7 +2547,7 @@ SMI_ACCESSORS(JSMessageObject, start_position, kStartPositionOffset)
SMI_ACCESSORS(JSMessageObject, end_position, kEndPositionOffset)
SMI_ACCESSORS(JSMessageObject, error_level, kErrorLevelOffset)
ElementsKind JSObject::GetElementsKind() {
ElementsKind JSObject::GetElementsKind() const {
ElementsKind kind = map()->elements_kind();
#if VERIFY_HEAP && DEBUG
FixedArrayBase* fixed_array =
......
......@@ -2265,7 +2265,7 @@ class JSObject: public JSReceiver {
static inline void SetMapAndElements(Handle<JSObject> object,
Handle<Map> map,
Handle<FixedArrayBase> elements);
inline ElementsKind GetElementsKind();
inline ElementsKind GetElementsKind() const;
ElementsAccessor* GetElementsAccessor();
// Returns true if an object has elements of PACKED_SMI_ELEMENTS or
// HOLEY_SMI_ELEMENTS ElementsKind.
......@@ -2655,7 +2655,7 @@ class JSObject: public JSReceiver {
// If a GC was caused while constructing this object, the elements pointer
// may point to a one pointer filler map. The object won't be rooted, but
// our heap verification code could stumble across it.
bool ElementsAreSafeToExamine();
bool ElementsAreSafeToExamine() const;
#endif
Object* SlowReverseLookup(Object* value);
......
......@@ -188,7 +188,7 @@ BailoutReason SharedFunctionInfo::disable_optimization_reason() const {
return DisabledOptimizationReasonBits::decode(flags());
}
LanguageMode SharedFunctionInfo::language_mode() {
LanguageMode SharedFunctionInfo::language_mode() const {
STATIC_ASSERT(LanguageModeSize == 2);
return construct_language_mode(IsStrictBit::decode(flags()));
}
......
......@@ -415,7 +415,7 @@ class SharedFunctionInfo : public HeapObject, public NeverReadOnlySpaceObject {
DECL_BOOLEAN_ACCESSORS(allows_lazy_compilation)
// Indicates the language mode.
inline LanguageMode language_mode();
inline LanguageMode language_mode() const;
inline void set_language_mode(LanguageMode language_mode);
// Indicates whether the source is implicitly wrapped in a 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