From 97aecae1cb10a3334bd068aaa4559f691c5aab5c Mon Sep 17 00:00:00 2001 From: "vegorov@chromium.org" Date: Tue, 1 Mar 2011 13:16:57 +0000 Subject: [PATCH] Fix several evaluation order sensitive GC-unsafe places. Review URL: http://codereview.chromium.org/6596070 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6991 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/lithium-codegen-arm.cc | 3 ++- src/ia32/lithium-codegen-ia32.cc | 3 ++- src/runtime.cc | 9 ++++++--- src/x64/lithium-codegen-x64.cc | 3 ++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc index d375617..f8a25e1 100644 --- a/src/arm/lithium-codegen-arm.cc +++ b/src/arm/lithium-codegen-arm.cc @@ -573,7 +573,8 @@ void LCodeGen::PopulateDeoptimizationData(Handle code) { Handle data = Factory::NewDeoptimizationInputData(length, TENURED); - data->SetTranslationByteArray(*translations_.CreateByteArray()); + Handle translations = translations_.CreateByteArray(); + data->SetTranslationByteArray(*translations); data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_)); Handle literals = diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index c7424a5..477b6f6 100644 --- a/src/ia32/lithium-codegen-ia32.cc +++ b/src/ia32/lithium-codegen-ia32.cc @@ -588,7 +588,8 @@ void LCodeGen::PopulateDeoptimizationData(Handle code) { Handle data = Factory::NewDeoptimizationInputData(length, TENURED); - data->SetTranslationByteArray(*translations_.CreateByteArray()); + Handle translations = translations_.CreateByteArray(); + data->SetTranslationByteArray(*translations); data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_)); Handle literals = diff --git a/src/runtime.cc b/src/runtime.cc index 8219d06..1412389 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -783,7 +783,8 @@ static MaybeObject* Runtime_GetOwnProperty(Arguments args) { case JSObject::INTERCEPTED_ELEMENT: case JSObject::FAST_ELEMENT: { elms->set(IS_ACCESSOR_INDEX, Heap::false_value()); - elms->set(VALUE_INDEX, *GetElement(obj, index)); + Handle value = GetElement(obj, index); + elms->set(VALUE_INDEX, *value); elms->set(WRITABLE_INDEX, Heap::true_value()); elms->set(ENUMERABLE_INDEX, Heap::true_value()); elms->set(CONFIGURABLE_INDEX, Heap::true_value()); @@ -816,12 +817,14 @@ static MaybeObject* Runtime_GetOwnProperty(Arguments args) { } break; } - case NORMAL: + case NORMAL: { // This is a data property. elms->set(IS_ACCESSOR_INDEX, Heap::false_value()); - elms->set(VALUE_INDEX, *GetElement(obj, index)); + Handle value = GetElement(obj, index); + elms->set(VALUE_INDEX, *value); elms->set(WRITABLE_INDEX, Heap::ToBoolean(!details.IsReadOnly())); break; + } default: UNREACHABLE(); break; diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc index 095a1c3..3a43035 100644 --- a/src/x64/lithium-codegen-x64.cc +++ b/src/x64/lithium-codegen-x64.cc @@ -545,7 +545,8 @@ void LCodeGen::PopulateDeoptimizationData(Handle code) { Handle data = Factory::NewDeoptimizationInputData(length, TENURED); - data->SetTranslationByteArray(*translations_.CreateByteArray()); + Handle translations = translations_.CreateByteArray(); + data->SetTranslationByteArray(*translations); data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_)); Handle literals = -- 2.7.4