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

Unified Diff: src/compiler/x64/code-generator-x64.cc

Issue 1759383003: [compiler] Add relocatable pointer constants for wasm memory references. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Removing additional check Created 4 years, 9 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
Index: src/compiler/x64/code-generator-x64.cc
diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc
index c07a21f8638314fa16bbd93c5eada9e8530036b7..ec0c8b860bb8eaac2aee8f9e4d1b45835c8437d7 100644
--- a/src/compiler/x64/code-generator-x64.cc
+++ b/src/compiler/x64/code-generator-x64.cc
@@ -2075,41 +2075,45 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
if (destination->IsRegister() || destination->IsStackSlot()) {
Register dst = destination->IsRegister() ? g.ToRegister(destination)
: kScratchRegister;
- switch (src.type()) {
- case Constant::kInt32:
- // TODO(dcarney): don't need scratch in this case.
- __ Set(dst, src.ToInt32());
- break;
- case Constant::kInt64:
- __ Set(dst, src.ToInt64());
- break;
- case Constant::kFloat32:
- __ Move(dst,
- isolate()->factory()->NewNumber(src.ToFloat32(), TENURED));
- break;
- case Constant::kFloat64:
- __ Move(dst,
- isolate()->factory()->NewNumber(src.ToFloat64(), TENURED));
- break;
- case Constant::kExternalReference:
- __ Move(dst, src.ToExternalReference());
- break;
- case Constant::kHeapObject: {
- Handle<HeapObject> src_object = src.ToHeapObject();
- Heap::RootListIndex index;
- int slot;
- if (IsMaterializableFromFrame(src_object, &slot)) {
- __ movp(dst, g.SlotToOperand(slot));
- } else if (IsMaterializableFromRoot(src_object, &index)) {
- __ LoadRoot(dst, index);
- } else {
- __ Move(dst, src_object);
+ if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) {
+ __ movq(dst, src.ToInt64(), src.rmode());
+ } else {
+ switch (src.type()) {
+ case Constant::kInt32:
+ // TODO(dcarney): don't need scratch in this case.
+ __ Set(dst, src.ToInt32());
+ break;
+ case Constant::kInt64:
+ __ Set(dst, src.ToInt64());
+ break;
+ case Constant::kFloat32:
+ __ Move(dst,
+ isolate()->factory()->NewNumber(src.ToFloat32(), TENURED));
+ break;
+ case Constant::kFloat64:
+ __ Move(dst,
+ isolate()->factory()->NewNumber(src.ToFloat64(), TENURED));
+ break;
+ case Constant::kExternalReference:
+ __ Move(dst, src.ToExternalReference());
+ break;
+ case Constant::kHeapObject: {
+ Handle<HeapObject> src_object = src.ToHeapObject();
+ Heap::RootListIndex index;
+ int slot;
+ if (IsMaterializableFromFrame(src_object, &slot)) {
+ __ movp(dst, g.SlotToOperand(slot));
+ } else if (IsMaterializableFromRoot(src_object, &index)) {
+ __ LoadRoot(dst, index);
+ } else {
+ __ Move(dst, src_object);
+ }
+ break;
}
- break;
+ case Constant::kRpoNumber:
+ UNREACHABLE(); // TODO(dcarney): load of labels on x64.
+ break;
}
- case Constant::kRpoNumber:
- UNREACHABLE(); // TODO(dcarney): load of labels on x64.
- break;
}
if (destination->IsStackSlot()) {
__ movq(g.ToOperand(destination), kScratchRegister);

Powered by Google App Engine
This is Rietveld 408576698