| Index: src/x64/full-codegen-x64.cc
|
| diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
|
| index 8947e2f84c045e795cec832103ca3c0af43dc0c9..ed4c3adbce39d644eb34d06be4030fa62ccbedee 100644
|
| --- a/src/x64/full-codegen-x64.cc
|
| +++ b/src/x64/full-codegen-x64.cc
|
| @@ -1596,8 +1596,7 @@ void FullCodeGenerator::EmitAccessor(Expression* expression) {
|
| void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
|
| Comment cmnt(masm_, "[ ObjectLiteral");
|
|
|
| - int depth = 1;
|
| - expr->BuildConstantProperties(isolate(), &depth);
|
| + expr->BuildConstantProperties(isolate());
|
| Handle<FixedArray> constant_properties = expr->constant_properties();
|
| int flags = expr->fast_elements()
|
| ? ObjectLiteral::kFastElements
|
| @@ -1607,7 +1606,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
|
| : ObjectLiteral::kNoFlags;
|
| int properties_count = constant_properties->length() / 2;
|
| if ((FLAG_track_double_fields && expr->may_store_doubles()) ||
|
| - depth > 1 || Serializer::enabled() ||
|
| + expr->depth() > 1 || Serializer::enabled() ||
|
| flags != ObjectLiteral::kFastElements ||
|
| properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) {
|
| __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
|
| @@ -1726,8 +1725,11 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
|
| void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
| Comment cmnt(masm_, "[ ArrayLiteral");
|
|
|
| - int depth = 1;
|
| - expr->BuildConstantElements(isolate(), &depth);
|
| + expr->BuildConstantElements(isolate());
|
| + int flags = expr->depth() == 1
|
| + ? ArrayLiteral::kShallowElements
|
| + : ArrayLiteral::kNoFlags;
|
| +
|
| ZoneList<Expression*>* subexprs = expr->values();
|
| int length = subexprs->length();
|
| Handle<FixedArray> constant_elements = expr->constant_elements();
|
| @@ -1754,13 +1756,14 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
| DONT_TRACK_ALLOCATION_SITE,
|
| length);
|
| __ CallStub(&stub);
|
| - } else if (depth > 1 || Serializer::enabled() ||
|
| + } 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);
|
| + __ Push(Smi::FromInt(flags));
|
| + __ CallRuntime(Runtime::kCreateArrayLiteral, 4);
|
| } else {
|
| ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) ||
|
| FLAG_smi_only_arrays);
|
| @@ -3273,47 +3276,6 @@ void FullCodeGenerator::EmitLog(CallRuntime* expr) {
|
| }
|
|
|
|
|
| -void FullCodeGenerator::EmitRandomHeapNumber(CallRuntime* expr) {
|
| - ASSERT(expr->arguments()->length() == 0);
|
| -
|
| - Label slow_allocate_heapnumber;
|
| - Label heapnumber_allocated;
|
| -
|
| - __ AllocateHeapNumber(rbx, rcx, &slow_allocate_heapnumber);
|
| - __ jmp(&heapnumber_allocated);
|
| -
|
| - __ bind(&slow_allocate_heapnumber);
|
| - // Allocate a heap number.
|
| - __ CallRuntime(Runtime::kNumberAlloc, 0);
|
| - __ movq(rbx, rax);
|
| -
|
| - __ bind(&heapnumber_allocated);
|
| -
|
| - // Return a random uint32 number in rax.
|
| - // The fresh HeapNumber is in rbx, which is callee-save on both x64 ABIs.
|
| - __ PrepareCallCFunction(1);
|
| - __ movq(arg_reg_1,
|
| - ContextOperand(context_register(), Context::GLOBAL_OBJECT_INDEX));
|
| - __ movq(arg_reg_1,
|
| - FieldOperand(arg_reg_1, GlobalObject::kNativeContextOffset));
|
| - __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 1);
|
| -
|
| - // Convert 32 random bits in rax to 0.(32 random bits) in a double
|
| - // by computing:
|
| - // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)).
|
| - __ movl(rcx, Immediate(0x49800000)); // 1.0 x 2^20 as single.
|
| - __ movd(xmm1, rcx);
|
| - __ movd(xmm0, rax);
|
| - __ cvtss2sd(xmm1, xmm1);
|
| - __ xorps(xmm0, xmm1);
|
| - __ subsd(xmm0, xmm1);
|
| - __ movsd(FieldOperand(rbx, HeapNumber::kValueOffset), xmm0);
|
| -
|
| - __ movq(rax, rbx);
|
| - context()->Plug(rax);
|
| -}
|
| -
|
| -
|
| void FullCodeGenerator::EmitSubString(CallRuntime* expr) {
|
| // Load the arguments on the stack and call the stub.
|
| SubStringStub stub;
|
|
|