Revision: 20784
Author: [email protected]
Date: Wed Apr 16 02:06:14 2014 UTC
Log: Introduce DontEmitDebugCodeScope to fix the x64 nosnapshot build.
[email protected]
Review URL: https://codereview.chromium.org/232673003
http://code.google.com/p/v8/source/detail?r=20784
Modified:
/branches/bleeding_edge/src/assembler.h
/branches/bleeding_edge/src/x64/full-codegen-x64.cc
=======================================
--- /branches/bleeding_edge/src/assembler.h Thu Mar 27 10:41:45 2014 UTC
+++ /branches/bleeding_edge/src/assembler.h Wed Apr 16 02:06:14 2014 UTC
@@ -107,6 +107,22 @@
};
+// Avoids emitting debug code during the lifetime of this scope object.
+class DontEmitDebugCodeScope BASE_EMBEDDED {
+ public:
+ explicit DontEmitDebugCodeScope(AssemblerBase* assembler)
+ : assembler_(assembler), old_value_(assembler->emit_debug_code()) {
+ assembler_->set_emit_debug_code(false);
+ }
+ ~DontEmitDebugCodeScope() {
+ assembler_->set_emit_debug_code(old_value_);
+ };
+ private:
+ AssemblerBase* assembler_;
+ bool old_value_;
+};
+
+
// Avoids using instructions that vary in size in unpredictable ways
between the
// snapshot and the running VM.
class PredictableCodeSizeScope {
=======================================
--- /branches/bleeding_edge/src/x64/full-codegen-x64.cc Wed Apr 16 01:03:56
2014 UTC
+++ /branches/bleeding_edge/src/x64/full-codegen-x64.cc Wed Apr 16 02:06:14
2014 UTC
@@ -361,6 +361,9 @@
__ Move(kScratchRegister, Smi::FromInt(reset_value));
__ movp(FieldOperand(rbx, Cell::kValueOffset), kScratchRegister);
}
+
+
+static const byte kJnsOffset = kPointerSize == kInt64Size ? 0x1d : 0x14;
void FullCodeGenerator::EmitBackEdgeBookkeeping(IterationStatement* stmt,
@@ -373,17 +376,22 @@
int weight = Min(kMaxBackEdgeWeight,
Max(1, distance / kCodeSizeMultiplier));
EmitProfilingCounterDecrement(weight);
+
__ j(positive, &ok, Label::kNear);
- __ call(isolate()->builtins()->InterruptCheck(), RelocInfo::CODE_TARGET);
+ {
+ PredictableCodeSizeScope predictible_code_size_scope(masm_,
kJnsOffset);
+ DontEmitDebugCodeScope dont_emit_debug_code_scope(masm_);
+ __ call(isolate()->builtins()->InterruptCheck(),
RelocInfo::CODE_TARGET);
- // Record a mapping of this PC offset to the OSR id. This is used to
find
- // the AST id from the unoptimized code in order to use it as a key into
- // the deoptimization input data found in the optimized code.
- RecordBackEdge(stmt->OsrEntryId());
+ // Record a mapping of this PC offset to the OSR id. This is used to
find
+ // the AST id from the unoptimized code in order to use it as a key
into
+ // the deoptimization input data found in the optimized code.
+ RecordBackEdge(stmt->OsrEntryId());
- EmitProfilingCounterReset();
+ EmitProfilingCounterReset();
+ }
+ __ bind(&ok);
- __ bind(&ok);
PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS);
// Record a mapping of the OSR id to this PC. This is used if the OSR
// entry becomes the target of a bailout. We don't expect it to be, but
@@ -4844,7 +4852,6 @@
static const byte kJnsInstruction = 0x79;
-static const byte kJnsOffset = kPointerSize == kInt64Size ? 0x1d : 0x14;
static const byte kNopByteOne = 0x66;
static const byte kNopByteTwo = 0x90;
#ifdef DEBUG
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.