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

Unified Diff: src/compiler/x64/instruction-selector-x64.cc

Issue 1075103002: [x86] Support immediate indices for StoreWriteBarrier. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/compiler/x64/code-generator-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/x64/instruction-selector-x64.cc
diff --git a/src/compiler/x64/instruction-selector-x64.cc b/src/compiler/x64/instruction-selector-x64.cc
index fea4e3f6235a8c7e88a62c9ae688669300cfae91..68bc0352270b283fef2a1a2dd7f691fa0064842c 100644
--- a/src/compiler/x64/instruction-selector-x64.cc
+++ b/src/compiler/x64/instruction-selector-x64.cc
@@ -154,17 +154,24 @@ void InstructionSelector::VisitStore(Node* node) {
StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node);
MachineType rep = RepresentationOf(store_rep.machine_type());
if (store_rep.write_barrier_kind() == kFullWriteBarrier) {
- DCHECK(rep == kRepTagged);
+ DCHECK_EQ(kRepTagged, rep);
// TODO(dcarney): refactor RecordWrite function to take temp registers
// and pass them here instead of using fixed regs
- // TODO(dcarney): handle immediate indices.
- InstructionOperand temps[] = {g.TempRegister(rcx), g.TempRegister(rdx)};
- Emit(kX64StoreWriteBarrier, g.NoOutput(), g.UseFixed(base, rbx),
- g.UseFixed(index, rcx), g.UseFixed(value, rdx), arraysize(temps),
- temps);
+ if (g.CanBeImmediate(index)) {
+ InstructionOperand temps[] = {g.TempRegister(rcx), g.TempRegister()};
+ Emit(kX64StoreWriteBarrier, g.NoOutput(), g.UseFixed(base, rbx),
+ g.UseImmediate(index), g.UseFixed(value, rcx), arraysize(temps),
+ temps);
+ } else {
+ InstructionOperand temps[] = {g.TempRegister(rcx), g.TempRegister(rdx)};
+ Emit(kX64StoreWriteBarrier, g.NoOutput(), g.UseFixed(base, rbx),
+ g.UseFixed(index, rcx), g.UseFixed(value, rdx), arraysize(temps),
+ temps);
+ }
return;
}
DCHECK_EQ(kNoWriteBarrier, store_rep.write_barrier_kind());
+
ArchOpcode opcode;
switch (rep) {
case kRepFloat32:
« no previous file with comments | « src/compiler/x64/code-generator-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698