OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 | 390 |
391 DISALLOW_COPY_AND_ASSIGN(StringTracker); | 391 DISALLOW_COPY_AND_ASSIGN(StringTracker); |
392 }; | 392 }; |
393 | 393 |
394 | 394 |
395 class DeferredHandles { | 395 class DeferredHandles { |
396 public: | 396 public: |
397 ~DeferredHandles(); | 397 ~DeferredHandles(); |
398 | 398 |
399 private: | 399 private: |
400 DeferredHandles(DeferredHandles* next, Object** last_block_limit, | 400 DeferredHandles(DeferredHandles* next, Object** first_block_limit, |
401 HandleScopeImplementer* impl) | 401 HandleScopeImplementer* impl) |
402 : next_(next), previous_(NULL), last_block_limit_(last_block_limit), | 402 : next_(next), previous_(NULL), first_block_limit_(first_block_limit), |
403 impl_(impl) {} | 403 impl_(impl) {} |
404 | 404 |
405 void Iterate(ObjectVisitor* v); | 405 void Iterate(ObjectVisitor* v); |
406 | 406 |
407 List<Object**> blocks_; | 407 List<Object**> blocks_; |
408 DeferredHandles* next_; | 408 DeferredHandles* next_; |
409 DeferredHandles* previous_; | 409 DeferredHandles* previous_; |
410 Object** last_block_limit_; | 410 Object** first_block_limit_; |
411 HandleScopeImplementer* impl_; | 411 HandleScopeImplementer* impl_; |
412 | 412 |
413 friend class HandleScopeImplementer; | 413 friend class HandleScopeImplementer; |
414 }; | 414 }; |
415 | 415 |
416 | 416 |
417 // This class is here in order to be able to declare it a friend of | 417 // This class is here in order to be able to declare it a friend of |
418 // HandleScope. Moving these methods to be members of HandleScope would be | 418 // HandleScope. Moving these methods to be members of HandleScope would be |
419 // neat in some ways, but it would expose internal implementation details in | 419 // neat in some ways, but it would expose internal implementation details in |
420 // our public header file, which is undesirable. | 420 // our public header file, which is undesirable. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 | 470 |
471 inline List<internal::Object**>* blocks() { return &blocks_; } | 471 inline List<internal::Object**>* blocks() { return &blocks_; } |
472 Isolate* isolate() const { return isolate_; } | 472 Isolate* isolate() const { return isolate_; } |
473 | 473 |
474 private: | 474 private: |
475 void ResetAfterArchive() { | 475 void ResetAfterArchive() { |
476 blocks_.Initialize(0); | 476 blocks_.Initialize(0); |
477 entered_contexts_.Initialize(0); | 477 entered_contexts_.Initialize(0); |
478 saved_contexts_.Initialize(0); | 478 saved_contexts_.Initialize(0); |
479 spare_ = NULL; | 479 spare_ = NULL; |
| 480 deferred_handles_head_ = NULL; |
| 481 last_handle_before_deferred_block_ = NULL; |
480 call_depth_ = 0; | 482 call_depth_ = 0; |
481 } | 483 } |
482 | 484 |
483 void Free() { | 485 void Free() { |
484 ASSERT(blocks_.length() == 0); | 486 ASSERT(blocks_.length() == 0); |
485 ASSERT(entered_contexts_.length() == 0); | 487 ASSERT(entered_contexts_.length() == 0); |
486 ASSERT(saved_contexts_.length() == 0); | 488 ASSERT(saved_contexts_.length() == 0); |
| 489 ASSERT(deferred_handles_head_ == NULL); |
487 blocks_.Free(); | 490 blocks_.Free(); |
488 entered_contexts_.Free(); | 491 entered_contexts_.Free(); |
489 saved_contexts_.Free(); | 492 saved_contexts_.Free(); |
490 if (spare_ != NULL) { | 493 if (spare_ != NULL) { |
491 DeleteArray(spare_); | 494 DeleteArray(spare_); |
492 spare_ = NULL; | 495 spare_ = NULL; |
493 } | 496 } |
494 ASSERT(call_depth_ == 0); | 497 ASSERT(call_depth_ == 0); |
495 } | 498 } |
496 | 499 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 stress_type_ = stress_type; | 603 stress_type_ = stress_type; |
601 } | 604 } |
602 | 605 |
603 private: | 606 private: |
604 static v8::Testing::StressType stress_type_; | 607 static v8::Testing::StressType stress_type_; |
605 }; | 608 }; |
606 | 609 |
607 } } // namespace v8::internal | 610 } } // namespace v8::internal |
608 | 611 |
609 #endif // V8_API_H_ | 612 #endif // V8_API_H_ |
OLD | NEW |