| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 // neat in some ways, but it would expose internal implementation details in | 392 // neat in some ways, but it would expose internal implementation details in |
| 393 // our public header file, which is undesirable. | 393 // our public header file, which is undesirable. |
| 394 // | 394 // |
| 395 // An isolate has a single instance of this class to hold the current thread's | 395 // An isolate has a single instance of this class to hold the current thread's |
| 396 // data. In multithreaded V8 programs this data is copied in and out of storage | 396 // data. In multithreaded V8 programs this data is copied in and out of storage |
| 397 // so that the currently executing thread always has its own copy of this | 397 // so that the currently executing thread always has its own copy of this |
| 398 // data. | 398 // data. |
| 399 ISOLATED_CLASS HandleScopeImplementer { | 399 ISOLATED_CLASS HandleScopeImplementer { |
| 400 public: | 400 public: |
| 401 | 401 |
| 402 HandleScopeImplementer() | 402 explicit HandleScopeImplementer(Isolate* isolate) |
| 403 : blocks_(0), | 403 : isolate_(isolate), |
| 404 blocks_(0), |
| 404 entered_contexts_(0), | 405 entered_contexts_(0), |
| 405 saved_contexts_(0), | 406 saved_contexts_(0), |
| 406 spare_(NULL), | 407 spare_(NULL), |
| 407 ignore_out_of_memory_(false), | 408 ignore_out_of_memory_(false), |
| 408 call_depth_(0) { } | 409 call_depth_(0) { } |
| 409 | 410 |
| 410 // Threading support for handle data. | 411 // Threading support for handle data. |
| 411 static int ArchiveSpacePerThread(); | 412 static int ArchiveSpacePerThread(); |
| 412 char* RestoreThread(char* from); | 413 char* RestoreThread(char* from); |
| 413 char* ArchiveThread(char* to); | 414 char* ArchiveThread(char* to); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 blocks_.Free(); | 460 blocks_.Free(); |
| 460 entered_contexts_.Free(); | 461 entered_contexts_.Free(); |
| 461 saved_contexts_.Free(); | 462 saved_contexts_.Free(); |
| 462 if (spare_ != NULL) { | 463 if (spare_ != NULL) { |
| 463 DeleteArray(spare_); | 464 DeleteArray(spare_); |
| 464 spare_ = NULL; | 465 spare_ = NULL; |
| 465 } | 466 } |
| 466 ASSERT(call_depth_ == 0); | 467 ASSERT(call_depth_ == 0); |
| 467 } | 468 } |
| 468 | 469 |
| 470 Isolate* isolate_; |
| 469 List<internal::Object**> blocks_; | 471 List<internal::Object**> blocks_; |
| 470 // Used as a stack to keep track of entered contexts. | 472 // Used as a stack to keep track of entered contexts. |
| 471 List<Handle<Object> > entered_contexts_; | 473 List<Handle<Object> > entered_contexts_; |
| 472 // Used as a stack to keep track of saved contexts. | 474 // Used as a stack to keep track of saved contexts. |
| 473 List<Context*> saved_contexts_; | 475 List<Context*> saved_contexts_; |
| 474 Object** spare_; | 476 Object** spare_; |
| 475 bool ignore_out_of_memory_; | 477 bool ignore_out_of_memory_; |
| 476 int call_depth_; | 478 int call_depth_; |
| 477 // This is only used for threading support. | 479 // This is only used for threading support. |
| 478 v8::ImplementationUtilities::HandleScopeData handle_scope_data_; | 480 v8::ImplementationUtilities::HandleScopeData handle_scope_data_; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 stress_type_ = stress_type; | 565 stress_type_ = stress_type; |
| 564 } | 566 } |
| 565 | 567 |
| 566 private: | 568 private: |
| 567 static v8::Testing::StressType stress_type_; | 569 static v8::Testing::StressType stress_type_; |
| 568 }; | 570 }; |
| 569 | 571 |
| 570 } } // namespace v8::internal | 572 } } // namespace v8::internal |
| 571 | 573 |
| 572 #endif // V8_API_H_ | 574 #endif // V8_API_H_ |
| OLD | NEW |