From: mvstanton@chromium.org Date: Wed, 8 May 2013 16:48:27 +0000 (+0000) Subject: Parallel compilation bug: LCallNewArray dereferenced a handle unnecessarily. X-Git-Tag: upstream/4.7.83~14296 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef5211d8afc5d76c071bba07564e55c055aaa905;p=platform%2Fupstream%2Fv8.git Parallel compilation bug: LCallNewArray dereferenced a handle unnecessarily. BUG= R=mstarzinger@chromium.org Review URL: https://codereview.chromium.org/14761010 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14599 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc index ded6487..3a0f476 100644 --- a/src/arm/lithium-codegen-arm.cc +++ b/src/arm/lithium-codegen-arm.cc @@ -4188,8 +4188,7 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) { __ mov(r0, Operand(instr->arity())); __ mov(r2, Operand(instr->hydrogen()->property_cell())); - Object* cell_value = instr->hydrogen()->property_cell()->value(); - ElementsKind kind = static_cast(Smi::cast(cell_value)->value()); + ElementsKind kind = instr->hydrogen()->elements_kind(); if (instr->arity() == 0) { ArrayNoArgumentConstructorStub stub(kind); CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h index 3073f45..3ea99d4 100644 --- a/src/hydrogen-instructions.h +++ b/src/hydrogen-instructions.h @@ -2353,15 +2353,20 @@ class HCallNewArray: public HCallNew { Handle type_cell) : HCallNew(context, constructor, argument_count), type_cell_(type_cell) { + elements_kind_ = static_cast( + Smi::cast(type_cell->value())->value()); } Handle property_cell() const { return type_cell_; } + ElementsKind elements_kind() const { return elements_kind_; } + DECLARE_CONCRETE_INSTRUCTION(CallNewArray) private: + ElementsKind elements_kind_; Handle type_cell_; }; diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index 99955a5..1d9e942 100644 --- a/src/ia32/lithium-codegen-ia32.cc +++ b/src/ia32/lithium-codegen-ia32.cc @@ -4191,8 +4191,7 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) { __ Set(eax, Immediate(instr->arity())); __ mov(ebx, instr->hydrogen()->property_cell()); - Object* cell_value = instr->hydrogen()->property_cell()->value(); - ElementsKind kind = static_cast(Smi::cast(cell_value)->value()); + ElementsKind kind = instr->hydrogen()->elements_kind(); if (instr->arity() == 0) { ArrayNoArgumentConstructorStub stub(kind); CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index b933459..3d3ef39 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -3881,8 +3881,7 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) { __ li(a0, Operand(instr->arity())); __ li(a2, Operand(instr->hydrogen()->property_cell())); - Object* cell_value = instr->hydrogen()->property_cell()->value(); - ElementsKind kind = static_cast(Smi::cast(cell_value)->value()); + ElementsKind kind = instr->hydrogen()->elements_kind(); if (instr->arity() == 0) { ArrayNoArgumentConstructorStub stub(kind); CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc index 97b27d5..f908ea1 100644 --- a/src/x64/lithium-codegen-x64.cc +++ b/src/x64/lithium-codegen-x64.cc @@ -3876,8 +3876,7 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) { __ Set(rax, instr->arity()); __ Move(rbx, instr->hydrogen()->property_cell()); - Object* cell_value = instr->hydrogen()->property_cell()->value(); - ElementsKind kind = static_cast(Smi::cast(cell_value)->value()); + ElementsKind kind = instr->hydrogen()->elements_kind(); if (instr->arity() == 0) { ArrayNoArgumentConstructorStub stub(kind); CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);