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

Unified Diff: src/x64/assembler-x64.h

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/regexp/x64/regexp-macro-assembler-x64.cc ('k') | src/x64/assembler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/assembler-x64.h
diff --git a/src/x64/assembler-x64.h b/src/x64/assembler-x64.h
index 0f2f27247ece323e284ead6072a0c37f4afa1f83..852c83807097c00d9dffde4f1c9737e843e77448 100644
--- a/src/x64/assembler-x64.h
+++ b/src/x64/assembler-x64.h
@@ -38,6 +38,7 @@
#define V8_X64_ASSEMBLER_X64_H_
#include <deque>
+#include <forward_list>
#include "src/assembler.h"
#include "src/x64/sse-instr.h"
@@ -488,12 +489,12 @@ class Assembler : public AssemblerBase {
Assembler(Isolate* isolate, void* buffer, int buffer_size)
: Assembler(IsolateData(isolate), buffer, buffer_size) {}
Assembler(IsolateData isolate_data, void* buffer, int buffer_size);
- virtual ~Assembler() { }
+ virtual ~Assembler() {}
// GetCode emits any pending (non-emitted) code and fills the descriptor
// desc. GetCode() is idempotent; it returns the same result if no other
// Assembler functions are invoked in between GetCode() calls.
- void GetCode(CodeDesc* desc);
+ void GetCode(Isolate* isolate, CodeDesc* desc);
// Read/Modify the code target in the relative branch/call instruction at pc.
// On the x64 architecture, we use relative jumps with a 32-bit displacement
@@ -696,6 +697,21 @@ class Assembler : public AssemblerBase {
// Loads a pointer into a register with a relocation mode.
void movp(Register dst, void* ptr, RelocInfo::Mode rmode);
+ // Load a heap number into a register.
+ // The heap number will not be allocated and embedded into the code right
+ // away. Instead, we emit the load of a dummy object. Later, when calling
+ // Assembler::GetCode, the heap number will be allocated and the code will be
+ // patched by replacing the dummy with the actual object. The RelocInfo for
+ // the embedded object gets already recorded correctly when emitting the dummy
+ // move.
+ void movp_heap_number(Register dst, double value);
+
+ // Patch the dummy heap number that we emitted at {pc} during code assembly
+ // with the actual heap object (handle).
+ static void set_heap_number(Handle<HeapObject> number, Address pc) {
+ Memory::Object_Handle_at(pc) = number;
+ }
+
// Loads a 64-bit immediate into a register.
void movq(Register dst, int64_t value,
RelocInfo::Mode rmode = RelocInfo::NONE64);
« no previous file with comments | « src/regexp/x64/regexp-macro-assembler-x64.cc ('k') | src/x64/assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698