summaryrefslogtreecommitdiff
path: root/deps/v8/src/isolate-inl.h
blob: eebdcee9bdcc512d878f7c136b399359b1b16426 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright 2011 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_ISOLATE_INL_H_
#define V8_ISOLATE_INL_H_

#include "debug.h"
#include "isolate.h"
#include "utils/random-number-generator.h"

namespace v8 {
namespace internal {


SaveContext::SaveContext(Isolate* isolate)
  : isolate_(isolate),
    prev_(isolate->save_context()) {
  if (isolate->context() != NULL) {
    context_ = Handle<Context>(isolate->context());
  }
  isolate->set_save_context(this);

  c_entry_fp_ = isolate->c_entry_fp(isolate->thread_local_top());
}


bool Isolate::IsCodePreAgingActive() {
  return FLAG_optimize_for_size && FLAG_age_code && !IsDebuggerActive();
}


bool Isolate::IsDebuggerActive() {
  return debugger()->IsDebuggerActive();
}


bool Isolate::DebuggerHasBreakPoints() {
  return debug()->has_break_points();
}


RandomNumberGenerator* Isolate::random_number_generator() {
  if (random_number_generator_ == NULL) {
    random_number_generator_ = new RandomNumberGenerator;
  }
  return random_number_generator_;
}

} }  // namespace v8::internal

#endif  // V8_ISOLATE_INL_H_