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