| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 JSFunction* function); | 301 JSFunction* function); |
| 302 | 302 |
| 303 void* operator new(size_t size, uint32_t frame_size) { | 303 void* operator new(size_t size, uint32_t frame_size) { |
| 304 return malloc(size + frame_size); | 304 return malloc(size + frame_size); |
| 305 } | 305 } |
| 306 | 306 |
| 307 void operator delete(void* description) { | 307 void operator delete(void* description) { |
| 308 free(description); | 308 free(description); |
| 309 } | 309 } |
| 310 | 310 |
| 311 uint32_t GetFrameSize() const { return frame_size_; } | 311 intptr_t GetFrameSize() const { return frame_size_; } |
| 312 | 312 |
| 313 JSFunction* GetFunction() const { return function_; } | 313 JSFunction* GetFunction() const { return function_; } |
| 314 | 314 |
| 315 unsigned GetOffsetFromSlotIndex(Deoptimizer* deoptimizer, int slot_index); | 315 unsigned GetOffsetFromSlotIndex(Deoptimizer* deoptimizer, int slot_index); |
| 316 | 316 |
| 317 uint32_t GetFrameSlot(unsigned offset) { | 317 intptr_t GetFrameSlot(unsigned offset) { |
| 318 return *GetFrameSlotPointer(offset); | 318 return *GetFrameSlotPointer(offset); |
| 319 } | 319 } |
| 320 | 320 |
| 321 double GetDoubleFrameSlot(unsigned offset) { | 321 double GetDoubleFrameSlot(unsigned offset) { |
| 322 return *reinterpret_cast<double*>(GetFrameSlotPointer(offset)); | 322 return *reinterpret_cast<double*>(GetFrameSlotPointer(offset)); |
| 323 } | 323 } |
| 324 | 324 |
| 325 void SetFrameSlot(unsigned offset, uint32_t value) { | 325 void SetFrameSlot(unsigned offset, intptr_t value) { |
| 326 *GetFrameSlotPointer(offset) = value; | 326 *GetFrameSlotPointer(offset) = value; |
| 327 } | 327 } |
| 328 | 328 |
| 329 uint32_t GetRegister(unsigned n) const { | 329 intptr_t GetRegister(unsigned n) const { |
| 330 ASSERT(n < ARRAY_SIZE(registers_)); | 330 ASSERT(n < ARRAY_SIZE(registers_)); |
| 331 return registers_[n]; | 331 return registers_[n]; |
| 332 } | 332 } |
| 333 | 333 |
| 334 double GetDoubleRegister(unsigned n) const { | 334 double GetDoubleRegister(unsigned n) const { |
| 335 ASSERT(n < ARRAY_SIZE(double_registers_)); | 335 ASSERT(n < ARRAY_SIZE(double_registers_)); |
| 336 return double_registers_[n]; | 336 return double_registers_[n]; |
| 337 } | 337 } |
| 338 | 338 |
| 339 void SetRegister(unsigned n, uint32_t value) { | 339 void SetRegister(unsigned n, intptr_t value) { |
| 340 ASSERT(n < ARRAY_SIZE(registers_)); | 340 ASSERT(n < ARRAY_SIZE(registers_)); |
| 341 registers_[n] = value; | 341 registers_[n] = value; |
| 342 } | 342 } |
| 343 | 343 |
| 344 void SetDoubleRegister(unsigned n, double value) { | 344 void SetDoubleRegister(unsigned n, double value) { |
| 345 ASSERT(n < ARRAY_SIZE(double_registers_)); | 345 ASSERT(n < ARRAY_SIZE(double_registers_)); |
| 346 double_registers_[n] = value; | 346 double_registers_[n] = value; |
| 347 } | 347 } |
| 348 | 348 |
| 349 uint32_t GetTop() const { return top_; } | 349 intptr_t GetTop() const { return top_; } |
| 350 void SetTop(uint32_t top) { top_ = top; } | 350 void SetTop(intptr_t top) { top_ = top; } |
| 351 | 351 |
| 352 uint32_t GetPc() const { return pc_; } | 352 intptr_t GetPc() const { return pc_; } |
| 353 void SetPc(uint32_t pc) { pc_ = pc; } | 353 void SetPc(intptr_t pc) { pc_ = pc; } |
| 354 | 354 |
| 355 uint32_t GetFp() const { return fp_; } | 355 intptr_t GetFp() const { return fp_; } |
| 356 void SetFp(uint32_t fp) { fp_ = fp; } | 356 void SetFp(intptr_t fp) { fp_ = fp; } |
| 357 | 357 |
| 358 Smi* GetState() const { return state_; } | 358 Smi* GetState() const { return state_; } |
| 359 void SetState(Smi* state) { state_ = state; } | 359 void SetState(Smi* state) { state_ = state; } |
| 360 | 360 |
| 361 void SetContinuation(uint32_t pc) { continuation_ = pc; } | 361 void SetContinuation(intptr_t pc) { continuation_ = pc; } |
| 362 | 362 |
| 363 static int registers_offset() { | 363 static int registers_offset() { |
| 364 return OFFSET_OF(FrameDescription, registers_); | 364 return OFFSET_OF(FrameDescription, registers_); |
| 365 } | 365 } |
| 366 | 366 |
| 367 static int double_registers_offset() { | 367 static int double_registers_offset() { |
| 368 return OFFSET_OF(FrameDescription, double_registers_); | 368 return OFFSET_OF(FrameDescription, double_registers_); |
| 369 } | 369 } |
| 370 | 370 |
| 371 static int frame_size_offset() { | 371 static int frame_size_offset() { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 384 return OFFSET_OF(FrameDescription, continuation_); | 384 return OFFSET_OF(FrameDescription, continuation_); |
| 385 } | 385 } |
| 386 | 386 |
| 387 static int frame_content_offset() { | 387 static int frame_content_offset() { |
| 388 return sizeof(FrameDescription); | 388 return sizeof(FrameDescription); |
| 389 } | 389 } |
| 390 | 390 |
| 391 private: | 391 private: |
| 392 static const uint32_t kZapUint32 = 0xbeeddead; | 392 static const uint32_t kZapUint32 = 0xbeeddead; |
| 393 | 393 |
| 394 uint32_t frame_size_; // Number of bytes. | 394 uintptr_t frame_size_; // Number of bytes. |
| 395 JSFunction* function_; | 395 JSFunction* function_; |
| 396 uint32_t registers_[Register::kNumRegisters]; | 396 intptr_t registers_[Register::kNumRegisters]; |
| 397 double double_registers_[DoubleRegister::kNumAllocatableRegisters]; | 397 double double_registers_[DoubleRegister::kNumAllocatableRegisters]; |
| 398 uint32_t top_; | 398 intptr_t top_; |
| 399 uint32_t pc_; | 399 intptr_t pc_; |
| 400 uint32_t fp_; | 400 intptr_t fp_; |
| 401 Smi* state_; | 401 Smi* state_; |
| 402 | 402 |
| 403 // Continuation is the PC where the execution continues after | 403 // Continuation is the PC where the execution continues after |
| 404 // deoptimizing. | 404 // deoptimizing. |
| 405 uint32_t continuation_; | 405 intptr_t continuation_; |
| 406 | 406 |
| 407 uint32_t* GetFrameSlotPointer(unsigned offset) { | 407 intptr_t* GetFrameSlotPointer(unsigned offset) { |
| 408 ASSERT(offset < frame_size_); | 408 ASSERT(offset < frame_size_); |
| 409 return reinterpret_cast<uint32_t*>( | 409 return reinterpret_cast<intptr_t*>( |
| 410 reinterpret_cast<Address>(this) + frame_content_offset() + offset); | 410 reinterpret_cast<Address>(this) + frame_content_offset() + offset); |
| 411 } | 411 } |
| 412 }; | 412 }; |
| 413 | 413 |
| 414 | 414 |
| 415 class TranslationBuffer BASE_EMBEDDED { | 415 class TranslationBuffer BASE_EMBEDDED { |
| 416 public: | 416 public: |
| 417 TranslationBuffer() : contents_(256) { } | 417 TranslationBuffer() : contents_(256) { } |
| 418 | 418 |
| 419 int CurrentIndex() const { return contents_.length(); } | 419 int CurrentIndex() const { return contents_.length(); } |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 Handle<Code> code_; | 517 Handle<Code> code_; |
| 518 | 518 |
| 519 // Next pointer for linked list. | 519 // Next pointer for linked list. |
| 520 DeoptimizingCodeListNode* next_; | 520 DeoptimizingCodeListNode* next_; |
| 521 }; | 521 }; |
| 522 | 522 |
| 523 | 523 |
| 524 } } // namespace v8::internal | 524 } } // namespace v8::internal |
| 525 | 525 |
| 526 #endif // V8_DEOPTIMIZER_H_ | 526 #endif // V8_DEOPTIMIZER_H_ |
| OLD | NEW |