From 979cd4b0f3bb5cacd4c656ee48d529e3d710ce2b Mon Sep 17 00:00:00 2001 From: "ulan@chromium.org" Date: Wed, 29 Jan 2014 14:18:55 +0000 Subject: [PATCH] Disable tracking of double fields during snapshot creation. Follow-up to r18298. R=verwaest@chromium.org Review URL: https://codereview.chromium.org/101123004 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18909 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/lithium-codegen-arm.cc | 2 +- src/bootstrapper.cc | 19 +++++++++++++++++++ src/ia32/lithium-codegen-ia32.cc | 5 ++--- src/mips/lithium-codegen-mips.cc | 2 +- src/x64/lithium-codegen-x64.cc | 5 ++--- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc index bc73e6e..7a48936 100644 --- a/src/arm/lithium-codegen-arm.cc +++ b/src/arm/lithium-codegen-arm.cc @@ -4061,7 +4061,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { __ SmiTst(value); DeoptimizeIf(eq, instr->environment()); } - } else if (FLAG_track_double_fields && representation.IsDouble()) { + } else if (representation.IsDouble()) { ASSERT(transition.is_null()); ASSERT(access.IsInobject()); ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index 6952a55..ef802ba 100644 --- a/src/bootstrapper.cc +++ b/src/bootstrapper.cc @@ -2556,12 +2556,31 @@ void Genesis::MakeFunctionInstancePrototypeWritable() { } +class NoTrackDoubleFieldsForSerializerScope { + public: + NoTrackDoubleFieldsForSerializerScope() : flag_(FLAG_track_double_fields) { + if (Serializer::enabled()) { + // Disable tracking double fields because heap numbers treated as + // immutable by the serializer. + FLAG_track_double_fields = false; + } + } + ~NoTrackDoubleFieldsForSerializerScope() { + FLAG_track_double_fields = flag_; + } + + private: + bool flag_; +}; + + Genesis::Genesis(Isolate* isolate, Handle global_object, v8::Handle global_template, v8::ExtensionConfiguration* extensions) : isolate_(isolate), active_(isolate->bootstrapper()) { + NoTrackDoubleFieldsForSerializerScope disable_double_tracking_for_serializer; result_ = Handle::null(); // If V8 cannot be initialized, just return. if (!V8::Initialize(NULL)) return; diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index 417ed88..49e3da5 100644 --- a/src/ia32/lithium-codegen-ia32.cc +++ b/src/ia32/lithium-codegen-ia32.cc @@ -3213,8 +3213,7 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { } Register object = ToRegister(instr->object()); - if (FLAG_track_double_fields && - instr->hydrogen()->representation().IsDouble()) { + if (instr->hydrogen()->representation().IsDouble()) { if (CpuFeatures::IsSupported(SSE2)) { CpuFeatureScope scope(masm(), SSE2); XMMRegister result = ToDoubleRegister(instr->result()); @@ -4314,7 +4313,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { DeoptimizeIf(zero, instr->environment()); } } - } else if (FLAG_track_double_fields && representation.IsDouble()) { + } else if (representation.IsDouble()) { ASSERT(transition.is_null()); ASSERT(access.IsInobject()); ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index 15f9a0b..4c953ba 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -3999,7 +3999,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { __ SmiTst(value, scratch); DeoptimizeIf(eq, instr->environment(), scratch, Operand(zero_reg)); } - } else if (FLAG_track_double_fields && representation.IsDouble()) { + } else if (representation.IsDouble()) { ASSERT(transition.is_null()); ASSERT(access.IsInobject()); ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc index eca0dc3..1cd2d75 100644 --- a/src/x64/lithium-codegen-x64.cc +++ b/src/x64/lithium-codegen-x64.cc @@ -2764,8 +2764,7 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { } Register object = ToRegister(instr->object()); - if (FLAG_track_double_fields && - instr->hydrogen()->representation().IsDouble()) { + if (instr->hydrogen()->representation().IsDouble()) { XMMRegister result = ToDoubleRegister(instr->result()); __ movsd(result, FieldOperand(object, offset)); return; @@ -3891,7 +3890,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { DeoptimizeIf(cc, instr->environment()); } } - } else if (FLAG_track_double_fields && representation.IsDouble()) { + } else if (representation.IsDouble()) { ASSERT(transition.is_null()); ASSERT(access.IsInobject()); ASSERT(!hinstr->NeedsWriteBarrier()); -- 2.7.4