| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3669 } | 3669 } |
| 3670 | 3670 |
| 3671 | 3671 |
| 3672 void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) { | 3672 void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) { |
| 3673 ASSERT(ToRegister(instr->context()).is(esi)); | 3673 ASSERT(ToRegister(instr->context()).is(esi)); |
| 3674 // Setup the parameters to the stub/runtime call. | 3674 // Setup the parameters to the stub/runtime call. |
| 3675 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 3675 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
| 3676 __ push(FieldOperand(eax, JSFunction::kLiteralsOffset)); | 3676 __ push(FieldOperand(eax, JSFunction::kLiteralsOffset)); |
| 3677 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index()))); | 3677 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index()))); |
| 3678 __ push(Immediate(instr->hydrogen()->constant_properties())); | 3678 __ push(Immediate(instr->hydrogen()->constant_properties())); |
| 3679 __ push(Immediate(Smi::FromInt(instr->hydrogen()->fast_elements() ? 1 : 0))); | 3679 int flags = instr->hydrogen()->fast_elements() |
| 3680 ? ObjectLiteral::kFastElements |
| 3681 : ObjectLiteral::kNoFlags; |
| 3682 flags |= instr->hydrogen()->has_function() |
| 3683 ? ObjectLiteral::kHasFunction |
| 3684 : ObjectLiteral::kNoFlags; |
| 3685 __ push(Immediate(Smi::FromInt(flags))); |
| 3680 | 3686 |
| 3681 // Pick the right runtime function to call. | 3687 // Pick the right runtime function to call. |
| 3682 if (instr->hydrogen()->depth() > 1) { | 3688 if (instr->hydrogen()->depth() > 1) { |
| 3683 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr); | 3689 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr); |
| 3684 } else { | 3690 } else { |
| 3685 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr); | 3691 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr); |
| 3686 } | 3692 } |
| 3687 } | 3693 } |
| 3688 | 3694 |
| 3689 | 3695 |
| 3696 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { |
| 3697 ASSERT(ToRegister(instr->InputAt(0)).is(eax)); |
| 3698 __ push(eax); |
| 3699 CallRuntime(Runtime::kToFastProperties, 1, instr); |
| 3700 } |
| 3701 |
| 3702 |
| 3690 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { | 3703 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { |
| 3691 NearLabel materialized; | 3704 NearLabel materialized; |
| 3692 // Registers will be used as follows: | 3705 // Registers will be used as follows: |
| 3693 // edi = JS function. | 3706 // edi = JS function. |
| 3694 // ecx = literals array. | 3707 // ecx = literals array. |
| 3695 // ebx = regexp literal. | 3708 // ebx = regexp literal. |
| 3696 // eax = regexp literal clone. | 3709 // eax = regexp literal clone. |
| 3697 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 3710 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
| 3698 __ mov(ecx, FieldOperand(edi, JSFunction::kLiteralsOffset)); | 3711 __ mov(ecx, FieldOperand(edi, JSFunction::kLiteralsOffset)); |
| 3699 int literal_offset = FixedArray::kHeaderSize + | 3712 int literal_offset = FixedArray::kHeaderSize + |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3990 ASSERT(osr_pc_offset_ == -1); | 4003 ASSERT(osr_pc_offset_ == -1); |
| 3991 osr_pc_offset_ = masm()->pc_offset(); | 4004 osr_pc_offset_ = masm()->pc_offset(); |
| 3992 } | 4005 } |
| 3993 | 4006 |
| 3994 | 4007 |
| 3995 #undef __ | 4008 #undef __ |
| 3996 | 4009 |
| 3997 } } // namespace v8::internal | 4010 } } // namespace v8::internal |
| 3998 | 4011 |
| 3999 #endif // V8_TARGET_ARCH_IA32 | 4012 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |