Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: src/assembler.cc

Issue 2900683002: [compiler] Delay allocation of code-embedded heap numbers. (Closed)
Patch Set: Fix rebase. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/assembler.h ('k') | src/builtins/setup-builtins-internal.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler.cc
diff --git a/src/assembler.cc b/src/assembler.cc
index 53ca5e01afe17d98141bd25aba7b2f5dc2a8ac52..86312dd2c48217396010d9913d65dcee71c987f9 100644
--- a/src/assembler.cc
+++ b/src/assembler.cc
@@ -190,6 +190,19 @@ void AssemblerBase::Print(Isolate* isolate) {
v8::internal::Disassembler::Decode(isolate, &os, buffer_, pc_, nullptr);
}
+AssemblerBase::RequestedHeapNumber::RequestedHeapNumber(double value,
+ int offset)
+ : value(value), offset(offset) {
+ DCHECK(!IsSmiDouble(value));
+}
+
+void AssemblerBase::AllocateRequestedHeapNumbers(Isolate* isolate) {
+ for (auto& heap_number : heap_numbers_) {
+ Handle<HeapObject> object = isolate->factory()->NewHeapNumber(
+ heap_number.value, IMMUTABLE, TENURED);
+ Assembler::set_heap_number(object, buffer_ + heap_number.offset);
+ }
+}
// -----------------------------------------------------------------------------
// Implementation of PredictableCodeSizeScope
@@ -1991,5 +2004,6 @@ void Assembler::DataAlign(int m) {
db(0);
}
}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/assembler.h ('k') | src/builtins/setup-builtins-internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698