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