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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
420 __ pop(r0); | 421 __ pop(r0); |
421 EmitProfilingCounterReset(); | 422 EmitProfilingCounterReset(); |
422 __ bind(&ok); | 423 __ bind(&ok); |
423 } | 424 } |
424 | 425 |
425 #ifdef DEBUG | 426 #ifdef DEBUG |
426 // Add a label for checking the size of the code used for returning. | 427 // Add a label for checking the size of the code used for returning. |
427 Label check_exit_codesize; | 428 Label check_exit_codesize; |
428 masm_->bind(&check_exit_codesize); | 429 masm_->bind(&check_exit_codesize); |
429 #endif | 430 #endif |
431 Label exit_codesize; | |
Jakob Kummerow
2013/05/14 12:38:51
I don't see what we need this label for.
yurys
2013/05/14 22:51:19
Removed. Thanks.
| |
432 masm_->bind(&exit_codesize); | |
430 // 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 |
431 // sequence. | 434 // sequence. |
432 { Assembler::BlockConstPoolScope block_const_pool(masm_); | 435 { Assembler::BlockConstPoolScope block_const_pool(masm_); |
433 // 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 |
434 // tool from instrumenting as we rely on the code size here. | 437 // tool from instrumenting as we rely on the code size here. |
435 int32_t sp_delta = (info_->scope()->num_parameters() + 1) * kPointerSize; | 438 int32_t sp_delta = (info_->scope()->num_parameters() + 1) * kPointerSize; |
436 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); | 439 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); |
437 // TODO(svenpanne) The code below is sometimes 4 words, sometimes 5! | 440 // TODO(svenpanne) The code below is sometimes 4 words, sometimes 5! |
438 PredictableCodeSizeScope predictable(masm_, -1); | 441 PredictableCodeSizeScope predictable(masm_, -1); |
439 __ RecordJSReturn(); | 442 __ RecordJSReturn(); |
440 masm_->mov(sp, fp); | 443 masm_->mov(sp, fp); |
444 int no_frame_start = masm_->pc_offset(); | |
441 masm_->ldm(ia_w, sp, fp.bit() | lr.bit()); | 445 masm_->ldm(ia_w, sp, fp.bit() | lr.bit()); |
442 masm_->add(sp, sp, Operand(sp_delta)); | 446 masm_->add(sp, sp, Operand(sp_delta)); |
443 masm_->Jump(lr); | 447 masm_->Jump(lr); |
448 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | |
444 } | 449 } |
445 | 450 |
446 #ifdef DEBUG | 451 #ifdef DEBUG |
447 // Check that the size of the code used for returning is large enough | 452 // Check that the size of the code used for returning is large enough |
448 // for the debugger's requirements. | 453 // for the debugger's requirements. |
449 ASSERT(Assembler::kJSReturnSequenceInstructions <= | 454 ASSERT(Assembler::kJSReturnSequenceInstructions <= |
450 masm_->InstructionsGeneratedSince(&check_exit_codesize)); | 455 masm_->InstructionsGeneratedSince(&check_exit_codesize)); |
451 #endif | 456 #endif |
452 } | 457 } |
453 } | 458 } |
(...skipping 4248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4702 *context_length = 0; | 4707 *context_length = 0; |
4703 return previous_; | 4708 return previous_; |
4704 } | 4709 } |
4705 | 4710 |
4706 | 4711 |
4707 #undef __ | 4712 #undef __ |
4708 | 4713 |
4709 } } // namespace v8::internal | 4714 } } // namespace v8::internal |
4710 | 4715 |
4711 #endif // V8_TARGET_ARCH_ARM | 4716 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |