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

Unified Diff: src/ia32/full-codegen-ia32.cc

Issue 9447098: Profiler experiments: fix snapshotting with count-based interrupts (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/full-codegen-ia32.cc
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
index afb8a7f8b0abaacba8953d647ddff8eff465b196..ee1462567c67f9ac903e77aeae1e2316fed9e278 100644
--- a/src/ia32/full-codegen-ia32.cc
+++ b/src/ia32/full-codegen-ia32.cc
@@ -342,7 +342,15 @@ void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt,
int distance = masm_->SizeOfCodeGeneratedSince(back_edge_target);
weight = Min(127, Max(1, distance / 100));
}
- __ sub(Operand::Cell(profiling_counter_), Immediate(Smi::FromInt(weight)));
+ if (Serializer::enabled()) {
+ __ mov(ebx, Immediate(profiling_counter_));
+ __ sub(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset),
+ Immediate(Smi::FromInt(weight)));
+ } else {
+ // This version is slightly faster, but not snapshot safe.
+ __ sub(Operand::Cell(profiling_counter_),
+ Immediate(Smi::FromInt(weight)));
+ }
__ j(positive, &ok, Label::kNear);
InterruptStub stub;
__ CallStub(&stub);
@@ -372,8 +380,14 @@ void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt,
if (FLAG_count_based_interrupts) {
// Reset the countdown.
- __ mov(Operand::Cell(profiling_counter_),
- Immediate(Smi::FromInt(FLAG_interrupt_budget)));
+ if (Serializer::enabled()) {
+ __ mov(ebx, Immediate(profiling_counter_));
+ __ mov(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset),
+ Immediate(Smi::FromInt(FLAG_interrupt_budget)));
+ } else {
+ __ mov(Operand::Cell(profiling_counter_),
+ Immediate(Smi::FromInt(FLAG_interrupt_budget)));
+ }
}
__ bind(&ok);
@@ -403,8 +417,15 @@ void FullCodeGenerator::EmitReturnSequence() {
int distance = masm_->pc_offset();
weight = Min(127, Max(1, distance / 100));
}
- __ sub(Operand::Cell(profiling_counter_),
- Immediate(Smi::FromInt(weight)));
+ if (Serializer::enabled()) {
+ __ mov(ebx, Immediate(profiling_counter_));
+ __ sub(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset),
+ Immediate(Smi::FromInt(weight)));
+ } else {
+ // This version is slightly faster, but not snapshot safe.
+ __ sub(Operand::Cell(profiling_counter_),
+ Immediate(Smi::FromInt(weight)));
+ }
Label ok;
__ j(positive, &ok, Label::kNear);
__ push(eax);
@@ -412,8 +433,14 @@ void FullCodeGenerator::EmitReturnSequence() {
__ CallStub(&stub);
__ pop(eax);
// Reset the countdown.
- __ mov(Operand::Cell(profiling_counter_),
- Immediate(Smi::FromInt(FLAG_interrupt_budget)));
+ if (Serializer::enabled()) {
+ __ mov(ebx, Immediate(profiling_counter_));
+ __ mov(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset),
+ Immediate(Smi::FromInt(FLAG_interrupt_budget)));
+ } else {
+ __ mov(Operand::Cell(profiling_counter_),
+ Immediate(Smi::FromInt(FLAG_interrupt_budget)));
+ }
__ bind(&ok);
}
#ifdef DEBUG
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698