| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 172 |
| 173 info->set_prologue_offset(masm_->pc_offset()); | 173 info->set_prologue_offset(masm_->pc_offset()); |
| 174 // The following three instructions must remain together and unmodified for | 174 // The following three instructions must remain together and unmodified for |
| 175 // code aging to work properly. | 175 // code aging to work properly. |
| 176 __ Push(ra, fp, cp, a1); | 176 __ Push(ra, fp, cp, a1); |
| 177 // Load undefined value here, so the value is ready for the loop | 177 // Load undefined value here, so the value is ready for the loop |
| 178 // below. | 178 // below. |
| 179 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 179 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
| 180 // Adjust fp to point to caller's fp. | 180 // Adjust fp to point to caller's fp. |
| 181 __ Addu(fp, sp, Operand(2 * kPointerSize)); | 181 __ Addu(fp, sp, Operand(2 * kPointerSize)); |
| 182 info->AddNoFrameRange(0, masm_->pc_offset()); |
| 182 | 183 |
| 183 { Comment cmnt(masm_, "[ Allocate locals"); | 184 { Comment cmnt(masm_, "[ Allocate locals"); |
| 184 int locals_count = info->scope()->num_stack_slots(); | 185 int locals_count = info->scope()->num_stack_slots(); |
| 185 // Generators allocate locals, if any, in context slots. | 186 // Generators allocate locals, if any, in context slots. |
| 186 ASSERT(!info->function()->is_generator() || locals_count == 0); | 187 ASSERT(!info->function()->is_generator() || locals_count == 0); |
| 187 for (int i = 0; i < locals_count; i++) { | 188 for (int i = 0; i < locals_count; i++) { |
| 188 __ push(at); | 189 __ push(at); |
| 189 } | 190 } |
| 190 } | 191 } |
| 191 | 192 |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 #endif | 432 #endif |
| 432 // Make sure that the constant pool is not emitted inside of the return | 433 // Make sure that the constant pool is not emitted inside of the return |
| 433 // sequence. | 434 // sequence. |
| 434 { Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); | 435 { Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); |
| 435 // Here we use masm_-> instead of the __ macro to avoid the code coverage | 436 // Here we use masm_-> instead of the __ macro to avoid the code coverage |
| 436 // tool from instrumenting as we rely on the code size here. | 437 // tool from instrumenting as we rely on the code size here. |
| 437 int32_t sp_delta = (info_->scope()->num_parameters() + 1) * kPointerSize; | 438 int32_t sp_delta = (info_->scope()->num_parameters() + 1) * kPointerSize; |
| 438 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); | 439 CodeGenerator::RecordPositions(masm_, function()->end_position() - 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_->MultiPop(static_cast<RegList>(fp.bit() | ra.bit())); | 443 masm_->MultiPop(static_cast<RegList>(fp.bit() | ra.bit())); |
| 442 masm_->Addu(sp, sp, Operand(sp_delta)); | 444 masm_->Addu(sp, sp, Operand(sp_delta)); |
| 443 masm_->Jump(ra); | 445 masm_->Jump(ra); |
| 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 4302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4756 *context_length = 0; | 4759 *context_length = 0; |
| 4757 return previous_; | 4760 return previous_; |
| 4758 } | 4761 } |
| 4759 | 4762 |
| 4760 | 4763 |
| 4761 #undef __ | 4764 #undef __ |
| 4762 | 4765 |
| 4763 } } // namespace v8::internal | 4766 } } // namespace v8::internal |
| 4764 | 4767 |
| 4765 #endif // V8_TARGET_ARCH_MIPS | 4768 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |