Revision: 17470
Author: [email protected]
Date: Tue Nov 5 09:54:59 2013 UTC
Log: Remove CreateArrayLiteralShallow, as it's fundamentally the same
now as
CreateArrayLiteral.
[email protected]
Review URL: https://codereview.chromium.org/54333003
http://code.google.com/p/v8/source/detail?r=17470
Modified:
/branches/bleeding_edge/src/arm/code-stubs-arm.cc
/branches/bleeding_edge/src/arm/full-codegen-arm.cc
/branches/bleeding_edge/src/hydrogen.cc
/branches/bleeding_edge/src/ia32/code-stubs-ia32.cc
/branches/bleeding_edge/src/ia32/full-codegen-ia32.cc
/branches/bleeding_edge/src/mips/code-stubs-mips.cc
/branches/bleeding_edge/src/mips/full-codegen-mips.cc
/branches/bleeding_edge/src/objects.cc
/branches/bleeding_edge/src/runtime.cc
/branches/bleeding_edge/src/runtime.h
/branches/bleeding_edge/src/x64/code-stubs-x64.cc
/branches/bleeding_edge/src/x64/full-codegen-x64.cc
/branches/bleeding_edge/test/cctest/test-api.cc
=======================================
--- /branches/bleeding_edge/src/arm/code-stubs-arm.cc Tue Nov 5 09:00:00
2013 UTC
+++ /branches/bleeding_edge/src/arm/code-stubs-arm.cc Tue Nov 5 09:54:59
2013 UTC
@@ -77,7 +77,7 @@
descriptor->register_param_count_ = 3;
descriptor->register_params_ = registers;
descriptor->deoptimization_handler_ =
- Runtime::FunctionForId(Runtime::kCreateArrayLiteralShallow)->entry;
+ Runtime::FunctionForId(Runtime::kCreateArrayLiteral)->entry;
}
=======================================
--- /branches/bleeding_edge/src/arm/full-codegen-arm.cc Tue Nov 5 09:00:00
2013 UTC
+++ /branches/bleeding_edge/src/arm/full-codegen-arm.cc Tue Nov 5 09:54:59
2013 UTC
@@ -1790,13 +1790,11 @@
__ CallStub(&stub);
__ IncrementCounter(
isolate()->counters()->cow_arrays_created_stub(), 1, r1, r2);
- } else if (expr->depth() > 1) {
+ } else if (expr->depth() > 1 ||
+ Serializer::enabled() ||
+ length > FastCloneShallowArrayStub::kMaximumClonedLength) {
__ Push(r3, r2, r1);
__ CallRuntime(Runtime::kCreateArrayLiteral, 3);
- } else if (Serializer::enabled() ||
- length > FastCloneShallowArrayStub::kMaximumClonedLength) {
- __ Push(r3, r2, r1);
- __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3);
} else {
ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) ||
FLAG_smi_only_arrays);
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Tue Nov 5 08:56:48 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc Tue Nov 5 09:54:59 2013 UTC
@@ -4498,8 +4498,7 @@
// TODO(mvstanton): Consider a flag to turn off creation of any
// AllocationMementos for this call: we are in crankshaft and should
have
// learned enough about transition behavior to stop emitting mementos.
- Runtime::FunctionId function_id = (expr->depth() > 1)
- ? Runtime::kCreateArrayLiteral :
Runtime::kCreateArrayLiteralShallow;
+ Runtime::FunctionId function_id = Runtime::kCreateArrayLiteral;
literal = Add<HCallRuntime>(isolate()->factory()->empty_string(),
Runtime::FunctionForId(function_id),
3);
=======================================
--- /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Thu Oct 24 12:08:58
2013 UTC
+++ /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Tue Nov 5 09:54:59
2013 UTC
@@ -82,7 +82,7 @@
descriptor->register_param_count_ = 3;
descriptor->register_params_ = registers;
descriptor->deoptimization_handler_ =
- Runtime::FunctionForId(Runtime::kCreateArrayLiteralShallow)->entry;
+ Runtime::FunctionForId(Runtime::kCreateArrayLiteral)->entry;
}
=======================================
--- /branches/bleeding_edge/src/ia32/full-codegen-ia32.cc Wed Oct 23
13:48:04 2013 UTC
+++ /branches/bleeding_edge/src/ia32/full-codegen-ia32.cc Tue Nov 5
09:54:59 2013 UTC
@@ -1728,19 +1728,14 @@
DONT_TRACK_ALLOCATION_SITE,
length);
__ CallStub(&stub);
- } else if (expr->depth() > 1) {
+ } else if (expr->depth() > 1 ||
+ Serializer::enabled() ||
+ length > FastCloneShallowArrayStub::kMaximumClonedLength) {
__ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
__ push(FieldOperand(ebx, JSFunction::kLiteralsOffset));
__ push(Immediate(Smi::FromInt(expr->literal_index())));
__ push(Immediate(constant_elements));
__ CallRuntime(Runtime::kCreateArrayLiteral, 3);
- } else if (Serializer::enabled() ||
- length > FastCloneShallowArrayStub::kMaximumClonedLength) {
- __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
- __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset));
- __ push(Immediate(Smi::FromInt(expr->literal_index())));
- __ push(Immediate(constant_elements));
- __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3);
} else {
ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) ||
FLAG_smi_only_arrays);
=======================================
--- /branches/bleeding_edge/src/mips/code-stubs-mips.cc Thu Oct 24 12:08:58
2013 UTC
+++ /branches/bleeding_edge/src/mips/code-stubs-mips.cc Tue Nov 5 09:54:59
2013 UTC
@@ -78,7 +78,7 @@
descriptor->register_param_count_ = 3;
descriptor->register_params_ = registers;
descriptor->deoptimization_handler_ =
- Runtime::FunctionForId(Runtime::kCreateArrayLiteralShallow)->entry;
+ Runtime::FunctionForId(Runtime::kCreateArrayLiteral)->entry;
}
=======================================
--- /branches/bleeding_edge/src/mips/full-codegen-mips.cc Tue Nov 5
01:31:22 2013 UTC
+++ /branches/bleeding_edge/src/mips/full-codegen-mips.cc Tue Nov 5
09:54:59 2013 UTC
@@ -1793,13 +1793,11 @@
__ CallStub(&stub);
__ IncrementCounter(isolate()->counters()->cow_arrays_created_stub(),
1, a1, a2);
- } else if (expr->depth() > 1) {
+ } else if (expr->depth() > 1 ||
+ Serializer::enabled() ||
+ length > FastCloneShallowArrayStub::kMaximumClonedLength) {
__ Push(a3, a2, a1);
__ CallRuntime(Runtime::kCreateArrayLiteral, 3);
- } else if (Serializer::enabled() ||
- length > FastCloneShallowArrayStub::kMaximumClonedLength) {
- __ Push(a3, a2, a1);
- __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3);
} else {
ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) ||
FLAG_smi_only_arrays);
=======================================
--- /branches/bleeding_edge/src/objects.cc Tue Nov 5 09:40:36 2013 UTC
+++ /branches/bleeding_edge/src/objects.cc Tue Nov 5 09:54:59 2013 UTC
@@ -5837,7 +5837,9 @@
case FAST_HOLEY_ELEMENTS: {
Handle<FixedArray> elements(FixedArray::cast(copy->elements()));
if (elements->map() == isolate->heap()->fixed_cow_array_map()) {
- isolate->counters()->cow_arrays_created_runtime()->Increment();
+ if (copying) {
+ isolate->counters()->cow_arrays_created_runtime()->Increment();
+ }
#ifdef DEBUG
for (int i = 0; i < elements->length(); i++) {
ASSERT(!elements->get(i)->IsJSObject());
=======================================
--- /branches/bleeding_edge/src/runtime.cc Fri Oct 25 20:42:51 2013 UTC
+++ /branches/bleeding_edge/src/runtime.cc Tue Nov 5 09:54:59 2013 UTC
@@ -573,32 +573,6 @@
RETURN_IF_EMPTY_HANDLE(isolate, copy);
return *copy;
}
-
-
-RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateArrayLiteralShallow) {
- HandleScope scope(isolate);
- ASSERT(args.length() == 3);
- CONVERT_ARG_HANDLE_CHECKED(FixedArray, literals, 0);
- CONVERT_SMI_ARG_CHECKED(literals_index, 1);
- CONVERT_ARG_HANDLE_CHECKED(FixedArray, elements, 2);
-
- Handle<AllocationSite> site = GetLiteralAllocationSite(isolate, literals,
- literals_index, elements);
- RETURN_IF_EMPTY_HANDLE(isolate, site);
-
- JSObject* boilerplate = JSObject::cast(site->transition_info());
- if (boilerplate->elements()->map() ==
- isolate->heap()->fixed_cow_array_map()) {
- isolate->counters()->cow_arrays_created_runtime()->Increment();
- }
-
- if (AllocationSite::GetMode(boilerplate->GetElementsKind()) ==
- TRACK_ALLOCATION_SITE) {
- return isolate->heap()->CopyJSObject(boilerplate, *site);
- }
-
- return isolate->heap()->CopyJSObject(boilerplate);
-}
RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateSymbol) {
=======================================
--- /branches/bleeding_edge/src/runtime.h Mon Oct 14 14:15:22 2013 UTC
+++ /branches/bleeding_edge/src/runtime.h Tue Nov 5 09:54:59 2013 UTC
@@ -300,7 +300,6 @@
F(MaterializeRegExpLiteral, 4, 1)\
F(CreateObjectLiteral, 4, 1) \
F(CreateArrayLiteral, 3, 1) \
- F(CreateArrayLiteralShallow, 3, 1) \
\
/* Harmony generators */ \
F(CreateJSGeneratorObject, 0, 1) \
=======================================
--- /branches/bleeding_edge/src/x64/code-stubs-x64.cc Fri Oct 25 02:12:17
2013 UTC
+++ /branches/bleeding_edge/src/x64/code-stubs-x64.cc Tue Nov 5 09:54:59
2013 UTC
@@ -78,7 +78,7 @@
descriptor->register_param_count_ = 3;
descriptor->register_params_ = registers;
descriptor->deoptimization_handler_ =
- Runtime::FunctionForId(Runtime::kCreateArrayLiteralShallow)->entry;
+ Runtime::FunctionForId(Runtime::kCreateArrayLiteral)->entry;
}
=======================================
--- /branches/bleeding_edge/src/x64/full-codegen-x64.cc Wed Oct 23 13:48:04
2013 UTC
+++ /branches/bleeding_edge/src/x64/full-codegen-x64.cc Tue Nov 5 09:54:59
2013 UTC
@@ -1751,19 +1751,14 @@
DONT_TRACK_ALLOCATION_SITE,
length);
__ CallStub(&stub);
- } else if (expr->depth() > 1) {
+ } else if (expr->depth() > 1 ||
+ Serializer::enabled() ||
+ length > FastCloneShallowArrayStub::kMaximumClonedLength) {
__ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
__ push(FieldOperand(rbx, JSFunction::kLiteralsOffset));
__ Push(Smi::FromInt(expr->literal_index()));
__ Push(constant_elements);
__ CallRuntime(Runtime::kCreateArrayLiteral, 3);
- } else if (Serializer::enabled() ||
- length > FastCloneShallowArrayStub::kMaximumClonedLength) {
- __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
- __ push(FieldOperand(rbx, JSFunction::kLiteralsOffset));
- __ Push(Smi::FromInt(expr->literal_index()));
- __ Push(constant_elements);
- __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3);
} else {
ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) ||
FLAG_smi_only_arrays);
=======================================
--- /branches/bleeding_edge/test/cctest/test-api.cc Wed Oct 23 12:38:06
2013 UTC
+++ /branches/bleeding_edge/test/cctest/test-api.cc Tue Nov 5 09:54:59
2013 UTC
@@ -19813,6 +19813,34 @@
TEST(PrimaryStubCache) {
StubCacheHelper(false);
}
+
+
+static int cow_arrays_created_runtime = 0;
+
+
+static int* LookupCounterCOWArrays(const char* name) {
+ if (strcmp(name, "c:V8.COWArraysCreatedRuntime") == 0) {
+ return &cow_arrays_created_runtime;
+ }
+ return NULL;
+}
+
+
+TEST(CheckCOWArraysCreatedRuntimeCounter) {
+ V8::SetCounterFunction(LookupCounterCOWArrays);
+#ifdef DEBUG
+ i::FLAG_native_code_counters = true;
+ LocalContext env;
+ v8::HandleScope scope(env->GetIsolate());
+ int initial_cow_arrays = cow_arrays_created_runtime;
+ CompileRun("var o = [1, 2, 3];");
+ CHECK_EQ(1, cow_arrays_created_runtime - initial_cow_arrays);
+ CompileRun("var o = {foo: [4, 5, 6], bar: [3, 0]};");
+ CHECK_EQ(3, cow_arrays_created_runtime - initial_cow_arrays);
+ CompileRun("var o = {foo: [1, 2, 3, [4, 5, 6]], bar: 'hi'};");
+ CHECK_EQ(4, cow_arrays_created_runtime - initial_cow_arrays);
+#endif
+}
TEST(StaticGetters) {
--
--
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/groups/opt_out.