| 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 "include/v8-debug.h" | 8 #include "include/v8-debug.h" |
| 9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
| 10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // 'void function pointer', used to roundtrip the | 74 // 'void function pointer', used to roundtrip the |
| 75 // ExternalReference::ExternalReferenceRedirector since we can not include | 75 // ExternalReference::ExternalReferenceRedirector since we can not include |
| 76 // assembler.h, where it is defined, here. | 76 // assembler.h, where it is defined, here. |
| 77 typedef void* ExternalReferenceRedirectorPointer(); | 77 typedef void* ExternalReferenceRedirectorPointer(); |
| 78 | 78 |
| 79 | 79 |
| 80 class Debug; | 80 class Debug; |
| 81 class Debugger; | 81 class Debugger; |
| 82 class PromiseOnStack; | 82 class PromiseOnStack; |
| 83 | 83 |
| 84 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ | 84 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ |
| 85 !defined(__aarch64__) && V8_TARGET_ARCH_ARM64 || \ | 85 !defined(__aarch64__) && V8_TARGET_ARCH_ARM64 || \ |
| 86 !defined(__mips__) && V8_TARGET_ARCH_MIPS || \ | 86 !defined(__PPC__) && V8_TARGET_ARCH_PPC || \ |
| 87 !defined(__mips__) && V8_TARGET_ARCH_MIPS || \ |
| 87 !defined(__mips__) && V8_TARGET_ARCH_MIPS64 | 88 !defined(__mips__) && V8_TARGET_ARCH_MIPS64 |
| 88 class Redirection; | 89 class Redirection; |
| 89 class Simulator; | 90 class Simulator; |
| 90 #endif | 91 #endif |
| 91 | 92 |
| 92 | 93 |
| 93 // Static indirection table for handles to constants. If a frame | 94 // Static indirection table for handles to constants. If a frame |
| 94 // element represents a constant, the data contains an index into | 95 // element represents a constant, the data contains an index into |
| 95 // this table of handles to the actual constants. | 96 // this table of handles to the actual constants. |
| 96 // Static indirection table for handles to constants. If a Result | 97 // Static indirection table for handles to constants. If a Result |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 // Head of the list of live LookupResults. | 315 // Head of the list of live LookupResults. |
| 315 LookupResult* top_lookup_result_; | 316 LookupResult* top_lookup_result_; |
| 316 | 317 |
| 317 private: | 318 private: |
| 318 void InitializeInternal(); | 319 void InitializeInternal(); |
| 319 | 320 |
| 320 v8::TryCatch* try_catch_handler_; | 321 v8::TryCatch* try_catch_handler_; |
| 321 }; | 322 }; |
| 322 | 323 |
| 323 | 324 |
| 324 #if V8_TARGET_ARCH_ARM && !defined(__arm__) || \ | 325 #if V8_TARGET_ARCH_ARM && !defined(__arm__) || \ |
| 325 V8_TARGET_ARCH_ARM64 && !defined(__aarch64__) || \ | 326 V8_TARGET_ARCH_ARM64 && !defined(__aarch64__) || \ |
| 326 V8_TARGET_ARCH_MIPS && !defined(__mips__) || \ | 327 V8_TARGET_ARCH_PPC && !defined(__PPC__) || \ |
| 328 V8_TARGET_ARCH_MIPS && !defined(__mips__) || \ |
| 327 V8_TARGET_ARCH_MIPS64 && !defined(__mips__) | 329 V8_TARGET_ARCH_MIPS64 && !defined(__mips__) |
| 328 | 330 |
| 329 #define ISOLATE_INIT_SIMULATOR_LIST(V) \ | 331 #define ISOLATE_INIT_SIMULATOR_LIST(V) \ |
| 330 V(bool, simulator_initialized, false) \ | 332 V(bool, simulator_initialized, false) \ |
| 331 V(HashMap*, simulator_i_cache, NULL) \ | 333 V(HashMap*, simulator_i_cache, NULL) \ |
| 332 V(Redirection*, simulator_redirection, NULL) | 334 V(Redirection*, simulator_redirection, NULL) |
| 333 #else | 335 #else |
| 334 | 336 |
| 335 #define ISOLATE_INIT_SIMULATOR_LIST(V) | 337 #define ISOLATE_INIT_SIMULATOR_LIST(V) |
| 336 | 338 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 // A thread has a PerIsolateThreadData instance for each isolate that it has | 413 // A thread has a PerIsolateThreadData instance for each isolate that it has |
| 412 // entered. That instance is allocated when the isolate is initially entered | 414 // entered. That instance is allocated when the isolate is initially entered |
| 413 // and reused on subsequent entries. | 415 // and reused on subsequent entries. |
| 414 class PerIsolateThreadData { | 416 class PerIsolateThreadData { |
| 415 public: | 417 public: |
| 416 PerIsolateThreadData(Isolate* isolate, ThreadId thread_id) | 418 PerIsolateThreadData(Isolate* isolate, ThreadId thread_id) |
| 417 : isolate_(isolate), | 419 : isolate_(isolate), |
| 418 thread_id_(thread_id), | 420 thread_id_(thread_id), |
| 419 stack_limit_(0), | 421 stack_limit_(0), |
| 420 thread_state_(NULL), | 422 thread_state_(NULL), |
| 421 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ | 423 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ |
| 422 !defined(__aarch64__) && V8_TARGET_ARCH_ARM64 || \ | 424 !defined(__aarch64__) && V8_TARGET_ARCH_ARM64 || \ |
| 423 !defined(__mips__) && V8_TARGET_ARCH_MIPS || \ | 425 !defined(__PPC__) && V8_TARGET_ARCH_PPC || \ |
| 426 !defined(__mips__) && V8_TARGET_ARCH_MIPS || \ |
| 424 !defined(__mips__) && V8_TARGET_ARCH_MIPS64 | 427 !defined(__mips__) && V8_TARGET_ARCH_MIPS64 |
| 425 simulator_(NULL), | 428 simulator_(NULL), |
| 426 #endif | 429 #endif |
| 427 next_(NULL), | 430 next_(NULL), |
| 428 prev_(NULL) { } | 431 prev_(NULL) { } |
| 429 ~PerIsolateThreadData(); | 432 ~PerIsolateThreadData(); |
| 430 Isolate* isolate() const { return isolate_; } | 433 Isolate* isolate() const { return isolate_; } |
| 431 ThreadId thread_id() const { return thread_id_; } | 434 ThreadId thread_id() const { return thread_id_; } |
| 432 | 435 |
| 433 FIELD_ACCESSOR(uintptr_t, stack_limit) | 436 FIELD_ACCESSOR(uintptr_t, stack_limit) |
| 434 FIELD_ACCESSOR(ThreadState*, thread_state) | 437 FIELD_ACCESSOR(ThreadState*, thread_state) |
| 435 | 438 |
| 436 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ | 439 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ |
| 437 !defined(__aarch64__) && V8_TARGET_ARCH_ARM64 || \ | 440 !defined(__aarch64__) && V8_TARGET_ARCH_ARM64 || \ |
| 438 !defined(__mips__) && V8_TARGET_ARCH_MIPS || \ | 441 !defined(__PPC__) && V8_TARGET_ARCH_PPC || \ |
| 442 !defined(__mips__) && V8_TARGET_ARCH_MIPS || \ |
| 439 !defined(__mips__) && V8_TARGET_ARCH_MIPS64 | 443 !defined(__mips__) && V8_TARGET_ARCH_MIPS64 |
| 440 FIELD_ACCESSOR(Simulator*, simulator) | 444 FIELD_ACCESSOR(Simulator*, simulator) |
| 441 #endif | 445 #endif |
| 442 | 446 |
| 443 bool Matches(Isolate* isolate, ThreadId thread_id) const { | 447 bool Matches(Isolate* isolate, ThreadId thread_id) const { |
| 444 return isolate_ == isolate && thread_id_.Equals(thread_id); | 448 return isolate_ == isolate && thread_id_.Equals(thread_id); |
| 445 } | 449 } |
| 446 | 450 |
| 447 private: | 451 private: |
| 448 Isolate* isolate_; | 452 Isolate* isolate_; |
| 449 ThreadId thread_id_; | 453 ThreadId thread_id_; |
| 450 uintptr_t stack_limit_; | 454 uintptr_t stack_limit_; |
| 451 ThreadState* thread_state_; | 455 ThreadState* thread_state_; |
| 452 | 456 |
| 453 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ | 457 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ |
| 454 !defined(__aarch64__) && V8_TARGET_ARCH_ARM64 || \ | 458 !defined(__aarch64__) && V8_TARGET_ARCH_ARM64 || \ |
| 455 !defined(__mips__) && V8_TARGET_ARCH_MIPS || \ | 459 !defined(__PPC__) && V8_TARGET_ARCH_PPC || \ |
| 460 !defined(__mips__) && V8_TARGET_ARCH_MIPS || \ |
| 456 !defined(__mips__) && V8_TARGET_ARCH_MIPS64 | 461 !defined(__mips__) && V8_TARGET_ARCH_MIPS64 |
| 457 Simulator* simulator_; | 462 Simulator* simulator_; |
| 458 #endif | 463 #endif |
| 459 | 464 |
| 460 PerIsolateThreadData* next_; | 465 PerIsolateThreadData* next_; |
| 461 PerIsolateThreadData* prev_; | 466 PerIsolateThreadData* prev_; |
| 462 | 467 |
| 463 friend class Isolate; | 468 friend class Isolate; |
| 464 friend class ThreadDataTable; | 469 friend class ThreadDataTable; |
| 465 friend class EntryStackItem; | 470 friend class EntryStackItem; |
| (...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1554 } | 1559 } |
| 1555 | 1560 |
| 1556 EmbeddedVector<char, 128> filename_; | 1561 EmbeddedVector<char, 128> filename_; |
| 1557 FILE* file_; | 1562 FILE* file_; |
| 1558 int scope_depth_; | 1563 int scope_depth_; |
| 1559 }; | 1564 }; |
| 1560 | 1565 |
| 1561 } } // namespace v8::internal | 1566 } } // namespace v8::internal |
| 1562 | 1567 |
| 1563 #endif // V8_ISOLATE_H_ | 1568 #endif // V8_ISOLATE_H_ |
| OLD | NEW |