2011-04-26 13:53:19 +00:00
|
|
|
// Copyright 2011 the V8 project authors. All rights reserved.
|
2014-04-29 06:42:26 +00:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
2011-04-26 13:53:19 +00:00
|
|
|
|
|
|
|
#ifndef V8_ISOLATE_INL_H_
|
|
|
|
#define V8_ISOLATE_INL_H_
|
|
|
|
|
2014-06-30 13:25:46 +00:00
|
|
|
#include "src/base/utils/random-number-generator.h"
|
2014-06-03 08:12:43 +00:00
|
|
|
#include "src/debug.h"
|
|
|
|
#include "src/isolate.h"
|
2011-04-26 13:53:19 +00:00
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
|
|
|
|
2013-09-03 11:47:16 +00:00
|
|
|
SaveContext::SaveContext(Isolate* isolate)
|
|
|
|
: isolate_(isolate),
|
|
|
|
prev_(isolate->save_context()) {
|
2011-10-03 11:13:20 +00:00
|
|
|
if (isolate->context() != NULL) {
|
|
|
|
context_ = Handle<Context>(isolate->context());
|
|
|
|
}
|
|
|
|
isolate->set_save_context(this);
|
|
|
|
|
2011-10-28 12:49:09 +00:00
|
|
|
c_entry_fp_ = isolate->c_entry_fp(isolate->thread_local_top());
|
2011-10-03 11:13:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-04-26 13:53:19 +00:00
|
|
|
bool Isolate::DebuggerHasBreakPoints() {
|
|
|
|
return debug()->has_break_points();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-06-30 13:25:46 +00:00
|
|
|
base::RandomNumberGenerator* Isolate::random_number_generator() {
|
2013-09-10 11:13:55 +00:00
|
|
|
if (random_number_generator_ == NULL) {
|
2014-06-17 16:27:19 +00:00
|
|
|
if (FLAG_random_seed != 0) {
|
2014-06-30 13:25:46 +00:00
|
|
|
random_number_generator_ =
|
|
|
|
new base::RandomNumberGenerator(FLAG_random_seed);
|
2014-06-17 16:27:19 +00:00
|
|
|
} else {
|
2014-06-30 13:25:46 +00:00
|
|
|
random_number_generator_ = new base::RandomNumberGenerator();
|
2014-06-17 16:27:19 +00:00
|
|
|
}
|
2013-09-10 11:13:55 +00:00
|
|
|
}
|
|
|
|
return random_number_generator_;
|
|
|
|
}
|
|
|
|
|
2011-04-26 13:53:19 +00:00
|
|
|
} } // namespace v8::internal
|
|
|
|
|
|
|
|
#endif // V8_ISOLATE_INL_H_
|