OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 351 matching lines...) Loading... |
362 | 362 |
363 JSFunction* GetFunction() const { return function_; } | 363 JSFunction* GetFunction() const { return function_; } |
364 | 364 |
365 unsigned GetOffsetFromSlotIndex(Deoptimizer* deoptimizer, int slot_index); | 365 unsigned GetOffsetFromSlotIndex(Deoptimizer* deoptimizer, int slot_index); |
366 | 366 |
367 intptr_t GetFrameSlot(unsigned offset) { | 367 intptr_t GetFrameSlot(unsigned offset) { |
368 return *GetFrameSlotPointer(offset); | 368 return *GetFrameSlotPointer(offset); |
369 } | 369 } |
370 | 370 |
371 double GetDoubleFrameSlot(unsigned offset) { | 371 double GetDoubleFrameSlot(unsigned offset) { |
372 return *reinterpret_cast<double*>(GetFrameSlotPointer(offset)); | 372 intptr_t* ptr = GetFrameSlotPointer(offset); |
| 373 #if V8_TARGET_ARCH_MIPS |
| 374 // Prevent gcc from using load-double (mips ldc1) on (possibly) |
| 375 // non-64-bit aligned double. Uses two lwc1 instructions. |
| 376 union conversion { |
| 377 double d; |
| 378 uint32_t u[2]; |
| 379 } c; |
| 380 c.u[0] = *reinterpret_cast<uint32_t*>(ptr); |
| 381 c.u[1] = *(reinterpret_cast<uint32_t*>(ptr) + 1); |
| 382 return c.d; |
| 383 #else |
| 384 return *reinterpret_cast<double*>(ptr); |
| 385 #endif |
373 } | 386 } |
374 | 387 |
375 void SetFrameSlot(unsigned offset, intptr_t value) { | 388 void SetFrameSlot(unsigned offset, intptr_t value) { |
376 *GetFrameSlotPointer(offset) = value; | 389 *GetFrameSlotPointer(offset) = value; |
377 } | 390 } |
378 | 391 |
379 intptr_t GetRegister(unsigned n) const { | 392 intptr_t GetRegister(unsigned n) const { |
380 ASSERT(n < ARRAY_SIZE(registers_)); | 393 ASSERT(n < ARRAY_SIZE(registers_)); |
381 return registers_[n]; | 394 return registers_[n]; |
382 } | 395 } |
(...skipping 345 matching lines...) Loading... |
728 Object** parameters_; | 741 Object** parameters_; |
729 Object** expression_stack_; | 742 Object** expression_stack_; |
730 | 743 |
731 friend class Deoptimizer; | 744 friend class Deoptimizer; |
732 }; | 745 }; |
733 #endif | 746 #endif |
734 | 747 |
735 } } // namespace v8::internal | 748 } } // namespace v8::internal |
736 | 749 |
737 #endif // V8_DEOPTIMIZER_H_ | 750 #endif // V8_DEOPTIMIZER_H_ |
OLD | NEW |