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

Unified Diff: runtime/vm/deopt_instructions.cc

Issue 172653002: Unbox/Box Float64x2 and inline typed array loads and stores (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 | « runtime/vm/deopt_instructions.h ('k') | runtime/vm/flow_graph_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/deopt_instructions.cc
diff --git a/runtime/vm/deopt_instructions.cc b/runtime/vm/deopt_instructions.cc
index 1d44098a0cfa0493603c19b0d6c35df773f4e06f..9dca795b39a852ccf2f4e50408f3b8ca3042b16c 100644
--- a/runtime/vm/deopt_instructions.cc
+++ b/runtime/vm/deopt_instructions.cc
@@ -512,6 +512,38 @@ class DeoptFloat32x4StackSlotInstr : public DeoptInstr {
};
+class DeoptFloat64x2StackSlotInstr : public DeoptInstr {
+ public:
+ explicit DeoptFloat64x2StackSlotInstr(intptr_t source_index)
+ : stack_slot_index_(source_index) {
+ ASSERT(stack_slot_index_ >= 0);
+ }
+
+ virtual intptr_t source_index() const { return stack_slot_index_; }
+ virtual DeoptInstr::Kind kind() const { return kFloat64x2StackSlot; }
+
+ virtual const char* ToCString() const {
+ return Isolate::Current()->current_zone()->PrintToString(
+ "f64x2s%" Pd "", stack_slot_index_);
+ }
+
+ void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) {
+ intptr_t source_index =
+ deopt_context->source_frame_size() - stack_slot_index_ - 1;
+ simd128_value_t* source_addr = reinterpret_cast<simd128_value_t*>(
+ deopt_context->GetSourceFrameAddressAt(source_index));
+ *reinterpret_cast<RawSmi**>(dest_addr) = Smi::New(0);
+ deopt_context->DeferFloat64x2Materialization(
+ *source_addr, reinterpret_cast<RawFloat64x2**>(dest_addr));
+ }
+
+ private:
+ const intptr_t stack_slot_index_; // First argument is 0, always >= 0.
+
+ DISALLOW_COPY_AND_ASSIGN(DeoptFloat64x2StackSlotInstr);
+};
+
+
class DeoptInt32x4StackSlotInstr : public DeoptInstr {
public:
explicit DeoptInt32x4StackSlotInstr(intptr_t source_index)
@@ -750,6 +782,33 @@ class DeoptFloat32x4FpuRegisterInstr: public DeoptInstr {
};
+class DeoptFloat64x2FpuRegisterInstr: public DeoptInstr {
+ public:
+ explicit DeoptFloat64x2FpuRegisterInstr(intptr_t reg_as_int)
+ : reg_(static_cast<FpuRegister>(reg_as_int)) {}
+
+ virtual intptr_t source_index() const { return static_cast<intptr_t>(reg_); }
+ virtual DeoptInstr::Kind kind() const { return kFloat64x2FpuRegister; }
+
+ virtual const char* ToCString() const {
+ return Isolate::Current()->current_zone()->PrintToString(
+ "%s(f64x2)", Assembler::FpuRegisterName(reg_));
+ }
+
+ void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) {
+ simd128_value_t value = deopt_context->FpuRegisterValueAsSimd128(reg_);
+ *reinterpret_cast<RawSmi**>(dest_addr) = Smi::New(0);
+ deopt_context->DeferFloat64x2Materialization(
+ value, reinterpret_cast<RawFloat64x2**>(dest_addr));
+ }
+
+ private:
+ const FpuRegister reg_;
+
+ DISALLOW_COPY_AND_ASSIGN(DeoptFloat64x2FpuRegisterInstr);
+};
+
+
// Deoptimization instruction moving an XMM register.
class DeoptInt32x4FpuRegisterInstr: public DeoptInstr {
public:
@@ -1077,6 +1136,8 @@ DeoptInstr* DeoptInstr::Create(intptr_t kind_as_int, intptr_t source_index) {
case kInt64StackSlot: return new DeoptInt64StackSlotInstr(source_index);
case kFloat32x4StackSlot:
return new DeoptFloat32x4StackSlotInstr(source_index);
+ case kFloat64x2StackSlot:
+ return new DeoptFloat64x2StackSlotInstr(source_index);
case kInt32x4StackSlot:
return new DeoptInt32x4StackSlotInstr(source_index);
case kRetAddress: return new DeoptRetAddressInstr(source_index);
@@ -1086,6 +1147,8 @@ DeoptInstr* DeoptInstr::Create(intptr_t kind_as_int, intptr_t source_index) {
case kInt64FpuRegister: return new DeoptInt64FpuRegisterInstr(source_index);
case kFloat32x4FpuRegister:
return new DeoptFloat32x4FpuRegisterInstr(source_index);
+ case kFloat64x2FpuRegister:
+ return new DeoptFloat64x2FpuRegisterInstr(source_index);
case kInt32x4FpuRegister:
return new DeoptInt32x4FpuRegisterInstr(source_index);
case kPcMarker: return new DeoptPcMarkerInstr(source_index);
@@ -1217,9 +1280,11 @@ void DeoptInfoBuilder::AddCopy(Value* value,
deopt_instr = new DeoptInt64FpuRegisterInstr(source_loc.fpu_reg());
} else if (value->definition()->representation() == kUnboxedFloat32x4) {
deopt_instr = new DeoptFloat32x4FpuRegisterInstr(source_loc.fpu_reg());
- } else {
- ASSERT(value->definition()->representation() == kUnboxedInt32x4);
+ } else if (value->definition()->representation() == kUnboxedInt32x4) {
deopt_instr = new DeoptInt32x4FpuRegisterInstr(source_loc.fpu_reg());
+ } else {
+ ASSERT(value->definition()->representation() == kUnboxedFloat64x2);
+ deopt_instr = new DeoptFloat64x2FpuRegisterInstr(source_loc.fpu_reg());
}
} else if (source_loc.IsStackSlot()) {
ASSERT(value->definition()->representation() == kTagged);
@@ -1237,9 +1302,11 @@ void DeoptInfoBuilder::AddCopy(Value* value,
intptr_t source_index = CalculateStackIndex(source_loc);
if (value->definition()->representation() == kUnboxedFloat32x4) {
deopt_instr = new DeoptFloat32x4StackSlotInstr(source_index);
- } else {
- ASSERT(value->definition()->representation() == kUnboxedInt32x4);
+ } else if (value->definition()->representation() == kUnboxedInt32x4) {
deopt_instr = new DeoptInt32x4StackSlotInstr(source_index);
+ } else {
+ ASSERT(value->definition()->representation() == kUnboxedFloat64x2);
+ deopt_instr = new DeoptFloat64x2StackSlotInstr(source_index);
}
} else if (source_loc.IsInvalid() &&
value->definition()->IsMaterializeObject()) {
« no previous file with comments | « runtime/vm/deopt_instructions.h ('k') | runtime/vm/flow_graph_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698