Commit 82516af9 authored by Mythri A's avatar Mythri A Committed by Commit Bot

Reland^2 "[TurboFan] Don't serialize read-only heap objects"

Reland after disabling flaky test-cpu-profiler tests

Reland the cl with fixes to TSAN failures.

This reverts commit 03c9de73.

Original change's description:
> Revert "[TurboFan] Don't serialize read-only heap objects"
>
> This reverts commit 9f18e55f.
>
> Reason for revert: https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20TSAN/29660
>
> Original change's description:
> > [TurboFan] Don't serialize read-only heap objects
> >
> > Read-only heap objects are immutable and immovable. It is safe to access
> > these objects directly from the heap. Not having to serialize them
> > reduces the time we spend on main thread especially for TurboProp.
> >
> > Bug: v8:9684
> > Change-Id: Ibabb7076af50c9007d2a8ed57fe257406958fb6a
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1955596
> > Reviewed-by: Michael Stanton <mvstanton@chromium.org>
> > Reviewed-by: Maya Lekova <mslekova@chromium.org>
> > Commit-Queue: Mythri Alle <mythria@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#65490}
>
> TBR=mvstanton@chromium.org,neis@chromium.org,mythria@chromium.org,mslekova@chromium.org
>
> Change-Id: If2d8649cdc083f7d064684352501320a96a1ba2c
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: v8:9684
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1973732
> Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
> Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#65492}

TBR=mvstanton@chromium.org,neis@chromium.org,mythria@chromium.org,mslekova@chromium.org,nicohartmann@chromium.org


Bug: v8:9684
Change-Id: I71fb438b9387f7fef8b36629bb947335065474f0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1980573Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#65584}
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1981163Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65631}
parent 50a80c93
This diff is collapsed.
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "src/objects/feedback-vector.h" #include "src/objects/feedback-vector.h"
#include "src/objects/function-kind.h" #include "src/objects/function-kind.h"
#include "src/objects/objects.h" #include "src/objects/objects.h"
#include "src/utils/address-map.h"
#include "src/utils/ostreams.h" #include "src/utils/ostreams.h"
#include "src/zone/zone-containers.h" #include "src/zone/zone-containers.h"
...@@ -84,7 +85,7 @@ class V8_EXPORT_PRIVATE JSHeapBroker { ...@@ -84,7 +85,7 @@ class V8_EXPORT_PRIVATE JSHeapBroker {
void InitializeAndStartSerializing(Handle<NativeContext> native_context); void InitializeAndStartSerializing(Handle<NativeContext> native_context);
Isolate* isolate() const { return isolate_; } Isolate* isolate() const { return isolate_; }
Zone* zone() const { return current_zone_; } Zone* zone() const { return zone_; }
bool tracing_enabled() const { return tracing_enabled_; } bool tracing_enabled() const { return tracing_enabled_; }
enum BrokerMode { kDisabled, kSerializing, kSerialized, kRetired }; enum BrokerMode { kDisabled, kSerializing, kSerialized, kRetired };
...@@ -97,8 +98,9 @@ class V8_EXPORT_PRIVATE JSHeapBroker { ...@@ -97,8 +98,9 @@ class V8_EXPORT_PRIVATE JSHeapBroker {
void PrintRefsAnalysis() const; void PrintRefsAnalysis() const;
#endif // DEBUG #endif // DEBUG
// Returns nullptr iff handle unknown. // Retruns the handle from root index table for read only heap objects.
ObjectData* GetData(Handle<Object>) const; Handle<Object> GetRootHandle(Object object);
// Never returns nullptr. // Never returns nullptr.
ObjectData* GetOrCreateData(Handle<Object>); ObjectData* GetOrCreateData(Handle<Object>);
// Like the previous but wraps argument in handle first (for convenience). // Like the previous but wraps argument in handle first (for convenience).
...@@ -193,6 +195,8 @@ class V8_EXPORT_PRIVATE JSHeapBroker { ...@@ -193,6 +195,8 @@ class V8_EXPORT_PRIVATE JSHeapBroker {
void IncrementTracingIndentation(); void IncrementTracingIndentation();
void DecrementTracingIndentation(); void DecrementTracingIndentation();
RootIndexMap const& root_index_map() { return root_index_map_; }
private: private:
friend class HeapObjectRef; friend class HeapObjectRef;
friend class ObjectRef; friend class ObjectRef;
...@@ -221,17 +225,18 @@ class V8_EXPORT_PRIVATE JSHeapBroker { ...@@ -221,17 +225,18 @@ class V8_EXPORT_PRIVATE JSHeapBroker {
ProcessedFeedback const& ReadFeedbackForTemplateObject( ProcessedFeedback const& ReadFeedbackForTemplateObject(
FeedbackSource const& source); FeedbackSource const& source);
void InitializeRefsMap();
void CollectArrayAndObjectPrototypes(); void CollectArrayAndObjectPrototypes();
void SerializeTypedArrayStringTags(); void SerializeTypedArrayStringTags();
PerIsolateCompilerCache* compiler_cache() const { return compiler_cache_; } PerIsolateCompilerCache* compiler_cache() const { return compiler_cache_; }
bool is_builtin_code(Object object);
Isolate* const isolate_; Isolate* const isolate_;
Zone* const broker_zone_; Zone* const zone_ = nullptr;
Zone* current_zone_ = nullptr;
base::Optional<NativeContextRef> target_native_context_; base::Optional<NativeContextRef> target_native_context_;
RefsMap* refs_; RefsMap* refs_;
RootIndexMap root_index_map_;
ZoneUnorderedSet<Handle<JSObject>, Handle<JSObject>::hash, ZoneUnorderedSet<Handle<JSObject>, Handle<JSObject>::hash,
Handle<JSObject>::equal_to> Handle<JSObject>::equal_to>
array_and_object_prototypes_; array_and_object_prototypes_;
......
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