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

Unified Diff: runtime/vm/assembler_ia32.cc

Issue 11428067: Merge the Merlin heap tracing to top-of-trunk. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address review comments Created 8 years 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/assembler_ia32.h ('k') | runtime/vm/class_table.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_ia32.cc
diff --git a/runtime/vm/assembler_ia32.cc b/runtime/vm/assembler_ia32.cc
index 017c98fc5b937c32ec98af6b66d8a6d8882f1ed3..633c1dd40bb2a2f6322ccf27707665636cef6fce 100644
--- a/runtime/vm/assembler_ia32.cc
+++ b/runtime/vm/assembler_ia32.cc
@@ -6,7 +6,9 @@
#if defined(TARGET_ARCH_IA32)
#include "vm/assembler.h"
+#include "vm/code_generator.h"
#include "vm/heap.h"
+#include "vm/heap_trace.h"
#include "vm/memory_region.h"
#include "vm/runtime_entry.h"
#include "vm/stub_code.h"
@@ -1620,6 +1622,7 @@ void Assembler::StoreIntoObject(Register object,
const FieldAddress& dest,
Register value) {
ASSERT(object != value);
+ TraceStoreIntoObject(object, dest, value);
movl(dest, value);
Label done;
StoreIntoObjectFilter(object, value, &done);
@@ -1635,6 +1638,7 @@ void Assembler::StoreIntoObject(Register object,
void Assembler::StoreIntoObjectNoBarrier(Register object,
const FieldAddress& dest,
Register value) {
+ TraceStoreIntoObject(object, dest, value);
movl(dest, value);
#if defined(DEBUG)
Label done;
@@ -1654,6 +1658,7 @@ void Assembler::StoreIntoObjectNoBarrier(Register object,
if (value.IsSmi()) {
movl(dest, Immediate(reinterpret_cast<int32_t>(value.raw())));
} else {
+ // No heap trace for an old object store.
ASSERT(value.IsOld());
AssemblerBuffer::EnsureCapacity ensured(&buffer_);
EmitUint8(0xC7);
@@ -1664,6 +1669,23 @@ void Assembler::StoreIntoObjectNoBarrier(Register object,
}
+void Assembler::TraceStoreIntoObject(Register object,
+ const FieldAddress& dest,
+ Register value) {
+ if (HeapTrace::is_enabled()) {
+ pushal();
+ EnterCallRuntimeFrame(3 * kWordSize);
+ movl(Address(ESP, 0 * kWordSize), object);
+ leal(EAX, dest);
+ movl(Address(ESP, 1 * kWordSize), EAX);
+ movl(Address(ESP, 2 * kWordSize), value);
+ CallRuntime(kHeapTraceStoreRuntimeEntry);
+ LeaveCallRuntimeFrame();
+ popal();
+ }
+}
+
+
void Assembler::LoadDoubleConstant(XmmRegister dst, double value) {
// TODO(5410843): Need to have a code constants table.
int64_t constant = bit_cast<int64_t, double>(value);
« no previous file with comments | « runtime/vm/assembler_ia32.h ('k') | runtime/vm/class_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698