From ff2719a0756e80e9e803791cd9cc0fcd953df37a Mon Sep 17 00:00:00 2001 From: "mstarzinger@chromium.org" Date: Wed, 18 Sep 2013 15:08:17 +0000 Subject: [PATCH] Remove obsolete Runtime_CreateObjectLiteralShallow. R=verwaest@chromium.org Review URL: https://codereview.chromium.org/24096019 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16793 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/code-stubs-arm.cc | 2 +- src/arm/full-codegen-arm.cc | 8 +++----- src/hydrogen-instructions.h | 3 +-- src/hydrogen.cc | 4 +--- src/ia32/code-stubs-ia32.cc | 2 +- src/ia32/full-codegen-ia32.cc | 12 +++--------- src/mips/code-stubs-mips.cc | 2 +- src/mips/full-codegen-mips.cc | 8 +++----- src/runtime.cc | 26 -------------------------- src/runtime.h | 1 - src/x64/code-stubs-x64.cc | 2 +- src/x64/full-codegen-x64.cc | 12 +++--------- 12 files changed, 18 insertions(+), 64 deletions(-) diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc index 7ec7df9..60bd986 100644 --- a/src/arm/code-stubs-arm.cc +++ b/src/arm/code-stubs-arm.cc @@ -77,7 +77,7 @@ void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( descriptor->register_param_count_ = 4; descriptor->register_params_ = registers; descriptor->deoptimization_handler_ = - Runtime::FunctionForId(Runtime::kCreateObjectLiteralShallow)->entry; + Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry; } diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc index b6fb70b..7518545 100644 --- a/src/arm/full-codegen-arm.cc +++ b/src/arm/full-codegen-arm.cc @@ -1651,13 +1651,11 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { __ mov(r0, Operand(Smi::FromInt(flags))); int properties_count = constant_properties->length() / 2; if ((FLAG_track_double_fields && expr->may_store_doubles()) || - expr->depth() > 1) { - __ Push(r3, r2, r1, r0); - __ CallRuntime(Runtime::kCreateObjectLiteral, 4); - } else if (Serializer::enabled() || flags != ObjectLiteral::kFastElements || + expr->depth() > 1 || Serializer::enabled() || + flags != ObjectLiteral::kFastElements || properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { __ Push(r3, r2, r1, r0); - __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); + __ CallRuntime(Runtime::kCreateObjectLiteral, 4); } else { FastCloneShallowObjectStub stub(properties_count); __ CallStub(&stub); diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h index aed2b4b..6603e6c 100644 --- a/src/hydrogen-instructions.h +++ b/src/hydrogen-instructions.h @@ -6743,8 +6743,7 @@ class HToFastProperties V8_FINAL : public HUnaryOperation { ASSERT(value->IsCallRuntime()); #ifdef DEBUG const Runtime::Function* function = HCallRuntime::cast(value)->function(); - ASSERT(function->function_id == Runtime::kCreateObjectLiteral || - function->function_id == Runtime::kCreateObjectLiteralShallow); + ASSERT(function->function_id == Runtime::kCreateObjectLiteral); #endif } diff --git a/src/hydrogen.cc b/src/hydrogen.cc index 8a2af36..830a8f1 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -4179,9 +4179,7 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { Add(Add(constant_properties)); Add(Add(flags)); - Runtime::FunctionId function_id = - (expr->depth() > 1 || expr->may_store_doubles()) - ? Runtime::kCreateObjectLiteral : Runtime::kCreateObjectLiteralShallow; + Runtime::FunctionId function_id = Runtime::kCreateObjectLiteral; literal = Add(isolate()->factory()->empty_string(), Runtime::FunctionForId(function_id), 4); diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc index c113dfb..7aa657d 100644 --- a/src/ia32/code-stubs-ia32.cc +++ b/src/ia32/code-stubs-ia32.cc @@ -82,7 +82,7 @@ void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( descriptor->register_param_count_ = 4; descriptor->register_params_ = registers; descriptor->deoptimization_handler_ = - Runtime::FunctionForId(Runtime::kCreateObjectLiteralShallow)->entry; + Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry; } diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc index 6d39cc1..c9f7f32 100644 --- a/src/ia32/full-codegen-ia32.cc +++ b/src/ia32/full-codegen-ia32.cc @@ -1586,21 +1586,15 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { : ObjectLiteral::kNoFlags; int properties_count = constant_properties->length() / 2; if ((FLAG_track_double_fields && expr->may_store_doubles()) || - expr->depth() > 1) { - __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); - __ push(FieldOperand(edi, JSFunction::kLiteralsOffset)); - __ push(Immediate(Smi::FromInt(expr->literal_index()))); - __ push(Immediate(constant_properties)); - __ push(Immediate(Smi::FromInt(flags))); - __ CallRuntime(Runtime::kCreateObjectLiteral, 4); - } else if (Serializer::enabled() || flags != ObjectLiteral::kFastElements || + expr->depth() > 1 || Serializer::enabled() || + flags != ObjectLiteral::kFastElements || properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); __ push(FieldOperand(edi, JSFunction::kLiteralsOffset)); __ push(Immediate(Smi::FromInt(expr->literal_index()))); __ push(Immediate(constant_properties)); __ push(Immediate(Smi::FromInt(flags))); - __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); + __ CallRuntime(Runtime::kCreateObjectLiteral, 4); } else { __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); __ mov(eax, FieldOperand(edi, JSFunction::kLiteralsOffset)); diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc index ee49b25..2e17133 100644 --- a/src/mips/code-stubs-mips.cc +++ b/src/mips/code-stubs-mips.cc @@ -78,7 +78,7 @@ void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( descriptor->register_param_count_ = 4; descriptor->register_params_ = registers; descriptor->deoptimization_handler_ = - Runtime::FunctionForId(Runtime::kCreateObjectLiteralShallow)->entry; + Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry; } diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc index df3f417..c2dbabd 100644 --- a/src/mips/full-codegen-mips.cc +++ b/src/mips/full-codegen-mips.cc @@ -1653,13 +1653,11 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { __ li(a0, Operand(Smi::FromInt(flags))); int properties_count = constant_properties->length() / 2; if ((FLAG_track_double_fields && expr->may_store_doubles()) || - expr->depth() > 1) { - __ Push(a3, a2, a1, a0); - __ CallRuntime(Runtime::kCreateObjectLiteral, 4); - } else if (Serializer::enabled() || flags != ObjectLiteral::kFastElements || + expr->depth() > 1 || Serializer::enabled() || + flags != ObjectLiteral::kFastElements || properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { __ Push(a3, a2, a1, a0); - __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); + __ CallRuntime(Runtime::kCreateObjectLiteral, 4); } else { FastCloneShallowObjectStub stub(properties_count); __ CallStub(&stub); diff --git a/src/runtime.cc b/src/runtime.cc index 7c240e2..3bee678 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -506,32 +506,6 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateObjectLiteral) { } -RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateObjectLiteralShallow) { - HandleScope scope(isolate); - ASSERT(args.length() == 4); - CONVERT_ARG_HANDLE_CHECKED(FixedArray, literals, 0); - CONVERT_SMI_ARG_CHECKED(literals_index, 1); - CONVERT_ARG_HANDLE_CHECKED(FixedArray, constant_properties, 2); - CONVERT_SMI_ARG_CHECKED(flags, 3); - bool should_have_fast_elements = (flags & ObjectLiteral::kFastElements) != 0; - bool has_function_literal = (flags & ObjectLiteral::kHasFunction) != 0; - - // Check if boilerplate exists. If not, create it first. - Handle boilerplate(literals->get(literals_index), isolate); - if (*boilerplate == isolate->heap()->undefined_value()) { - boilerplate = CreateObjectLiteralBoilerplate(isolate, - literals, - constant_properties, - should_have_fast_elements, - has_function_literal); - RETURN_IF_EMPTY_HANDLE(isolate, boilerplate); - // Update the functions literal and return the boilerplate. - literals->set(literals_index, *boilerplate); - } - return isolate->heap()->CopyJSObject(JSObject::cast(*boilerplate)); -} - - static Handle GetLiteralAllocationSite( Isolate* isolate, Handle literals, diff --git a/src/runtime.h b/src/runtime.h index 959d13f..64fade4 100644 --- a/src/runtime.h +++ b/src/runtime.h @@ -299,7 +299,6 @@ namespace internal { /* Literals */ \ F(MaterializeRegExpLiteral, 4, 1)\ F(CreateObjectLiteral, 4, 1) \ - F(CreateObjectLiteralShallow, 4, 1) \ F(CreateArrayLiteral, 3, 1) \ F(CreateArrayLiteralShallow, 3, 1) \ \ diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc index a201624..5112a31 100644 --- a/src/x64/code-stubs-x64.cc +++ b/src/x64/code-stubs-x64.cc @@ -78,7 +78,7 @@ void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( descriptor->register_param_count_ = 4; descriptor->register_params_ = registers; descriptor->deoptimization_handler_ = - Runtime::FunctionForId(Runtime::kCreateObjectLiteralShallow)->entry; + Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry; } diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc index c24512e..931a227 100644 --- a/src/x64/full-codegen-x64.cc +++ b/src/x64/full-codegen-x64.cc @@ -1609,21 +1609,15 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { : ObjectLiteral::kNoFlags; int properties_count = constant_properties->length() / 2; if ((FLAG_track_double_fields && expr->may_store_doubles()) || - expr->depth() > 1) { - __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); - __ push(FieldOperand(rdi, JSFunction::kLiteralsOffset)); - __ Push(Smi::FromInt(expr->literal_index())); - __ Push(constant_properties); - __ Push(Smi::FromInt(flags)); - __ CallRuntime(Runtime::kCreateObjectLiteral, 4); - } else if (Serializer::enabled() || flags != ObjectLiteral::kFastElements || + expr->depth() > 1 || Serializer::enabled() || + flags != ObjectLiteral::kFastElements || properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); __ push(FieldOperand(rdi, JSFunction::kLiteralsOffset)); __ Push(Smi::FromInt(expr->literal_index())); __ Push(constant_properties); __ Push(Smi::FromInt(flags)); - __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); + __ CallRuntime(Runtime::kCreateObjectLiteral, 4); } else { __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); __ movq(rax, FieldOperand(rdi, JSFunction::kLiteralsOffset)); -- 2.7.4