OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1580 __ push(a1); | 1580 __ push(a1); |
1581 } else { | 1581 } else { |
1582 VisitForStackValue(expression); | 1582 VisitForStackValue(expression); |
1583 } | 1583 } |
1584 } | 1584 } |
1585 | 1585 |
1586 | 1586 |
1587 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { | 1587 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
1588 Comment cmnt(masm_, "[ ObjectLiteral"); | 1588 Comment cmnt(masm_, "[ ObjectLiteral"); |
1589 Handle<FixedArray> constant_properties = expr->constant_properties(); | 1589 Handle<FixedArray> constant_properties = expr->constant_properties(); |
1590 __ lw(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1590 __ lw(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
1591 __ lw(a3, FieldMemOperand(a3, JSFunction::kLiteralsOffset)); | 1591 __ lw(a3, FieldMemOperand(a3, JSFunction::kLiteralsOffset)); |
1592 __ li(a2, Operand(Smi::FromInt(expr->literal_index()))); | 1592 __ li(a2, Operand(Smi::FromInt(expr->literal_index()))); |
1593 __ li(a1, Operand(constant_properties)); | 1593 __ li(a1, Operand(constant_properties)); |
1594 int flags = expr->fast_elements() | 1594 int flags = expr->fast_elements() |
1595 ? ObjectLiteral::kFastElements | 1595 ? ObjectLiteral::kFastElements |
1596 : ObjectLiteral::kNoFlags; | 1596 : ObjectLiteral::kNoFlags; |
1597 flags |= expr->has_function() | 1597 flags |= expr->has_function() |
1598 ? ObjectLiteral::kHasFunction | 1598 ? ObjectLiteral::kHasFunction |
1599 : ObjectLiteral::kNoFlags; | 1599 : ObjectLiteral::kNoFlags; |
1600 __ li(a0, Operand(Smi::FromInt(flags))); | 1600 __ li(a0, Operand(Smi::FromInt(flags))); |
1601 __ Push(a3, a2, a1, a0); | |
1602 int properties_count = constant_properties->length() / 2; | 1601 int properties_count = constant_properties->length() / 2; |
1603 if (expr->depth() > 1) { | 1602 if (expr->depth() > 1) { |
| 1603 __ Push(a3, a2, a1, a0); |
1604 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); | 1604 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); |
1605 } else if (flags != ObjectLiteral::kFastElements || | 1605 } else if (Serializer::enabled() || flags != ObjectLiteral::kFastElements || |
1606 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { | 1606 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { |
| 1607 __ Push(a3, a2, a1, a0); |
1607 __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); | 1608 __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); |
1608 } else { | 1609 } else { |
1609 FastCloneShallowObjectStub stub(properties_count); | 1610 FastCloneShallowObjectStub stub(properties_count); |
1610 __ CallStub(&stub); | 1611 __ CallStub(&stub); |
1611 } | 1612 } |
1612 | 1613 |
1613 // If result_saved is true the result is on top of the stack. If | 1614 // If result_saved is true the result is on top of the stack. If |
1614 // result_saved is false the result is in v0. | 1615 // result_saved is false the result is in v0. |
1615 bool result_saved = false; | 1616 bool result_saved = false; |
1616 | 1617 |
(...skipping 2971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4588 *context_length = 0; | 4589 *context_length = 0; |
4589 return previous_; | 4590 return previous_; |
4590 } | 4591 } |
4591 | 4592 |
4592 | 4593 |
4593 #undef __ | 4594 #undef __ |
4594 | 4595 |
4595 } } // namespace v8::internal | 4596 } } // namespace v8::internal |
4596 | 4597 |
4597 #endif // V8_TARGET_ARCH_MIPS | 4598 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |