| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 141 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
| 142 __ stop("stop-at"); | 142 __ stop("stop-at"); |
| 143 } | 143 } |
| 144 #endif | 144 #endif |
| 145 | 145 |
| 146 // Strict mode functions and builtins need to replace the receiver | 146 // Strict mode functions and builtins need to replace the receiver |
| 147 // with undefined when called as functions (without an explicit | 147 // with undefined when called as functions (without an explicit |
| 148 // receiver object). r5 is zero for method calls and non-zero for | 148 // receiver object). r5 is zero for method calls and non-zero for |
| 149 // function calls. | 149 // function calls. |
| 150 if (!info->is_classic_mode() || info->is_native()) { | 150 if (!info->is_classic_mode() || info->is_native()) { |
| 151 Label ok; | |
| 152 __ cmp(r5, Operand::Zero()); | 151 __ cmp(r5, Operand::Zero()); |
| 153 __ b(eq, &ok); | |
| 154 int receiver_offset = info->scope()->num_parameters() * kPointerSize; | 152 int receiver_offset = info->scope()->num_parameters() * kPointerSize; |
| 155 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); | 153 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); |
| 156 __ str(r2, MemOperand(sp, receiver_offset)); | 154 __ str(r2, MemOperand(sp, receiver_offset), ne); |
| 157 __ bind(&ok); | |
| 158 } | 155 } |
| 159 | 156 |
| 160 // Open a frame scope to indicate that there is a frame on the stack. The | 157 // Open a frame scope to indicate that there is a frame on the stack. The |
| 161 // MANUAL indicates that the scope shouldn't actually generate code to set up | 158 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 162 // the frame (that is done below). | 159 // the frame (that is done below). |
| 163 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 160 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
| 164 | 161 |
| 165 info->set_prologue_offset(masm_->pc_offset()); | 162 info->set_prologue_offset(masm_->pc_offset()); |
| 166 { | 163 __ Prologue(BUILD_FUNCTION_FRAME); |
| 167 PredictableCodeSizeScope predictible_code_size_scope( | |
| 168 masm_, kNoCodeAgeSequenceLength * Assembler::kInstrSize); | |
| 169 // The following three instructions must remain together and unmodified | |
| 170 // for code aging to work properly. | |
| 171 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); | |
| 172 __ nop(ip.code()); | |
| 173 // Adjust FP to point to saved FP. | |
| 174 __ add(fp, sp, Operand(2 * kPointerSize)); | |
| 175 } | |
| 176 info->AddNoFrameRange(0, masm_->pc_offset()); | 164 info->AddNoFrameRange(0, masm_->pc_offset()); |
| 177 | 165 |
| 178 { Comment cmnt(masm_, "[ Allocate locals"); | 166 { Comment cmnt(masm_, "[ Allocate locals"); |
| 179 int locals_count = info->scope()->num_stack_slots(); | 167 int locals_count = info->scope()->num_stack_slots(); |
| 180 // Generators allocate locals, if any, in context slots. | 168 // Generators allocate locals, if any, in context slots. |
| 181 ASSERT(!info->function()->is_generator() || locals_count == 0); | 169 ASSERT(!info->function()->is_generator() || locals_count == 0); |
| 182 if (locals_count > 0) { | 170 if (locals_count > 0) { |
| 183 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 171 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
| 184 for (int i = 0; i < locals_count; i++) { | 172 for (int i = 0; i < locals_count; i++) { |
| 185 __ push(ip); | 173 __ push(ip); |
| (...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1160 __ jmp(&exit); | 1148 __ jmp(&exit); |
| 1161 | 1149 |
| 1162 // We got a fixed array in register r0. Iterate through that. | 1150 // We got a fixed array in register r0. Iterate through that. |
| 1163 Label non_proxy; | 1151 Label non_proxy; |
| 1164 __ bind(&fixed_array); | 1152 __ bind(&fixed_array); |
| 1165 | 1153 |
| 1166 Handle<Cell> cell = isolate()->factory()->NewCell( | 1154 Handle<Cell> cell = isolate()->factory()->NewCell( |
| 1167 Handle<Object>(Smi::FromInt(TypeFeedbackCells::kForInFastCaseMarker), | 1155 Handle<Object>(Smi::FromInt(TypeFeedbackCells::kForInFastCaseMarker), |
| 1168 isolate())); | 1156 isolate())); |
| 1169 RecordTypeFeedbackCell(stmt->ForInFeedbackId(), cell); | 1157 RecordTypeFeedbackCell(stmt->ForInFeedbackId(), cell); |
| 1170 __ LoadHeapObject(r1, cell); | 1158 __ Move(r1, cell); |
| 1171 __ mov(r2, Operand(Smi::FromInt(TypeFeedbackCells::kForInSlowCaseMarker))); | 1159 __ mov(r2, Operand(Smi::FromInt(TypeFeedbackCells::kForInSlowCaseMarker))); |
| 1172 __ str(r2, FieldMemOperand(r1, Cell::kValueOffset)); | 1160 __ str(r2, FieldMemOperand(r1, Cell::kValueOffset)); |
| 1173 | 1161 |
| 1174 __ mov(r1, Operand(Smi::FromInt(1))); // Smi indicates slow check | 1162 __ mov(r1, Operand(Smi::FromInt(1))); // Smi indicates slow check |
| 1175 __ ldr(r2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object | 1163 __ ldr(r2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object |
| 1176 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); | 1164 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); |
| 1177 __ CompareObjectType(r2, r3, r3, LAST_JS_PROXY_TYPE); | 1165 __ CompareObjectType(r2, r3, r3, LAST_JS_PROXY_TYPE); |
| 1178 __ b(gt, &non_proxy); | 1166 __ b(gt, &non_proxy); |
| 1179 __ mov(r1, Operand(Smi::FromInt(0))); // Zero indicates proxy | 1167 __ mov(r1, Operand(Smi::FromInt(0))); // Zero indicates proxy |
| 1180 __ bind(&non_proxy); | 1168 __ bind(&non_proxy); |
| (...skipping 3790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4971 ASSERT(Memory::uint32_at(interrupt_address_pointer) == | 4959 ASSERT(Memory::uint32_at(interrupt_address_pointer) == |
| 4972 reinterpret_cast<uint32_t>( | 4960 reinterpret_cast<uint32_t>( |
| 4973 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4961 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 4974 return OSR_AFTER_STACK_CHECK; | 4962 return OSR_AFTER_STACK_CHECK; |
| 4975 } | 4963 } |
| 4976 | 4964 |
| 4977 | 4965 |
| 4978 } } // namespace v8::internal | 4966 } } // namespace v8::internal |
| 4979 | 4967 |
| 4980 #endif // V8_TARGET_ARCH_ARM | 4968 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |