summaryrefslogtreecommitdiff
path: root/chromium/v8/src/builtins/constants-table-builder.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/v8/src/builtins/constants-table-builder.cc
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/v8/src/builtins/constants-table-builder.cc')
-rw-r--r--chromium/v8/src/builtins/constants-table-builder.cc37
1 files changed, 28 insertions, 9 deletions
diff --git a/chromium/v8/src/builtins/constants-table-builder.cc b/chromium/v8/src/builtins/constants-table-builder.cc
index 94e8dc05ec7..fa333726e79 100644
--- a/chromium/v8/src/builtins/constants-table-builder.cc
+++ b/chromium/v8/src/builtins/constants-table-builder.cc
@@ -57,24 +57,30 @@ uint32_t BuiltinsConstantsTableBuilder::AddObject(Handle<Object> object) {
}
}
-void BuiltinsConstantsTableBuilder::PatchSelfReference(
- Handle<Object> self_reference, Handle<Code> code_object) {
-#ifdef DEBUG
+namespace {
+void CheckPreconditionsForPatching(Isolate* isolate,
+ Handle<Object> replacement_object) {
// Roots must not be inserted into the constants table as they are already
- // accessibly from the root list.
+ // accessible from the root list.
RootIndex root_list_index;
- DCHECK(!isolate_->roots_table().IsRootHandle(code_object, &root_list_index));
+ DCHECK(!isolate->roots_table().IsRootHandle(replacement_object,
+ &root_list_index));
+ USE(root_list_index);
// Not yet finalized.
- DCHECK_EQ(ReadOnlyRoots(isolate_).empty_fixed_array(),
- isolate_->heap()->builtins_constants_table());
+ DCHECK_EQ(ReadOnlyRoots(isolate).empty_fixed_array(),
+ isolate->heap()->builtins_constants_table());
- DCHECK(isolate_->IsGeneratingEmbeddedBuiltins());
+ DCHECK(isolate->IsGeneratingEmbeddedBuiltins());
+}
+} // namespace
+void BuiltinsConstantsTableBuilder::PatchSelfReference(
+ Handle<Object> self_reference, Handle<Code> code_object) {
+ CheckPreconditionsForPatching(isolate_, code_object);
DCHECK(self_reference->IsOddball());
DCHECK(Oddball::cast(*self_reference).kind() ==
Oddball::kSelfReferenceMarker);
-#endif
uint32_t key;
if (map_.Delete(self_reference, &key)) {
@@ -83,6 +89,17 @@ void BuiltinsConstantsTableBuilder::PatchSelfReference(
}
}
+void BuiltinsConstantsTableBuilder::PatchBasicBlockCountersReference(
+ Handle<ByteArray> counters) {
+ CheckPreconditionsForPatching(isolate_, counters);
+
+ uint32_t key;
+ if (map_.Delete(ReadOnlyRoots(isolate_).basic_block_counters_marker(),
+ &key)) {
+ map_.Set(counters, key);
+ }
+}
+
void BuiltinsConstantsTableBuilder::Finalize() {
HandleScope handle_scope(isolate_);
@@ -117,6 +134,8 @@ void BuiltinsConstantsTableBuilder::Finalize() {
DCHECK(table->get(i).IsHeapObject());
DCHECK_NE(ReadOnlyRoots(isolate_).undefined_value(), table->get(i));
DCHECK_NE(ReadOnlyRoots(isolate_).self_reference_marker(), table->get(i));
+ DCHECK_NE(ReadOnlyRoots(isolate_).basic_block_counters_marker(),
+ table->get(i));
}
#endif