| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 masm_, kNoCodeAgeSequenceLength * Assembler::kInstrSize); | 168 masm_, kNoCodeAgeSequenceLength * Assembler::kInstrSize); |
| 169 // The following three instructions must remain together and unmodified | 169 // The following three instructions must remain together and unmodified |
| 170 // for code aging to work properly. | 170 // for code aging to work properly. |
| 171 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); | 171 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); |
| 172 // Load undefined value here, so the value is ready for the loop | 172 // Load undefined value here, so the value is ready for the loop |
| 173 // below. | 173 // below. |
| 174 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 174 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
| 175 // Adjust FP to point to saved FP. | 175 // Adjust FP to point to saved FP. |
| 176 __ add(fp, sp, Operand(2 * kPointerSize)); | 176 __ add(fp, sp, Operand(2 * kPointerSize)); |
| 177 } | 177 } |
| 178 info->AddNoFrameRange(0, masm_->pc_offset()); |
| 178 | 179 |
| 179 { Comment cmnt(masm_, "[ Allocate locals"); | 180 { Comment cmnt(masm_, "[ Allocate locals"); |
| 180 int locals_count = info->scope()->num_stack_slots(); | 181 int locals_count = info->scope()->num_stack_slots(); |
| 181 // Generators allocate locals, if any, in context slots. | 182 // Generators allocate locals, if any, in context slots. |
| 182 ASSERT(!info->function()->is_generator() || locals_count == 0); | 183 ASSERT(!info->function()->is_generator() || locals_count == 0); |
| 183 for (int i = 0; i < locals_count; i++) { | 184 for (int i = 0; i < locals_count; i++) { |
| 184 __ push(ip); | 185 __ push(ip); |
| 185 } | 186 } |
| 186 } | 187 } |
| 187 | 188 |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 // sequence. | 432 // sequence. |
| 432 { Assembler::BlockConstPoolScope block_const_pool(masm_); | 433 { Assembler::BlockConstPoolScope block_const_pool(masm_); |
| 433 // Here we use masm_-> instead of the __ macro to avoid the code coverage | 434 // Here we use masm_-> instead of the __ macro to avoid the code coverage |
| 434 // tool from instrumenting as we rely on the code size here. | 435 // tool from instrumenting as we rely on the code size here. |
| 435 int32_t sp_delta = (info_->scope()->num_parameters() + 1) * kPointerSize; | 436 int32_t sp_delta = (info_->scope()->num_parameters() + 1) * kPointerSize; |
| 436 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); | 437 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); |
| 437 // TODO(svenpanne) The code below is sometimes 4 words, sometimes 5! | 438 // TODO(svenpanne) The code below is sometimes 4 words, sometimes 5! |
| 438 PredictableCodeSizeScope predictable(masm_, -1); | 439 PredictableCodeSizeScope predictable(masm_, -1); |
| 439 __ RecordJSReturn(); | 440 __ RecordJSReturn(); |
| 440 masm_->mov(sp, fp); | 441 masm_->mov(sp, fp); |
| 442 int no_frame_start = masm_->pc_offset(); |
| 441 masm_->ldm(ia_w, sp, fp.bit() | lr.bit()); | 443 masm_->ldm(ia_w, sp, fp.bit() | lr.bit()); |
| 442 masm_->add(sp, sp, Operand(sp_delta)); | 444 masm_->add(sp, sp, Operand(sp_delta)); |
| 443 masm_->Jump(lr); | 445 masm_->Jump(lr); |
| 446 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); |
| 444 } | 447 } |
| 445 | 448 |
| 446 #ifdef DEBUG | 449 #ifdef DEBUG |
| 447 // Check that the size of the code used for returning is large enough | 450 // Check that the size of the code used for returning is large enough |
| 448 // for the debugger's requirements. | 451 // for the debugger's requirements. |
| 449 ASSERT(Assembler::kJSReturnSequenceInstructions <= | 452 ASSERT(Assembler::kJSReturnSequenceInstructions <= |
| 450 masm_->InstructionsGeneratedSince(&check_exit_codesize)); | 453 masm_->InstructionsGeneratedSince(&check_exit_codesize)); |
| 451 #endif | 454 #endif |
| 452 } | 455 } |
| 453 } | 456 } |
| (...skipping 4382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4836 *context_length = 0; | 4839 *context_length = 0; |
| 4837 return previous_; | 4840 return previous_; |
| 4838 } | 4841 } |
| 4839 | 4842 |
| 4840 | 4843 |
| 4841 #undef __ | 4844 #undef __ |
| 4842 | 4845 |
| 4843 } } // namespace v8::internal | 4846 } } // namespace v8::internal |
| 4844 | 4847 |
| 4845 #endif // V8_TARGET_ARCH_ARM | 4848 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |