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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 JSFunction* function); | 286 JSFunction* function); |
287 | 287 |
288 void* operator new(size_t size, uint32_t frame_size) { | 288 void* operator new(size_t size, uint32_t frame_size) { |
289 return malloc(size + frame_size); | 289 return malloc(size + frame_size); |
290 } | 290 } |
291 | 291 |
292 void operator delete(void* description) { | 292 void operator delete(void* description) { |
293 free(description); | 293 free(description); |
294 } | 294 } |
295 | 295 |
296 uint32_t GetFrameSize() const { return frame_size_; } | 296 intptr_t GetFrameSize() const { return frame_size_; } |
297 | 297 |
298 JSFunction* GetFunction() const { return function_; } | 298 JSFunction* GetFunction() const { return function_; } |
299 | 299 |
300 unsigned GetOffsetFromSlotIndex(Deoptimizer* deoptimizer, int slot_index); | 300 unsigned GetOffsetFromSlotIndex(Deoptimizer* deoptimizer, int slot_index); |
301 | 301 |
302 uint32_t GetFrameSlot(unsigned offset) { | 302 intptr_t GetFrameSlot(unsigned offset) { |
303 return *GetFrameSlotPointer(offset); | 303 return *GetFrameSlotPointer(offset); |
304 } | 304 } |
305 | 305 |
306 double GetDoubleFrameSlot(unsigned offset) { | 306 double GetDoubleFrameSlot(unsigned offset) { |
307 return *reinterpret_cast<double*>(GetFrameSlotPointer(offset)); | 307 return *reinterpret_cast<double*>(GetFrameSlotPointer(offset)); |
308 } | 308 } |
309 | 309 |
310 void SetFrameSlot(unsigned offset, uint32_t value) { | 310 void SetFrameSlot(unsigned offset, intptr_t value) { |
311 *GetFrameSlotPointer(offset) = value; | 311 *GetFrameSlotPointer(offset) = value; |
312 } | 312 } |
313 | 313 |
314 uint32_t GetRegister(unsigned n) const { | 314 intptr_t GetRegister(unsigned n) const { |
315 ASSERT(n < ARRAY_SIZE(registers_)); | 315 ASSERT(n < ARRAY_SIZE(registers_)); |
316 return registers_[n]; | 316 return registers_[n]; |
317 } | 317 } |
318 | 318 |
319 double GetDoubleRegister(unsigned n) const { | 319 double GetDoubleRegister(unsigned n) const { |
320 ASSERT(n < ARRAY_SIZE(double_registers_)); | 320 ASSERT(n < ARRAY_SIZE(double_registers_)); |
321 return double_registers_[n]; | 321 return double_registers_[n]; |
322 } | 322 } |
323 | 323 |
324 void SetRegister(unsigned n, uint32_t value) { | 324 void SetRegister(unsigned n, intptr_t value) { |
325 ASSERT(n < ARRAY_SIZE(registers_)); | 325 ASSERT(n < ARRAY_SIZE(registers_)); |
326 registers_[n] = value; | 326 registers_[n] = value; |
327 } | 327 } |
328 | 328 |
329 void SetDoubleRegister(unsigned n, double value) { | 329 void SetDoubleRegister(unsigned n, double value) { |
330 ASSERT(n < ARRAY_SIZE(double_registers_)); | 330 ASSERT(n < ARRAY_SIZE(double_registers_)); |
331 double_registers_[n] = value; | 331 double_registers_[n] = value; |
332 } | 332 } |
333 | 333 |
334 uint32_t GetTop() const { return top_; } | 334 intptr_t GetTop() const { return top_; } |
335 void SetTop(uint32_t top) { top_ = top; } | 335 void SetTop(intptr_t top) { top_ = top; } |
336 | 336 |
337 uint32_t GetPc() const { return pc_; } | 337 intptr_t GetPc() const { return pc_; } |
338 void SetPc(uint32_t pc) { pc_ = pc; } | 338 void SetPc(intptr_t pc) { pc_ = pc; } |
339 | 339 |
340 uint32_t GetFp() const { return fp_; } | 340 intptr_t GetFp() const { return fp_; } |
341 void SetFp(uint32_t fp) { fp_ = fp; } | 341 void SetFp(intptr_t fp) { fp_ = fp; } |
342 | 342 |
343 Smi* GetState() const { return state_; } | 343 Smi* GetState() const { return state_; } |
344 void SetState(Smi* state) { state_ = state; } | 344 void SetState(Smi* state) { state_ = state; } |
345 | 345 |
346 void SetContinuation(uint32_t pc) { continuation_ = pc; } | 346 void SetContinuation(intptr_t pc) { continuation_ = pc; } |
347 | 347 |
348 static int registers_offset() { | 348 static int registers_offset() { |
349 return OFFSET_OF(FrameDescription, registers_); | 349 return OFFSET_OF(FrameDescription, registers_); |
350 } | 350 } |
351 | 351 |
352 static int double_registers_offset() { | 352 static int double_registers_offset() { |
353 return OFFSET_OF(FrameDescription, double_registers_); | 353 return OFFSET_OF(FrameDescription, double_registers_); |
354 } | 354 } |
355 | 355 |
356 static int frame_size_offset() { | 356 static int frame_size_offset() { |
(...skipping 12 matching lines...) Expand all Loading... |
369 return OFFSET_OF(FrameDescription, continuation_); | 369 return OFFSET_OF(FrameDescription, continuation_); |
370 } | 370 } |
371 | 371 |
372 static int frame_content_offset() { | 372 static int frame_content_offset() { |
373 return sizeof(FrameDescription); | 373 return sizeof(FrameDescription); |
374 } | 374 } |
375 | 375 |
376 private: | 376 private: |
377 static const uint32_t kZapUint32 = 0xbeeddead; | 377 static const uint32_t kZapUint32 = 0xbeeddead; |
378 | 378 |
379 uint32_t frame_size_; // Number of bytes. | 379 uintptr_t frame_size_; // Number of bytes. |
380 JSFunction* function_; | 380 JSFunction* function_; |
381 uint32_t registers_[Register::kNumRegisters]; | 381 intptr_t registers_[Register::kNumRegisters]; |
382 double double_registers_[DoubleRegister::kNumAllocatableRegisters]; | 382 double double_registers_[DoubleRegister::kNumAllocatableRegisters]; |
383 uint32_t top_; | 383 intptr_t top_; |
384 uint32_t pc_; | 384 intptr_t pc_; |
385 uint32_t fp_; | 385 intptr_t fp_; |
386 Smi* state_; | 386 Smi* state_; |
387 | 387 |
388 // Continuation is the PC where the execution continues after | 388 // Continuation is the PC where the execution continues after |
389 // deoptimizing. | 389 // deoptimizing. |
390 uint32_t continuation_; | 390 intptr_t continuation_; |
391 | 391 |
392 uint32_t* GetFrameSlotPointer(unsigned offset) { | 392 intptr_t* GetFrameSlotPointer(unsigned offset) { |
393 ASSERT(offset < frame_size_); | 393 ASSERT(offset < frame_size_); |
394 return reinterpret_cast<uint32_t*>( | 394 return reinterpret_cast<intptr_t*>( |
395 reinterpret_cast<Address>(this) + frame_content_offset() + offset); | 395 reinterpret_cast<Address>(this) + frame_content_offset() + offset); |
396 } | 396 } |
397 }; | 397 }; |
398 | 398 |
399 | 399 |
400 class TranslationBuffer BASE_EMBEDDED { | 400 class TranslationBuffer BASE_EMBEDDED { |
401 public: | 401 public: |
402 TranslationBuffer() : contents_(256) { } | 402 TranslationBuffer() : contents_(256) { } |
403 | 403 |
404 int CurrentIndex() const { return contents_.length(); } | 404 int CurrentIndex() const { return contents_.length(); } |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 Handle<Code> code_; | 502 Handle<Code> code_; |
503 | 503 |
504 // Next pointer for linked list. | 504 // Next pointer for linked list. |
505 DeoptimizingCodeListNode* next_; | 505 DeoptimizingCodeListNode* next_; |
506 }; | 506 }; |
507 | 507 |
508 | 508 |
509 } } // namespace v8::internal | 509 } } // namespace v8::internal |
510 | 510 |
511 #endif // V8_DEOPTIMIZER_H_ | 511 #endif // V8_DEOPTIMIZER_H_ |
OLD | NEW |