| 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 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1572 __ push(r1); | 1572 __ push(r1); |
| 1573 } else { | 1573 } else { |
| 1574 VisitForStackValue(expression); | 1574 VisitForStackValue(expression); |
| 1575 } | 1575 } |
| 1576 } | 1576 } |
| 1577 | 1577 |
| 1578 | 1578 |
| 1579 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { | 1579 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
| 1580 Comment cmnt(masm_, "[ ObjectLiteral"); | 1580 Comment cmnt(masm_, "[ ObjectLiteral"); |
| 1581 Handle<FixedArray> constant_properties = expr->constant_properties(); | 1581 Handle<FixedArray> constant_properties = expr->constant_properties(); |
| 1582 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1582 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 1583 __ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset)); | 1583 __ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset)); |
| 1584 __ mov(r2, Operand(Smi::FromInt(expr->literal_index()))); | 1584 __ mov(r2, Operand(Smi::FromInt(expr->literal_index()))); |
| 1585 __ mov(r1, Operand(constant_properties)); | 1585 __ mov(r1, Operand(constant_properties)); |
| 1586 int flags = expr->fast_elements() | 1586 int flags = expr->fast_elements() |
| 1587 ? ObjectLiteral::kFastElements | 1587 ? ObjectLiteral::kFastElements |
| 1588 : ObjectLiteral::kNoFlags; | 1588 : ObjectLiteral::kNoFlags; |
| 1589 flags |= expr->has_function() | 1589 flags |= expr->has_function() |
| 1590 ? ObjectLiteral::kHasFunction | 1590 ? ObjectLiteral::kHasFunction |
| 1591 : ObjectLiteral::kNoFlags; | 1591 : ObjectLiteral::kNoFlags; |
| 1592 __ mov(r0, Operand(Smi::FromInt(flags))); | 1592 __ mov(r0, Operand(Smi::FromInt(flags))); |
| 1593 __ Push(r3, r2, r1, r0); | |
| 1594 int properties_count = constant_properties->length() / 2; | 1593 int properties_count = constant_properties->length() / 2; |
| 1595 if (expr->depth() > 1) { | 1594 if (expr->depth() > 1) { |
| 1595 __ Push(r3, r2, r1, r0); |
| 1596 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); | 1596 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); |
| 1597 } else if (flags != ObjectLiteral::kFastElements || | 1597 } else if (Serializer::enabled() || flags != ObjectLiteral::kFastElements || |
| 1598 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { | 1598 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { |
| 1599 __ Push(r3, r2, r1, r0); |
| 1599 __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); | 1600 __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); |
| 1600 } else { | 1601 } else { |
| 1601 FastCloneShallowObjectStub stub(properties_count); | 1602 FastCloneShallowObjectStub stub(properties_count); |
| 1602 __ CallStub(&stub); | 1603 __ CallStub(&stub); |
| 1603 } | 1604 } |
| 1604 | 1605 |
| 1605 // If result_saved is true the result is on top of the stack. If | 1606 // If result_saved is true the result is on top of the stack. If |
| 1606 // result_saved is false the result is in r0. | 1607 // result_saved is false the result is in r0. |
| 1607 bool result_saved = false; | 1608 bool result_saved = false; |
| 1608 | 1609 |
| (...skipping 2953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4562 *context_length = 0; | 4563 *context_length = 0; |
| 4563 return previous_; | 4564 return previous_; |
| 4564 } | 4565 } |
| 4565 | 4566 |
| 4566 | 4567 |
| 4567 #undef __ | 4568 #undef __ |
| 4568 | 4569 |
| 4569 } } // namespace v8::internal | 4570 } } // namespace v8::internal |
| 4570 | 4571 |
| 4571 #endif // V8_TARGET_ARCH_ARM | 4572 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |