| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 __ Br(continuation); | 328 __ Br(continuation); |
| 329 } | 329 } |
| 330 | 330 |
| 331 | 331 |
| 332 // Size of an entry of the second level deopt table. | 332 // Size of an entry of the second level deopt table. |
| 333 // This is the code size generated by GeneratePrologue for one entry. | 333 // This is the code size generated by GeneratePrologue for one entry. |
| 334 const int Deoptimizer::table_entry_size_ = 2 * kInstructionSize; | 334 const int Deoptimizer::table_entry_size_ = 2 * kInstructionSize; |
| 335 | 335 |
| 336 | 336 |
| 337 void Deoptimizer::TableEntryGenerator::GeneratePrologue() { | 337 void Deoptimizer::TableEntryGenerator::GeneratePrologue() { |
| 338 UseScratchRegisterScope temps(masm()); |
| 339 Register entry_id = temps.AcquireX(); |
| 340 |
| 338 // Create a sequence of deoptimization entries. | 341 // Create a sequence of deoptimization entries. |
| 339 // Note that registers are still live when jumping to an entry. | 342 // Note that registers are still live when jumping to an entry. |
| 340 Label done; | 343 Label done; |
| 341 { | 344 { |
| 342 InstructionAccurateScope scope(masm()); | 345 InstructionAccurateScope scope(masm()); |
| 343 | 346 |
| 344 // The number of entry will never exceed kMaxNumberOfEntries. | 347 // The number of entry will never exceed kMaxNumberOfEntries. |
| 345 // As long as kMaxNumberOfEntries is a valid 16 bits immediate you can use | 348 // As long as kMaxNumberOfEntries is a valid 16 bits immediate you can use |
| 346 // a movz instruction to load the entry id. | 349 // a movz instruction to load the entry id. |
| 347 ASSERT(is_uint16(Deoptimizer::kMaxNumberOfEntries)); | 350 ASSERT(is_uint16(Deoptimizer::kMaxNumberOfEntries)); |
| 348 | 351 |
| 349 for (int i = 0; i < count(); i++) { | 352 for (int i = 0; i < count(); i++) { |
| 350 int start = masm()->pc_offset(); | 353 int start = masm()->pc_offset(); |
| 351 USE(start); | 354 USE(start); |
| 352 __ movz(masm()->Tmp0(), i); | 355 __ movz(entry_id, i); |
| 353 __ b(&done); | 356 __ b(&done); |
| 354 ASSERT(masm()->pc_offset() - start == table_entry_size_); | 357 ASSERT(masm()->pc_offset() - start == table_entry_size_); |
| 355 } | 358 } |
| 356 } | 359 } |
| 357 __ Bind(&done); | 360 __ Bind(&done); |
| 358 // TODO(all): We need to add some kind of assertion to verify that Tmp0() | 361 __ Push(entry_id); |
| 359 // is not clobbered by Push. | |
| 360 __ Push(masm()->Tmp0()); | |
| 361 } | 362 } |
| 362 | 363 |
| 363 | 364 |
| 364 void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) { | 365 void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) { |
| 365 SetFrameSlot(offset, value); | 366 SetFrameSlot(offset, value); |
| 366 } | 367 } |
| 367 | 368 |
| 368 | 369 |
| 369 void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) { | 370 void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) { |
| 370 SetFrameSlot(offset, value); | 371 SetFrameSlot(offset, value); |
| 371 } | 372 } |
| 372 | 373 |
| 373 | 374 |
| 374 #undef __ | 375 #undef __ |
| 375 | 376 |
| 376 } } // namespace v8::internal | 377 } } // namespace v8::internal |
| OLD | NEW |