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