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

Side by Side Diff: runtime/vm/flow_graph_compiler.cc

Issue 150063004: Support reusable boxes for Float32x4 fields (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX.
6 6
7 #include "vm/flow_graph_compiler.h" 7 #include "vm/flow_graph_compiler.h"
8 8
9 #include "vm/cha.h" 9 #include "vm/cha.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 pending_deoptimization_env_); 448 pending_deoptimization_env_);
449 info->set_pc_offset(assembler()->CodeSize()); 449 info->set_pc_offset(assembler()->CodeSize());
450 deopt_infos_.Add(info); 450 deopt_infos_.Add(info);
451 } 451 }
452 452
453 453
454 // This function must be in sync with FlowGraphCompiler::SaveLiveRegisters 454 // This function must be in sync with FlowGraphCompiler::SaveLiveRegisters
455 // and FlowGraphCompiler::SlowPathEnvironmentFor. 455 // and FlowGraphCompiler::SlowPathEnvironmentFor.
456 void FlowGraphCompiler::RecordSafepoint(LocationSummary* locs) { 456 void FlowGraphCompiler::RecordSafepoint(LocationSummary* locs) {
457 if (is_optimizing()) { 457 if (is_optimizing()) {
458 RegisterSet* registers = locs->live_registers();
459 ASSERT(registers != NULL);
460 const intptr_t kFpuRegisterSpillFactor =
461 kFpuRegisterSize / kWordSize;
462 const intptr_t live_registers_size = registers->CpuRegisterCount() +
463 (registers->FpuRegisterCount() * kFpuRegisterSpillFactor);
458 BitmapBuilder* bitmap = locs->stack_bitmap(); 464 BitmapBuilder* bitmap = locs->stack_bitmap();
459 ASSERT(bitmap != NULL); 465 ASSERT(bitmap != NULL);
460 ASSERT(bitmap->Length() <= StackSize()); 466 ASSERT(bitmap->Length() <= (StackSize() + live_registers_size));
Florian Schneider 2014/02/06 12:38:49 We should comment what's going on here: Maybe add
Cutch 2014/02/06 23:15:38 Done.
461 // Pad the bitmap out to describe all the spill slots.
462 bitmap->SetLength(StackSize()); 467 bitmap->SetLength(StackSize());
463 468
464 // Mark the bits in the stack map in the same order we push registers in 469 // Mark the bits in the stack map in the same order we push registers in
465 // slow path code (see FlowGraphCompiler::SaveLiveRegisters). 470 // slow path code (see FlowGraphCompiler::SaveLiveRegisters).
466 // 471 //
467 // Slow path code can have registers at the safepoint. 472 // Slow path code can have registers at the safepoint.
468 if (!locs->always_calls()) { 473 if (!locs->always_calls()) {
469 RegisterSet* regs = locs->live_registers(); 474 RegisterSet* regs = locs->live_registers();
470 if (regs->FpuRegisterCount() > 0) { 475 if (regs->FpuRegisterCount() > 0) {
471 // Denote FPU registers with 0 bits in the stackmap. Based on the 476 // Denote FPU registers with 0 bits in the stackmap. Based on the
472 // assumption that there are normally few live FPU registers, this 477 // assumption that there are normally few live FPU registers, this
473 // encoding is simpler and roughly as compact as storing a separate 478 // encoding is simpler and roughly as compact as storing a separate
474 // count of FPU registers. 479 // count of FPU registers.
475 // 480 //
476 // FPU registers have the highest register number at the highest 481 // FPU registers have the highest register number at the highest
477 // address (i.e., first in the stackmap). 482 // address (i.e., first in the stackmap).
478 const intptr_t kFpuRegisterSpillFactor =
479 kFpuRegisterSize / kWordSize;
480 for (intptr_t i = kNumberOfFpuRegisters - 1; i >= 0; --i) { 483 for (intptr_t i = kNumberOfFpuRegisters - 1; i >= 0; --i) {
481 FpuRegister reg = static_cast<FpuRegister>(i); 484 FpuRegister reg = static_cast<FpuRegister>(i);
482 if (regs->ContainsFpuRegister(reg)) { 485 if (regs->ContainsFpuRegister(reg)) {
483 for (intptr_t j = 0; j < kFpuRegisterSpillFactor; ++j) { 486 for (intptr_t j = 0; j < kFpuRegisterSpillFactor; ++j) {
484 bitmap->Set(bitmap->Length(), false); 487 bitmap->Set(bitmap->Length(), false);
485 } 488 }
486 } 489 }
487 } 490 }
488 } 491 }
489 // General purpose registers have the lowest register number at the 492 // General purpose registers have the lowest register number at the
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 1269
1267 for (int i = 0; i < len; i++) { 1270 for (int i = 0; i < len; i++) {
1268 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), 1271 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i),
1269 &Function::ZoneHandle(ic_data.GetTargetAt(i)), 1272 &Function::ZoneHandle(ic_data.GetTargetAt(i)),
1270 ic_data.GetCountAt(i))); 1273 ic_data.GetCountAt(i)));
1271 } 1274 }
1272 sorted->Sort(HighestCountFirst); 1275 sorted->Sort(HighestCountFirst);
1273 } 1276 }
1274 1277
1275 } // namespace dart 1278 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.cc » ('j') | runtime/vm/intermediate_language_arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698