| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 __ mov(r1, Operand(expr->flags())); | 776 __ mov(r1, Operand(expr->flags())); |
| 777 __ stm(db_w, sp, r4.bit() | r3.bit() | r2.bit() | r1.bit()); | 777 __ stm(db_w, sp, r4.bit() | r3.bit() | r2.bit() | r1.bit()); |
| 778 __ CallRuntime(Runtime::kMaterializeRegExpLiteral, 4); | 778 __ CallRuntime(Runtime::kMaterializeRegExpLiteral, 4); |
| 779 __ bind(&done); | 779 __ bind(&done); |
| 780 Apply(context_, r0); | 780 Apply(context_, r0); |
| 781 } | 781 } |
| 782 | 782 |
| 783 | 783 |
| 784 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { | 784 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
| 785 Comment cmnt(masm_, "[ ObjectLiteral"); | 785 Comment cmnt(masm_, "[ ObjectLiteral"); |
| 786 __ ldr(r2, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 786 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 787 __ ldr(r2, FieldMemOperand(r2, JSFunction::kLiteralsOffset)); | 787 __ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset)); |
| 788 __ mov(r1, Operand(Smi::FromInt(expr->literal_index()))); | 788 __ mov(r2, Operand(Smi::FromInt(expr->literal_index()))); |
| 789 __ mov(r0, Operand(expr->constant_properties())); | 789 __ mov(r1, Operand(expr->constant_properties())); |
| 790 __ stm(db_w, sp, r2.bit() | r1.bit() | r0.bit()); | 790 __ mov(r0, Operand(Smi::FromInt(expr->fast_elements() ? 1 : 0))); |
| 791 __ stm(db_w, sp, r3.bit() | r2.bit() | r1.bit() | r0.bit()); |
| 791 if (expr->depth() > 1) { | 792 if (expr->depth() > 1) { |
| 792 __ CallRuntime(Runtime::kCreateObjectLiteral, 3); | 793 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); |
| 793 } else { | 794 } else { |
| 794 __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 3); | 795 __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); |
| 795 } | 796 } |
| 796 | 797 |
| 797 // If result_saved is true the result is on top of the stack. If | 798 // If result_saved is true the result is on top of the stack. If |
| 798 // result_saved is false the result is in r0. | 799 // result_saved is false the result is in r0. |
| 799 bool result_saved = false; | 800 bool result_saved = false; |
| 800 | 801 |
| 801 for (int i = 0; i < expr->properties()->length(); i++) { | 802 for (int i = 0; i < expr->properties()->length(); i++) { |
| 802 ObjectLiteral::Property* property = expr->properties()->at(i); | 803 ObjectLiteral::Property* property = expr->properties()->at(i); |
| 803 if (property->IsCompileTimeValue()) continue; | 804 if (property->IsCompileTimeValue()) continue; |
| 804 | 805 |
| (...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1858 __ pop(result_register()); | 1859 __ pop(result_register()); |
| 1859 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); | 1860 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); |
| 1860 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 1861 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
| 1861 __ add(pc, r1, Operand(masm_->CodeObject())); | 1862 __ add(pc, r1, Operand(masm_->CodeObject())); |
| 1862 } | 1863 } |
| 1863 | 1864 |
| 1864 | 1865 |
| 1865 #undef __ | 1866 #undef __ |
| 1866 | 1867 |
| 1867 } } // namespace v8::internal | 1868 } } // namespace v8::internal |
| OLD | NEW |