| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_ISOLATE_H_ | 5 #ifndef V8_ISOLATE_H_ |
| 6 #define V8_ISOLATE_H_ | 6 #define V8_ISOLATE_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include "include/v8-debug.h" | 9 #include "include/v8-debug.h" |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // 'void function pointer', used to roundtrip the | 75 // 'void function pointer', used to roundtrip the |
| 76 // ExternalReference::ExternalReferenceRedirector since we can not include | 76 // ExternalReference::ExternalReferenceRedirector since we can not include |
| 77 // assembler.h, where it is defined, here. | 77 // assembler.h, where it is defined, here. |
| 78 typedef void* ExternalReferenceRedirectorPointer(); | 78 typedef void* ExternalReferenceRedirectorPointer(); |
| 79 | 79 |
| 80 | 80 |
| 81 class Debug; | 81 class Debug; |
| 82 class Debugger; | 82 class Debugger; |
| 83 class PromiseOnStack; | 83 class PromiseOnStack; |
| 84 | 84 |
| 85 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ | 85 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ |
| 86 !defined(__aarch64__) && V8_TARGET_ARCH_ARM64 || \ | 86 !defined(__aarch64__) && V8_TARGET_ARCH_ARM64 || \ |
| 87 !defined(__mips__) && V8_TARGET_ARCH_MIPS || \ | 87 !defined(__PPC__) && V8_TARGET_ARCH_PPC || \ |
| 88 !defined(__mips__) && V8_TARGET_ARCH_MIPS || \ |
| 88 !defined(__mips__) && V8_TARGET_ARCH_MIPS64 | 89 !defined(__mips__) && V8_TARGET_ARCH_MIPS64 |
| 89 class Redirection; | 90 class Redirection; |
| 90 class Simulator; | 91 class Simulator; |
| 91 #endif | 92 #endif |
| 92 | 93 |
| 93 | 94 |
| 94 // Static indirection table for handles to constants. If a frame | 95 // Static indirection table for handles to constants. If a frame |
| 95 // element represents a constant, the data contains an index into | 96 // element represents a constant, the data contains an index into |
| 96 // this table of handles to the actual constants. | 97 // this table of handles to the actual constants. |
| 97 // Static indirection table for handles to constants. If a Result | 98 // Static indirection table for handles to constants. If a Result |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 // Head of the list of live LookupResults. | 316 // Head of the list of live LookupResults. |
| 316 LookupResult* top_lookup_result_; | 317 LookupResult* top_lookup_result_; |
| 317 | 318 |
| 318 private: | 319 private: |
| 319 void InitializeInternal(); | 320 void InitializeInternal(); |
| 320 | 321 |
| 321 v8::TryCatch* try_catch_handler_; | 322 v8::TryCatch* try_catch_handler_; |
| 322 }; | 323 }; |
| 323 | 324 |
| 324 | 325 |
| 325 #if V8_TARGET_ARCH_ARM && !defined(__arm__) || \ | 326 #if V8_TARGET_ARCH_ARM && !defined(__arm__) || \ |
| 326 V8_TARGET_ARCH_ARM64 && !defined(__aarch64__) || \ | 327 V8_TARGET_ARCH_ARM64 && !defined(__aarch64__) || \ |
| 327 V8_TARGET_ARCH_MIPS && !defined(__mips__) || \ | 328 V8_TARGET_ARCH_PPC && !defined(__PPC__) || \ |
| 329 V8_TARGET_ARCH_MIPS && !defined(__mips__) || \ |
| 328 V8_TARGET_ARCH_MIPS64 && !defined(__mips__) | 330 V8_TARGET_ARCH_MIPS64 && !defined(__mips__) |
| 329 | 331 |
| 330 #define ISOLATE_INIT_SIMULATOR_LIST(V) \ | 332 #define ISOLATE_INIT_SIMULATOR_LIST(V) \ |
| 331 V(bool, simulator_initialized, false) \ | 333 V(bool, simulator_initialized, false) \ |
| 332 V(HashMap*, simulator_i_cache, NULL) \ | 334 V(HashMap*, simulator_i_cache, NULL) \ |
| 333 V(Redirection*, simulator_redirection, NULL) | 335 V(Redirection*, simulator_redirection, NULL) |
| 334 #else | 336 #else |
| 335 | 337 |
| 336 #define ISOLATE_INIT_SIMULATOR_LIST(V) | 338 #define ISOLATE_INIT_SIMULATOR_LIST(V) |
| 337 | 339 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 // A thread has a PerIsolateThreadData instance for each isolate that it has | 412 // A thread has a PerIsolateThreadData instance for each isolate that it has |
| 411 // entered. That instance is allocated when the isolate is initially entered | 413 // entered. That instance is allocated when the isolate is initially entered |
| 412 // and reused on subsequent entries. | 414 // and reused on subsequent entries. |
| 413 class PerIsolateThreadData { | 415 class PerIsolateThreadData { |
| 414 public: | 416 public: |
| 415 PerIsolateThreadData(Isolate* isolate, ThreadId thread_id) | 417 PerIsolateThreadData(Isolate* isolate, ThreadId thread_id) |
| 416 : isolate_(isolate), | 418 : isolate_(isolate), |
| 417 thread_id_(thread_id), | 419 thread_id_(thread_id), |
| 418 stack_limit_(0), | 420 stack_limit_(0), |
| 419 thread_state_(NULL), | 421 thread_state_(NULL), |
| 420 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ | 422 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ |
| 421 !defined(__aarch64__) && V8_TARGET_ARCH_ARM64 || \ | 423 !defined(__aarch64__) && V8_TARGET_ARCH_ARM64 || \ |
| 422 !defined(__mips__) && V8_TARGET_ARCH_MIPS || \ | 424 !defined(__PPC__) && V8_TARGET_ARCH_PPC || \ |
| 425 !defined(__mips__) && V8_TARGET_ARCH_MIPS || \ |
| 423 !defined(__mips__) && V8_TARGET_ARCH_MIPS64 | 426 !defined(__mips__) && V8_TARGET_ARCH_MIPS64 |
| 424 simulator_(NULL), | 427 simulator_(NULL), |
| 425 #endif | 428 #endif |
| 426 next_(NULL), | 429 next_(NULL), |
| 427 prev_(NULL) { } | 430 prev_(NULL) { } |
| 428 ~PerIsolateThreadData(); | 431 ~PerIsolateThreadData(); |
| 429 Isolate* isolate() const { return isolate_; } | 432 Isolate* isolate() const { return isolate_; } |
| 430 ThreadId thread_id() const { return thread_id_; } | 433 ThreadId thread_id() const { return thread_id_; } |
| 431 | 434 |
| 432 FIELD_ACCESSOR(uintptr_t, stack_limit) | 435 FIELD_ACCESSOR(uintptr_t, stack_limit) |
| 433 FIELD_ACCESSOR(ThreadState*, thread_state) | 436 FIELD_ACCESSOR(ThreadState*, thread_state) |
| 434 | 437 |
| 435 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ | 438 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ |
| 436 !defined(__aarch64__) && V8_TARGET_ARCH_ARM64 || \ | 439 !defined(__aarch64__) && V8_TARGET_ARCH_ARM64 || \ |
| 437 !defined(__mips__) && V8_TARGET_ARCH_MIPS || \ | 440 !defined(__PPC__) && V8_TARGET_ARCH_PPC || \ |
| 441 !defined(__mips__) && V8_TARGET_ARCH_MIPS || \ |
| 438 !defined(__mips__) && V8_TARGET_ARCH_MIPS64 | 442 !defined(__mips__) && V8_TARGET_ARCH_MIPS64 |
| 439 FIELD_ACCESSOR(Simulator*, simulator) | 443 FIELD_ACCESSOR(Simulator*, simulator) |
| 440 #endif | 444 #endif |
| 441 | 445 |
| 442 bool Matches(Isolate* isolate, ThreadId thread_id) const { | 446 bool Matches(Isolate* isolate, ThreadId thread_id) const { |
| 443 return isolate_ == isolate && thread_id_.Equals(thread_id); | 447 return isolate_ == isolate && thread_id_.Equals(thread_id); |
| 444 } | 448 } |
| 445 | 449 |
| 446 private: | 450 private: |
| 447 Isolate* isolate_; | 451 Isolate* isolate_; |
| 448 ThreadId thread_id_; | 452 ThreadId thread_id_; |
| 449 uintptr_t stack_limit_; | 453 uintptr_t stack_limit_; |
| 450 ThreadState* thread_state_; | 454 ThreadState* thread_state_; |
| 451 | 455 |
| 452 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ | 456 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ |
| 453 !defined(__aarch64__) && V8_TARGET_ARCH_ARM64 || \ | 457 !defined(__aarch64__) && V8_TARGET_ARCH_ARM64 || \ |
| 454 !defined(__mips__) && V8_TARGET_ARCH_MIPS || \ | 458 !defined(__PPC__) && V8_TARGET_ARCH_PPC || \ |
| 459 !defined(__mips__) && V8_TARGET_ARCH_MIPS || \ |
| 455 !defined(__mips__) && V8_TARGET_ARCH_MIPS64 | 460 !defined(__mips__) && V8_TARGET_ARCH_MIPS64 |
| 456 Simulator* simulator_; | 461 Simulator* simulator_; |
| 457 #endif | 462 #endif |
| 458 | 463 |
| 459 PerIsolateThreadData* next_; | 464 PerIsolateThreadData* next_; |
| 460 PerIsolateThreadData* prev_; | 465 PerIsolateThreadData* prev_; |
| 461 | 466 |
| 462 friend class Isolate; | 467 friend class Isolate; |
| 463 friend class ThreadDataTable; | 468 friend class ThreadDataTable; |
| 464 friend class EntryStackItem; | 469 friend class EntryStackItem; |
| (...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1578 } | 1583 } |
| 1579 | 1584 |
| 1580 EmbeddedVector<char, 128> filename_; | 1585 EmbeddedVector<char, 128> filename_; |
| 1581 FILE* file_; | 1586 FILE* file_; |
| 1582 int scope_depth_; | 1587 int scope_depth_; |
| 1583 }; | 1588 }; |
| 1584 | 1589 |
| 1585 } } // namespace v8::internal | 1590 } } // namespace v8::internal |
| 1586 | 1591 |
| 1587 #endif // V8_ISOLATE_H_ | 1592 #endif // V8_ISOLATE_H_ |
| OLD | NEW |