blob: b44c4d6d723606764d4a9bdebba38d893598710d [file] [log] [blame]
Ben Murdoch257744e2011-11-30 15:57:28 +00001// Copyright 2011 the V8 project authors. All rights reserved.
Ben Murdochb8a8cc12014-11-26 15:28:44 +00002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
Steve Blocka7e24c12009-10-30 11:49:00 +00004
Ben Murdoch257744e2011-11-30 15:57:28 +00005#ifndef V8_ISOLATE_INL_H_
6#define V8_ISOLATE_INL_H_
Steve Blocka7e24c12009-10-30 11:49:00 +00007
Ben Murdochb8a8cc12014-11-26 15:28:44 +00008#include "src/base/utils/random-number-generator.h"
9#include "src/debug.h"
10#include "src/isolate.h"
Steve Blocka7e24c12009-10-30 11:49:00 +000011
12namespace v8 {
13namespace internal {
14
Steve Blocka7e24c12009-10-30 11:49:00 +000015
Ben Murdochb8a8cc12014-11-26 15:28:44 +000016SaveContext::SaveContext(Isolate* isolate)
17 : isolate_(isolate),
18 prev_(isolate->save_context()) {
Ben Murdoch3ef787d2012-04-12 10:51:47 +010019 if (isolate->context() != NULL) {
20 context_ = Handle<Context>(isolate->context());
Ben Murdoch3ef787d2012-04-12 10:51:47 +010021 }
22 isolate->set_save_context(this);
23
24 c_entry_fp_ = isolate->c_entry_fp(isolate->thread_local_top());
25}
26
27
Ben Murdoch257744e2011-11-30 15:57:28 +000028bool Isolate::DebuggerHasBreakPoints() {
Ben Murdoch257744e2011-11-30 15:57:28 +000029 return debug()->has_break_points();
Ben Murdoch257744e2011-11-30 15:57:28 +000030}
31
32
Ben Murdochb8a8cc12014-11-26 15:28:44 +000033base::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
Steve Blocka7e24c12009-10-30 11:49:00 +000045} } // namespace v8::internal
Ben Murdoch257744e2011-11-30 15:57:28 +000046
47#endif // V8_ISOLATE_INL_H_