| 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 // There are no translation commands for the caller's pc and fp, the | 347 // There are no translation commands for the caller's pc and fp, the |
| 348 // context, and the function. Synthesize their values and set them up | 348 // context, and the function. Synthesize their values and set them up |
| 349 // explicitly. | 349 // explicitly. |
| 350 // | 350 // |
| 351 // The caller's pc for the bottommost output frame is the same as in the | 351 // The caller's pc for the bottommost output frame is the same as in the |
| 352 // input frame. For all subsequent output frames, it can be read from the | 352 // input frame. For all subsequent output frames, it can be read from the |
| 353 // previous one. This frame's pc can be computed from the non-optimized | 353 // previous one. This frame's pc can be computed from the non-optimized |
| 354 // function code and AST id of the bailout. | 354 // function code and AST id of the bailout. |
| 355 output_offset -= kPointerSize; | 355 output_offset -= kPointerSize; |
| 356 input_offset -= kPointerSize; | 356 input_offset -= kPointerSize; |
| 357 uint32_t value; | 357 intptr_t value; |
| 358 if (is_bottommost) { | 358 if (is_bottommost) { |
| 359 value = input_->GetFrameSlot(input_offset); | 359 value = input_->GetFrameSlot(input_offset); |
| 360 } else { | 360 } else { |
| 361 value = output_[frame_index - 1]->GetPc(); | 361 value = output_[frame_index - 1]->GetPc(); |
| 362 } | 362 } |
| 363 output_frame->SetFrameSlot(output_offset, value); | 363 output_frame->SetFrameSlot(output_offset, value); |
| 364 if (FLAG_trace_deopt) { | 364 if (FLAG_trace_deopt) { |
| 365 PrintF(" 0x%08x: [top + %d] <- 0x%08x ; caller's pc\n", | 365 PrintF(" 0x%08x: [top + %d] <- 0x%08x ; caller's pc\n", |
| 366 top_address + output_offset, output_offset, value); | 366 top_address + output_offset, output_offset, value); |
| 367 } | 367 } |
| 368 | 368 |
| 369 // The caller's frame pointer for the bottommost output frame is the same | 369 // The caller's frame pointer for the bottommost output frame is the same |
| 370 // as in the input frame. For all subsequent output frames, it can be | 370 // as in the input frame. For all subsequent output frames, it can be |
| 371 // read from the previous one. Also compute and set this frame's frame | 371 // read from the previous one. Also compute and set this frame's frame |
| 372 // pointer. | 372 // pointer. |
| 373 output_offset -= kPointerSize; | 373 output_offset -= kPointerSize; |
| 374 input_offset -= kPointerSize; | 374 input_offset -= kPointerSize; |
| 375 if (is_bottommost) { | 375 if (is_bottommost) { |
| 376 value = input_->GetFrameSlot(input_offset); | 376 value = input_->GetFrameSlot(input_offset); |
| 377 } else { | 377 } else { |
| 378 value = output_[frame_index - 1]->GetFp(); | 378 value = output_[frame_index - 1]->GetFp(); |
| 379 } | 379 } |
| 380 output_frame->SetFrameSlot(output_offset, value); | 380 output_frame->SetFrameSlot(output_offset, value); |
| 381 unsigned fp_value = top_address + output_offset; | 381 intptr_t fp_value = top_address + output_offset; |
| 382 ASSERT(!is_bottommost || input_->GetRegister(ebp.code()) == fp_value); | 382 ASSERT(!is_bottommost || input_->GetRegister(ebp.code()) == fp_value); |
| 383 output_frame->SetFp(fp_value); | 383 output_frame->SetFp(fp_value); |
| 384 if (is_topmost) output_frame->SetRegister(ebp.code(), fp_value); | 384 if (is_topmost) output_frame->SetRegister(ebp.code(), fp_value); |
| 385 if (FLAG_trace_deopt) { | 385 if (FLAG_trace_deopt) { |
| 386 PrintF(" 0x%08x: [top + %d] <- 0x%08x ; caller's fp\n", | 386 PrintF(" 0x%08x: [top + %d] <- 0x%08x ; caller's fp\n", |
| 387 fp_value, output_offset, value); | 387 fp_value, output_offset, value); |
| 388 } | 388 } |
| 389 | 389 |
| 390 // The context can be gotten from the function so long as we don't | 390 // The context can be gotten from the function so long as we don't |
| 391 // optimize functions that need local contexts. | 391 // optimize functions that need local contexts. |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 __ jmp(&done); | 609 __ jmp(&done); |
| 610 ASSERT(masm()->pc_offset() - start == table_entry_size_); | 610 ASSERT(masm()->pc_offset() - start == table_entry_size_); |
| 611 } | 611 } |
| 612 __ bind(&done); | 612 __ bind(&done); |
| 613 } | 613 } |
| 614 | 614 |
| 615 #undef __ | 615 #undef __ |
| 616 | 616 |
| 617 | 617 |
| 618 } } // namespace v8::internal | 618 } } // namespace v8::internal |
| OLD | NEW |