| Index: src/isolate.h
|
| diff --git a/src/isolate.h b/src/isolate.h
|
| index 8ca62d057b67da71420614774a483777168df6bf..86a1bb73288d3ed261cc11410bf33a99749b4ae7 100644
|
| --- a/src/isolate.h
|
| +++ b/src/isolate.h
|
| @@ -77,6 +77,7 @@ class NoAllocationStringAllocator;
|
| class InnerPointerToCodeCache;
|
| class MarkingThread;
|
| class PreallocatedMemoryThread;
|
| +class RandomNumberGenerator;
|
| class RegExpStack;
|
| class SaveContext;
|
| class UnicodeCache;
|
| @@ -1130,9 +1131,18 @@ class Isolate {
|
|
|
| void* stress_deopt_count_address() { return &stress_deopt_count_; }
|
|
|
| + inline RandomNumberGenerator* random_number_generator();
|
| +
|
| // Given an address occupied by a live code object, return that object.
|
| Object* FindCodeObject(Address a);
|
|
|
| + bool is_memory_constrained() const {
|
| + return is_memory_constrained_;
|
| + }
|
| + void set_is_memory_constrained(bool value) {
|
| + is_memory_constrained_ = value;
|
| + }
|
| +
|
| private:
|
| Isolate();
|
|
|
| @@ -1304,6 +1314,8 @@ class Isolate {
|
| DateCache* date_cache_;
|
| unibrow::Mapping<unibrow::Ecma262Canonicalize> interp_canonicalize_mapping_;
|
| CodeStubInterfaceDescriptor* code_stub_interface_descriptors_;
|
| + RandomNumberGenerator* random_number_generator_;
|
| + bool is_memory_constrained_;
|
|
|
| // True if fatal error has been signaled for this isolate.
|
| bool has_fatal_error_;
|
| @@ -1420,12 +1432,15 @@ class SaveContext BASE_EMBEDDED {
|
| class AssertNoContextChange BASE_EMBEDDED {
|
| #ifdef DEBUG
|
| public:
|
| - AssertNoContextChange() : context_(Isolate::Current()->context()) { }
|
| + AssertNoContextChange()
|
| + : isolate_(Isolate::Current()),
|
| + context_(isolate_->context()) { }
|
| ~AssertNoContextChange() {
|
| - ASSERT(Isolate::Current()->context() == *context_);
|
| + ASSERT(isolate_->context() == *context_);
|
| }
|
|
|
| private:
|
| + Isolate* isolate_;
|
| Handle<Context> context_;
|
| #else
|
| public:
|
| @@ -1439,15 +1454,17 @@ class AssertNoContextChangeWithHandleScope BASE_EMBEDDED {
|
| #ifdef DEBUG
|
| public:
|
| AssertNoContextChangeWithHandleScope() :
|
| - scope_(Isolate::Current()),
|
| - context_(Isolate::Current()->context(), Isolate::Current()) {
|
| + isolate_(Isolate::Current()),
|
| + scope_(isolate_),
|
| + context_(isolate_->context(), isolate_) {
|
| }
|
|
|
| ~AssertNoContextChangeWithHandleScope() {
|
| - ASSERT(Isolate::Current()->context() == *context_);
|
| + ASSERT(isolate_->context() == *context_);
|
| }
|
|
|
| private:
|
| + Isolate* isolate_;
|
| HandleScope scope_;
|
| Handle<Context> context_;
|
| #else
|
| @@ -1512,12 +1529,6 @@ class PostponeInterruptsScope BASE_EMBEDDED {
|
| };
|
|
|
|
|
| -// Temporary macros for accessing current isolate and its subobjects.
|
| -// They provide better readability, especially when used a lot in the code.
|
| -#define HEAP (v8::internal::Isolate::Current()->heap())
|
| -#define ISOLATE (v8::internal::Isolate::Current())
|
| -
|
| -
|
| // Tells whether the native context is marked with out of memory.
|
| inline bool Context::has_out_of_memory() {
|
| return native_context()->out_of_memory()->IsTrue();
|
| @@ -1526,7 +1537,7 @@ inline bool Context::has_out_of_memory() {
|
|
|
| // Mark the native context with out of memory.
|
| inline void Context::mark_out_of_memory() {
|
| - native_context()->set_out_of_memory(HEAP->true_value());
|
| + native_context()->set_out_of_memory(GetIsolate()->heap()->true_value());
|
| }
|
|
|
|
|
|
|