1 // Copyright 2011 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef V8_ISOLATE_INL_H_ 6 #define V8_ISOLATE_INL_H_ 7 8 #include "src/base/utils/random-number-generator.h" 9 #include "src/debug.h" 10 #include "src/isolate.h" 11 12 namespace v8 { 13 namespace internal { 14 15 16 SaveContext::SaveContext(Isolate* isolate) 17 : isolate_(isolate), 18 prev_(isolate->save_context()) { 19 if (isolate->context() != NULL) { 20 context_ = Handle<Context>(isolate->context()); 21 } 22 isolate->set_save_context(this); 23 24 c_entry_fp_ = isolate->c_entry_fp(isolate->thread_local_top()); 25 } 26 27 28 bool Isolate::DebuggerHasBreakPoints() { 29 return debug()->has_break_points(); 30 } 31 32 33 base::RandomNumberGenerator* Isolate::random_number_generator() { 34 if (random_number_generator_ == NULL) { 35 if (FLAG_random_seed != 0) { 36 random_number_generator_ = 37 new base::RandomNumberGenerator(FLAG_random_seed); 38 } else { 39 random_number_generator_ = new base::RandomNumberGenerator(); 40 } 41 } 42 return random_number_generator_; 43 } 44 45 } } // namespace v8::internal 46 47 #endif // V8_ISOLATE_INL_H_ 48