OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 // the expression stack. | 325 // the expression stack. |
326 int stack_pointer = length - 1; | 326 int stack_pointer = length - 1; |
327 while (stack_pointer >= entry_frame_->expression_base_index() && | 327 while (stack_pointer >= entry_frame_->expression_base_index() && |
328 !entry_frame_->elements_[stack_pointer].is_synced()) { | 328 !entry_frame_->elements_[stack_pointer].is_synced()) { |
329 stack_pointer--; | 329 stack_pointer--; |
330 } | 330 } |
331 entry_frame_->stack_pointer_ = stack_pointer; | 331 entry_frame_->stack_pointer_ = stack_pointer; |
332 } | 332 } |
333 | 333 |
334 | 334 |
335 DeferredCode::DeferredCode() | 335 FrameRegisterState::FrameRegisterState(VirtualFrame* frame) { |
336 : masm_(CodeGeneratorScope::Current()->masm()), | |
337 statement_position_(masm_->current_statement_position()), | |
338 position_(masm_->current_position()) { | |
339 ASSERT(statement_position_ != RelocInfo::kNoPosition); | |
340 ASSERT(position_ != RelocInfo::kNoPosition); | |
341 | |
342 CodeGeneratorScope::Current()->AddDeferred(this); | |
343 #ifdef DEBUG | |
344 comment_ = ""; | |
345 #endif | |
346 | |
347 // Copy the register locations from the code generator's frame. | 336 // Copy the register locations from the code generator's frame. |
348 // These are the registers that will be spilled on entry to the | 337 // These are the registers that will be spilled on entry to the |
349 // deferred code and restored on exit. | 338 // deferred code and restored on exit. |
350 VirtualFrame* frame = CodeGeneratorScope::Current()->frame(); | |
351 int sp_offset = frame->fp_relative(frame->stack_pointer_); | 339 int sp_offset = frame->fp_relative(frame->stack_pointer_); |
352 for (int i = 0; i < RegisterAllocator::kNumRegisters; i++) { | 340 for (int i = 0; i < RegisterAllocator::kNumRegisters; i++) { |
353 int loc = frame->register_location(i); | 341 int loc = frame->register_location(i); |
354 if (loc == VirtualFrame::kIllegalIndex) { | 342 if (loc == VirtualFrame::kIllegalIndex) { |
355 registers_[i] = kIgnore; | 343 registers_[i] = kIgnore; |
356 } else if (frame->elements_[loc].is_synced()) { | 344 } else if (frame->elements_[loc].is_synced()) { |
357 // Needs to be restored on exit but not saved on entry. | 345 // Needs to be restored on exit but not saved on entry. |
358 registers_[i] = frame->fp_relative(loc) | kSyncedFlag; | 346 registers_[i] = frame->fp_relative(loc) | kSyncedFlag; |
359 } else { | 347 } else { |
360 int offset = frame->fp_relative(loc); | 348 int offset = frame->fp_relative(loc); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 // Branch to fall through will not negate, because it is a | 404 // Branch to fall through will not negate, because it is a |
417 // forward-only target. | 405 // forward-only target. |
418 fall_through.Branch(NegateCondition(cc), NegateHint(hint)); | 406 fall_through.Branch(NegateCondition(cc), NegateHint(hint)); |
419 Jump(); // May emit merge code here. | 407 Jump(); // May emit merge code here. |
420 fall_through.Bind(); | 408 fall_through.Bind(); |
421 } else { | 409 } else { |
422 DoBranch(cc, hint); | 410 DoBranch(cc, hint); |
423 } | 411 } |
424 } | 412 } |
425 | 413 |
| 414 |
| 415 DeferredCode::DeferredCode() |
| 416 : masm_(CodeGeneratorScope::Current()->masm()), |
| 417 statement_position_(masm_->current_statement_position()), |
| 418 position_(masm_->current_position()), |
| 419 frame_state_(CodeGeneratorScope::Current()->frame()) { |
| 420 ASSERT(statement_position_ != RelocInfo::kNoPosition); |
| 421 ASSERT(position_ != RelocInfo::kNoPosition); |
| 422 |
| 423 CodeGeneratorScope::Current()->AddDeferred(this); |
| 424 #ifdef DEBUG |
| 425 comment_ = ""; |
| 426 #endif |
| 427 } |
| 428 |
426 } } // namespace v8::internal | 429 } } // namespace v8::internal |
OLD | NEW |