| Index: src/mips/full-codegen-mips.cc
|
| diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc
|
| index a9cf791d91867ea6fa7f8c5e669e281ac888fb5b..486eb9db2db7a9da86f06f3521a4bf692881a553 100644
|
| --- a/src/mips/full-codegen-mips.cc
|
| +++ b/src/mips/full-codegen-mips.cc
|
| @@ -1645,8 +1645,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();
|
| __ lw(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
|
| __ lw(a3, FieldMemOperand(a3, JSFunction::kLiteralsOffset));
|
| @@ -1661,7 +1660,7 @@ 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()) ||
|
| - depth > 1 || Serializer::enabled() ||
|
| + expr->depth() > 1 || Serializer::enabled() ||
|
| flags != ObjectLiteral::kFastElements ||
|
| properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) {
|
| __ Push(a3, a2, a1, a0);
|
| @@ -1780,8 +1779,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
|
| void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
| Comment cmnt(masm_, "[ ArrayLiteral");
|
|
|
| - int depth = 1;
|
| - expr->BuildConstantElements(isolate(), &depth);
|
| + expr->BuildConstantElements(isolate());
|
| ZoneList<Expression*>* subexprs = expr->values();
|
| int length = subexprs->length();
|
|
|
| @@ -1808,7 +1806,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
| __ CallStub(&stub);
|
| __ IncrementCounter(isolate()->counters()->cow_arrays_created_stub(),
|
| 1, a1, a2);
|
| - } else if (depth > 1 || Serializer::enabled() ||
|
| + } else if (expr->depth() > 1 || Serializer::enabled() ||
|
| length > FastCloneShallowArrayStub::kMaximumClonedLength) {
|
| __ Push(a3, a2, a1);
|
| __ CallRuntime(Runtime::kCreateArrayLiteral, 3);
|
| @@ -2916,7 +2914,7 @@ void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) {
|
| &if_true, &if_false, &fall_through);
|
|
|
| PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
|
| - __ And(t0, v0, Operand(kSmiTagMask));
|
| + __ SmiTst(v0, t0);
|
| Split(eq, t0, Operand(zero_reg), if_true, if_false, fall_through);
|
|
|
| context()->Plug(if_true, if_false);
|
| @@ -2937,7 +2935,7 @@ void FullCodeGenerator::EmitIsNonNegativeSmi(CallRuntime* expr) {
|
| &if_true, &if_false, &fall_through);
|
|
|
| PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
|
| - __ And(at, v0, Operand(kSmiTagMask | 0x80000000));
|
| + __ NonNegativeSmiTst(v0, at);
|
| Split(eq, at, Operand(zero_reg), if_true, if_false, fall_through);
|
|
|
| context()->Plug(if_true, if_false);
|
| @@ -3380,48 +3378,6 @@ void FullCodeGenerator::EmitLog(CallRuntime* expr) {
|
| }
|
|
|
|
|
| -void FullCodeGenerator::EmitRandomHeapNumber(CallRuntime* expr) {
|
| - ASSERT(expr->arguments()->length() == 0);
|
| - Label slow_allocate_heapnumber;
|
| - Label heapnumber_allocated;
|
| -
|
| - // Save the new heap number in callee-saved register s0, since
|
| - // we call out to external C code below.
|
| - __ LoadRoot(t6, Heap::kHeapNumberMapRootIndex);
|
| - __ AllocateHeapNumber(s0, a1, a2, t6, &slow_allocate_heapnumber);
|
| - __ jmp(&heapnumber_allocated);
|
| -
|
| - __ bind(&slow_allocate_heapnumber);
|
| -
|
| - // Allocate a heap number.
|
| - __ CallRuntime(Runtime::kNumberAlloc, 0);
|
| - __ mov(s0, v0); // Save result in s0, so it is saved thru CFunc call.
|
| -
|
| - __ bind(&heapnumber_allocated);
|
| -
|
| - // Convert 32 random bits in v0 to 0.(32 random bits) in a double
|
| - // by computing:
|
| - // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)).
|
| - __ PrepareCallCFunction(1, a0);
|
| - __ lw(a0, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
|
| - __ lw(a0, FieldMemOperand(a0, GlobalObject::kNativeContextOffset));
|
| - __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 1);
|
| -
|
| - // 0x41300000 is the top half of 1.0 x 2^20 as a double.
|
| - __ li(a1, Operand(0x41300000));
|
| - // Move 0x41300000xxxxxxxx (x = random bits in v0) to FPU.
|
| - __ Move(f12, v0, a1);
|
| - // Move 0x4130000000000000 to FPU.
|
| - __ Move(f14, zero_reg, a1);
|
| - // Subtract and store the result in the heap number.
|
| - __ sub_d(f0, f12, f14);
|
| - __ sdc1(f0, FieldMemOperand(s0, HeapNumber::kValueOffset));
|
| - __ mov(v0, s0);
|
| -
|
| - context()->Plug(v0);
|
| -}
|
| -
|
| -
|
| void FullCodeGenerator::EmitSubString(CallRuntime* expr) {
|
| // Load the arguments on the stack and call the stub.
|
| SubStringStub stub;
|
| @@ -3516,29 +3472,6 @@ void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
|
| }
|
|
|
|
|
| -void FullCodeGenerator::EmitSeqStringSetCharCheck(Register string,
|
| - Register index,
|
| - Register value,
|
| - uint32_t encoding_mask) {
|
| - __ And(at, index, Operand(kSmiTagMask));
|
| - __ Check(eq, kNonSmiIndex, at, Operand(zero_reg));
|
| - __ And(at, value, Operand(kSmiTagMask));
|
| - __ Check(eq, kNonSmiValue, at, Operand(zero_reg));
|
| -
|
| - __ lw(at, FieldMemOperand(string, String::kLengthOffset));
|
| - __ Check(lt, kIndexIsTooLarge, index, Operand(at));
|
| -
|
| - __ Check(ge, kIndexIsNegative, index, Operand(zero_reg));
|
| -
|
| - __ lw(at, FieldMemOperand(string, HeapObject::kMapOffset));
|
| - __ lbu(at, FieldMemOperand(at, Map::kInstanceTypeOffset));
|
| -
|
| - __ And(at, at, Operand(kStringRepresentationMask | kStringEncodingMask));
|
| - __ Subu(at, at, Operand(encoding_mask));
|
| - __ Check(eq, kUnexpectedStringType, at, Operand(zero_reg));
|
| -}
|
| -
|
| -
|
| void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) {
|
| ZoneList<Expression*>* args = expr->arguments();
|
| ASSERT_EQ(3, args->length());
|
| @@ -3549,12 +3482,20 @@ void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) {
|
|
|
| VisitForStackValue(args->at(1)); // index
|
| VisitForStackValue(args->at(2)); // value
|
| - __ Pop(index, value);
|
| VisitForAccumulatorValue(args->at(0)); // string
|
| + __ Pop(index, value);
|
|
|
| if (FLAG_debug_code) {
|
| + __ SmiTst(value, at);
|
| + __ ThrowIf(ne, kNonSmiValue, at, Operand(zero_reg));
|
| + __ SmiTst(index, at);
|
| + __ ThrowIf(ne, kNonSmiIndex, at, Operand(zero_reg));
|
| + __ SmiUntag(index, index);
|
| static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag;
|
| - EmitSeqStringSetCharCheck(string, index, value, one_byte_seq_type);
|
| + Register scratch = t5;
|
| + __ EmitSeqStringSetCharCheck(
|
| + string, index, value, scratch, one_byte_seq_type);
|
| + __ SmiTag(index, index);
|
| }
|
|
|
| __ SmiUntag(value, value);
|
| @@ -3578,12 +3519,20 @@ void FullCodeGenerator::EmitTwoByteSeqStringSetChar(CallRuntime* expr) {
|
|
|
| VisitForStackValue(args->at(1)); // index
|
| VisitForStackValue(args->at(2)); // value
|
| - __ Pop(index, value);
|
| VisitForAccumulatorValue(args->at(0)); // string
|
| + __ Pop(index, value);
|
|
|
| if (FLAG_debug_code) {
|
| + __ SmiTst(value, at);
|
| + __ ThrowIf(ne, kNonSmiValue, at, Operand(zero_reg));
|
| + __ SmiTst(index, at);
|
| + __ ThrowIf(ne, kNonSmiIndex, at, Operand(zero_reg));
|
| + __ SmiUntag(index, index);
|
| static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag;
|
| - EmitSeqStringSetCharCheck(string, index, value, two_byte_seq_type);
|
| + Register scratch = t5;
|
| + __ EmitSeqStringSetCharCheck(
|
| + string, index, value, scratch, two_byte_seq_type);
|
| + __ SmiTag(index, index);
|
| }
|
|
|
| __ SmiUntag(value, value);
|
|
|