| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 // There are no translation commands for the caller's pc and fp, the | 189 // There are no translation commands for the caller's pc and fp, the |
| 190 // context, and the function. Synthesize their values and set them up | 190 // context, and the function. Synthesize their values and set them up |
| 191 // explicitly. | 191 // explicitly. |
| 192 // | 192 // |
| 193 // The caller's pc for the bottommost output frame is the same as in the | 193 // The caller's pc for the bottommost output frame is the same as in the |
| 194 // input frame. For all subsequent output frames, it can be read from the | 194 // input frame. For all subsequent output frames, it can be read from the |
| 195 // previous one. This frame's pc can be computed from the non-optimized | 195 // previous one. This frame's pc can be computed from the non-optimized |
| 196 // function code and AST id of the bailout. | 196 // function code and AST id of the bailout. |
| 197 output_offset -= kPointerSize; | 197 output_offset -= kPointerSize; |
| 198 input_offset -= kPointerSize; | 198 input_offset -= kPointerSize; |
| 199 uint32_t value; | 199 intptr_t value; |
| 200 if (is_bottommost) { | 200 if (is_bottommost) { |
| 201 value = input_->GetFrameSlot(input_offset); | 201 value = input_->GetFrameSlot(input_offset); |
| 202 } else { | 202 } else { |
| 203 value = output_[frame_index - 1]->GetPc(); | 203 value = output_[frame_index - 1]->GetPc(); |
| 204 } | 204 } |
| 205 output_frame->SetFrameSlot(output_offset, value); | 205 output_frame->SetFrameSlot(output_offset, value); |
| 206 if (FLAG_trace_deopt) { | 206 if (FLAG_trace_deopt) { |
| 207 PrintF(" 0x%08x: [top + %d] <- 0x%08x ; caller's pc\n", | 207 PrintF(" 0x%08x: [top + %d] <- 0x%08x ; caller's pc\n", |
| 208 top_address + output_offset, output_offset, value); | 208 top_address + output_offset, output_offset, value); |
| 209 } | 209 } |
| 210 | 210 |
| 211 // The caller's frame pointer for the bottommost output frame is the same | 211 // The caller's frame pointer for the bottommost output frame is the same |
| 212 // as in the input frame. For all subsequent output frames, it can be | 212 // as in the input frame. For all subsequent output frames, it can be |
| 213 // read from the previous one. Also compute and set this frame's frame | 213 // read from the previous one. Also compute and set this frame's frame |
| 214 // pointer. | 214 // pointer. |
| 215 output_offset -= kPointerSize; | 215 output_offset -= kPointerSize; |
| 216 input_offset -= kPointerSize; | 216 input_offset -= kPointerSize; |
| 217 if (is_bottommost) { | 217 if (is_bottommost) { |
| 218 value = input_->GetFrameSlot(input_offset); | 218 value = input_->GetFrameSlot(input_offset); |
| 219 } else { | 219 } else { |
| 220 value = output_[frame_index - 1]->GetFp(); | 220 value = output_[frame_index - 1]->GetFp(); |
| 221 } | 221 } |
| 222 output_frame->SetFrameSlot(output_offset, value); | 222 output_frame->SetFrameSlot(output_offset, value); |
| 223 unsigned fp_value = top_address + output_offset; | 223 intptr_t fp_value = top_address + output_offset; |
| 224 ASSERT(!is_bottommost || input_->GetRegister(fp.code()) == fp_value); | 224 ASSERT(!is_bottommost || input_->GetRegister(fp.code()) == fp_value); |
| 225 output_frame->SetFp(fp_value); | 225 output_frame->SetFp(fp_value); |
| 226 if (is_topmost) { | 226 if (is_topmost) { |
| 227 output_frame->SetRegister(fp.code(), fp_value); | 227 output_frame->SetRegister(fp.code(), fp_value); |
| 228 } | 228 } |
| 229 if (FLAG_trace_deopt) { | 229 if (FLAG_trace_deopt) { |
| 230 PrintF(" 0x%08x: [top + %d] <- 0x%08x ; caller's fp\n", | 230 PrintF(" 0x%08x: [top + %d] <- 0x%08x ; caller's fp\n", |
| 231 fp_value, output_offset, value); | 231 fp_value, output_offset, value); |
| 232 } | 232 } |
| 233 | 233 |
| 234 // The context can be gotten from the function so long as we don't | 234 // The context can be gotten from the function so long as we don't |
| 235 // optimize functions that need local contexts. | 235 // optimize functions that need local contexts. |
| 236 output_offset -= kPointerSize; | 236 output_offset -= kPointerSize; |
| 237 input_offset -= kPointerSize; | 237 input_offset -= kPointerSize; |
| 238 value = reinterpret_cast<uint32_t>(function->context()); | 238 value = reinterpret_cast<intptr_t>(function->context()); |
| 239 // The context for the bottommost output frame should also agree with the | 239 // The context for the bottommost output frame should also agree with the |
| 240 // input frame. | 240 // input frame. |
| 241 ASSERT(!is_bottommost || input_->GetFrameSlot(input_offset) == value); | 241 ASSERT(!is_bottommost || input_->GetFrameSlot(input_offset) == value); |
| 242 output_frame->SetFrameSlot(output_offset, value); | 242 output_frame->SetFrameSlot(output_offset, value); |
| 243 if (is_topmost) { | 243 if (is_topmost) { |
| 244 output_frame->SetRegister(cp.code(), value); | 244 output_frame->SetRegister(cp.code(), value); |
| 245 } | 245 } |
| 246 if (FLAG_trace_deopt) { | 246 if (FLAG_trace_deopt) { |
| 247 PrintF(" 0x%08x: [top + %d] <- 0x%08x ; context\n", | 247 PrintF(" 0x%08x: [top + %d] <- 0x%08x ; context\n", |
| 248 top_address + output_offset, output_offset, value); | 248 top_address + output_offset, output_offset, value); |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 __ push(ip); | 494 __ push(ip); |
| 495 __ b(&done); | 495 __ b(&done); |
| 496 ASSERT(masm()->pc_offset() - start == table_entry_size_); | 496 ASSERT(masm()->pc_offset() - start == table_entry_size_); |
| 497 } | 497 } |
| 498 __ bind(&done); | 498 __ bind(&done); |
| 499 } | 499 } |
| 500 | 500 |
| 501 #undef __ | 501 #undef __ |
| 502 | 502 |
| 503 } } // namespace v8::internal | 503 } } // namespace v8::internal |
| OLD | NEW |