"src/compiler.h",
"src/context-measure.cc",
"src/context-measure.h",
+ "src/contexts-inl.h",
"src/contexts.cc",
"src/contexts.h",
"src/conversions-inl.h",
"src/interpreter/bytecode-generator.h",
"src/interpreter/interpreter.cc",
"src/interpreter/interpreter.h",
+ "src/isolate-inl.h",
"src/isolate.cc",
"src/isolate.h",
"src/json-parser.h",
#include "src/execution.h"
#include "src/factory.h"
#include "src/frames-inl.h"
-#include "src/isolate.h"
+#include "src/isolate-inl.h"
#include "src/list-inl.h"
#include "src/messages.h"
#include "src/property-details.h"
#include "src/api-natives.h"
#include "src/api.h"
-#include "src/isolate.h"
+#include "src/isolate-inl.h"
#include "src/lookup.h"
#include "src/messages.h"
#include "src/heap-profiler.h"
#include "src/heap-snapshot-generator-inl.h"
#include "src/icu_util.h"
+#include "src/isolate-inl.h"
#include "src/json-parser.h"
#include "src/messages.h"
#include "src/parser.h"
#include "src/arm64/utils-arm64.h"
#include "src/assembler.h"
-#include "src/objects-inl.h" // TODO(mstarzinger): Temporary cycle breaker!
namespace v8 {
namespace internal {
#include "src/extensions/statistics-extension.h"
#include "src/extensions/trigger-failure-extension.h"
#include "src/heap/heap.h"
+#include "src/isolate-inl.h"
#include "src/snapshot/natives.h"
#include "src/snapshot/snapshot.h"
#include "third_party/fdlibm/fdlibm.h"
#include "src/heap-profiler.h"
#include "src/ic/handler-compiler.h"
#include "src/ic/ic.h"
+#include "src/isolate-inl.h"
#include "src/messages.h"
#include "src/prototype.h"
#include "src/vm-state-inl.h"
#include "src/base/platform/platform.h"
#include "src/isolate.h"
-#include "src/objects-inl.h" // TODO(mstarzinger): Temporary cycle breaker!
namespace v8 {
namespace internal {
#include "src/gdb-jit.h"
#include "src/hydrogen.h"
#include "src/interpreter/interpreter.h"
+#include "src/isolate-inl.h"
#include "src/lithium.h"
#include "src/log-inl.h"
#include "src/messages.h"
#include "src/assembler.h"
#include "src/compiler/node.h"
-#include "src/objects-inl.h" // TODO(mstarzinger): Temporary cycle breaker!
namespace v8 {
namespace internal {
#include "src/compiler/source-position.h"
#include "src/compiler/graph.h"
#include "src/compiler/node-aux-data.h"
-#include "src/objects-inl.h" // TODO(mstarzinger): Temporary cycle breaker!
namespace v8 {
namespace internal {
--- /dev/null
+// Copyright 2015 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_CONTEXTS_INL_H_
+#define V8_CONTEXTS_INL_H_
+
+#include "src/contexts.h"
+#include "src/objects-inl.h"
+
+namespace v8 {
+namespace internal {
+
+
+// static
+ScriptContextTable* ScriptContextTable::cast(Object* context) {
+ DCHECK(context->IsScriptContextTable());
+ return reinterpret_cast<ScriptContextTable*>(context);
+}
+
+
+int ScriptContextTable::used() const {
+ return Smi::cast(get(kUsedSlot))->value();
+}
+
+
+void ScriptContextTable::set_used(int used) {
+ set(kUsedSlot, Smi::FromInt(used));
+}
+
+
+// static
+Handle<Context> ScriptContextTable::GetContext(Handle<ScriptContextTable> table,
+ int i) {
+ DCHECK(i < table->used());
+ return Handle<Context>::cast(FixedArray::get(table, i + kFirstContextSlot));
+}
+
+
+// static
+Context* Context::cast(Object* context) {
+ DCHECK(context->IsContext());
+ return reinterpret_cast<Context*>(context);
+}
+
+
+JSFunction* Context::closure() { return JSFunction::cast(get(CLOSURE_INDEX)); }
+void Context::set_closure(JSFunction* closure) { set(CLOSURE_INDEX, closure); }
+
+
+Context* Context::previous() {
+ Object* result = get(PREVIOUS_INDEX);
+ DCHECK(IsBootstrappingOrValidParentContext(result, this));
+ return reinterpret_cast<Context*>(result);
+}
+void Context::set_previous(Context* context) { set(PREVIOUS_INDEX, context); }
+
+
+bool Context::has_extension() { return extension() != nullptr; }
+Object* Context::extension() { return get(EXTENSION_INDEX); }
+void Context::set_extension(Object* object) { set(EXTENSION_INDEX, object); }
+
+
+JSModule* Context::module() { return JSModule::cast(get(EXTENSION_INDEX)); }
+void Context::set_module(JSModule* module) { set(EXTENSION_INDEX, module); }
+
+
+GlobalObject* Context::global_object() {
+ Object* result = get(GLOBAL_OBJECT_INDEX);
+ DCHECK(IsBootstrappingOrGlobalObject(this->GetIsolate(), result));
+ return reinterpret_cast<GlobalObject*>(result);
+}
+
+
+void Context::set_global_object(GlobalObject* object) {
+ set(GLOBAL_OBJECT_INDEX, object);
+}
+
+
+bool Context::IsNativeContext() {
+ Map* map = this->map();
+ return map == map->GetHeap()->native_context_map();
+}
+
+
+bool Context::IsFunctionContext() {
+ Map* map = this->map();
+ return map == map->GetHeap()->function_context_map();
+}
+
+
+bool Context::IsCatchContext() {
+ Map* map = this->map();
+ return map == map->GetHeap()->catch_context_map();
+}
+
+
+bool Context::IsWithContext() {
+ Map* map = this->map();
+ return map == map->GetHeap()->with_context_map();
+}
+
+
+bool Context::IsBlockContext() {
+ Map* map = this->map();
+ return map == map->GetHeap()->block_context_map();
+}
+
+
+bool Context::IsModuleContext() {
+ Map* map = this->map();
+ return map == map->GetHeap()->module_context_map();
+}
+
+
+bool Context::IsScriptContext() {
+ Map* map = this->map();
+ return map == map->GetHeap()->script_context_map();
+}
+
+
+bool Context::HasSameSecurityTokenAs(Context* that) {
+ return this->global_object()->native_context()->security_token() ==
+ that->global_object()->native_context()->security_token();
+}
+
+
+#define NATIVE_CONTEXT_FIELD_ACCESSORS(index, type, name) \
+ void Context::set_##name(type* value) { \
+ DCHECK(IsNativeContext()); \
+ set(index, value); \
+ } \
+ bool Context::is_##name(type* value) { \
+ DCHECK(IsNativeContext()); \
+ return type::cast(get(index)) == value; \
+ } \
+ type* Context::name() { \
+ DCHECK(IsNativeContext()); \
+ return type::cast(get(index)); \
+ }
+NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSORS)
+#undef NATIVE_CONTEXT_FIELD_ACCESSORS
+
+
+} // namespace internal
+} // namespace v8
+
+#endif // V8_CONTEXTS_INL_H_
#include "src/bootstrapper.h"
#include "src/debug/debug.h"
+#include "src/isolate-inl.h"
#include "src/scopeinfo.h"
namespace v8 {
class ScriptContextTable : public FixedArray {
public:
// Conversions.
- static ScriptContextTable* cast(Object* context) {
- DCHECK(context->IsScriptContextTable());
- return reinterpret_cast<ScriptContextTable*>(context);
- }
+ static inline ScriptContextTable* cast(Object* context);
struct LookupResult {
int context_index;
MaybeAssignedFlag maybe_assigned_flag;
};
- int used() const { return Smi::cast(get(kUsedSlot))->value(); }
- void set_used(int used) { set(kUsedSlot, Smi::FromInt(used)); }
+ inline int used() const;
+ inline void set_used(int used);
- static Handle<Context> GetContext(Handle<ScriptContextTable> table, int i) {
- DCHECK(i < table->used());
- return Handle<Context>::cast(FixedArray::get(table, i + kFirstContextSlot));
- }
+ static inline Handle<Context> GetContext(Handle<ScriptContextTable> table,
+ int i);
// Lookup a variable `name` in a ScriptContextTable.
// If it returns true, the variable is found and `result` contains
class Context: public FixedArray {
public:
// Conversions.
- static Context* cast(Object* context) {
- DCHECK(context->IsContext());
- return reinterpret_cast<Context*>(context);
- }
+ static inline Context* cast(Object* context);
// The default context slot layout; indices are FixedArray slot indices.
enum {
};
// Direct slot access.
- JSFunction* closure() { return JSFunction::cast(get(CLOSURE_INDEX)); }
- void set_closure(JSFunction* closure) { set(CLOSURE_INDEX, closure); }
+ inline JSFunction* closure();
+ inline void set_closure(JSFunction* closure);
- Context* previous() {
- Object* result = unchecked_previous();
- DCHECK(IsBootstrappingOrValidParentContext(result, this));
- return reinterpret_cast<Context*>(result);
- }
- void set_previous(Context* context) { set(PREVIOUS_INDEX, context); }
+ inline Context* previous();
+ inline void set_previous(Context* context);
- bool has_extension() { return extension() != nullptr; }
- Object* extension() { return get(EXTENSION_INDEX); }
- void set_extension(Object* object) { set(EXTENSION_INDEX, object); }
+ inline bool has_extension();
+ inline Object* extension();
+ inline void set_extension(Object* object);
JSObject* extension_object();
JSReceiver* extension_receiver();
ScopeInfo* scope_info();
String* catch_name();
- JSModule* module() { return JSModule::cast(get(EXTENSION_INDEX)); }
- void set_module(JSModule* module) { set(EXTENSION_INDEX, module); }
+ inline JSModule* module();
+ inline void set_module(JSModule* module);
// Get the context where var declarations will be hoisted to, which
// may be the context itself.
Context* declaration_context();
bool is_declaration_context();
- GlobalObject* global_object() {
- Object* result = get(GLOBAL_OBJECT_INDEX);
- DCHECK(IsBootstrappingOrGlobalObject(this->GetIsolate(), result));
- return reinterpret_cast<GlobalObject*>(result);
- }
- void set_global_object(GlobalObject* object) {
- set(GLOBAL_OBJECT_INDEX, object);
- }
+ inline GlobalObject* global_object();
+ inline void set_global_object(GlobalObject* object);
// Returns a JSGlobalProxy object or null.
JSObject* global_proxy();
// Predicates for context types. IsNativeContext is also defined on Object
// because we frequently have to know if arbitrary objects are natives
// contexts.
- bool IsNativeContext() {
- Map* map = this->map();
- return map == map->GetHeap()->native_context_map();
- }
- bool IsFunctionContext() {
- Map* map = this->map();
- return map == map->GetHeap()->function_context_map();
- }
- bool IsCatchContext() {
- Map* map = this->map();
- return map == map->GetHeap()->catch_context_map();
- }
- bool IsWithContext() {
- Map* map = this->map();
- return map == map->GetHeap()->with_context_map();
- }
- bool IsBlockContext() {
- Map* map = this->map();
- return map == map->GetHeap()->block_context_map();
- }
- bool IsModuleContext() {
- Map* map = this->map();
- return map == map->GetHeap()->module_context_map();
- }
- bool IsScriptContext() {
- Map* map = this->map();
- return map == map->GetHeap()->script_context_map();
- }
+ inline bool IsNativeContext();
+ inline bool IsFunctionContext();
+ inline bool IsCatchContext();
+ inline bool IsWithContext();
+ inline bool IsBlockContext();
+ inline bool IsModuleContext();
+ inline bool IsScriptContext();
- bool HasSameSecurityTokenAs(Context* that) {
- return this->global_object()->native_context()->security_token() ==
- that->global_object()->native_context()->security_token();
- }
+ inline bool HasSameSecurityTokenAs(Context* that);
// Initializes global variable bindings in given script context.
void InitializeGlobalSlots();
Handle<JSFunction> function);
#define NATIVE_CONTEXT_FIELD_ACCESSORS(index, type, name) \
- void set_##name(type* value) { \
- DCHECK(IsNativeContext()); \
- set(index, value); \
- } \
- bool is_##name(type* value) { \
- DCHECK(IsNativeContext()); \
- return type::cast(get(index)) == value; \
- } \
- type* name() { \
- DCHECK(IsNativeContext()); \
- return type::cast(get(index)); \
- }
+ inline void set_##name(type* value); \
+ inline bool is_##name(type* value); \
+ inline type* name();
NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSORS)
#undef NATIVE_CONTEXT_FIELD_ACCESSORS
kSize> MarkCompactBodyDescriptor;
private:
- // Unchecked access to the slots.
- Object* unchecked_previous() { return get(PREVIOUS_INDEX); }
-
#ifdef DEBUG
// Bootstrapping-aware type checks.
static bool IsBootstrappingOrValidParentContext(Object* object, Context* kid);
#include "src/debug/debug-frames.h"
#include "src/debug/debug-scopes.h"
#include "src/frames-inl.h"
-#include "src/isolate.h"
+#include "src/isolate-inl.h"
namespace v8 {
namespace internal {
#include "src/debug/debug.h"
#include "src/frames-inl.h"
#include "src/globals.h"
+#include "src/isolate-inl.h"
#include "src/parser.h"
#include "src/scopes.h"
#include "src/frames-inl.h"
#include "src/full-codegen/full-codegen.h"
#include "src/global-handles.h"
+#include "src/isolate-inl.h"
#include "src/list.h"
#include "src/log.h"
#include "src/messages.h"
#include "src/deoptimizer.h"
#include "src/frames-inl.h"
#include "src/global-handles.h"
+#include "src/isolate-inl.h"
#include "src/messages.h"
#include "src/parser.h"
#include "src/scopeinfo.h"
#include "src/bootstrapper.h"
#include "src/codegen.h"
#include "src/deoptimizer.h"
+#include "src/isolate-inl.h"
#include "src/messages.h"
#include "src/vm-state-inl.h"
#include "src/base/platform/platform.h"
#include "src/isolate.h"
-#include "src/objects-inl.h" // TODO(mstarzinger): Temporary cycle breaker!
namespace v8 {
namespace internal {
#include "src/counters.h"
#include "src/heap/heap-inl.h"
#include "src/isolate.h"
-#include "src/objects-inl.h" // TODO(mstarzinger): Temporary cycle breaker!
namespace v8 {
namespace internal {
#include "src/base/bits.h"
#include "src/bootstrapper.h"
#include "src/conversions.h"
+#include "src/isolate-inl.h"
#include "src/macro-assembler.h"
namespace v8 {
}
+#define DEFINE_ERROR(NAME, name) \
+ Handle<Object> Factory::New##NAME(MessageTemplate::Template template_index, \
+ Handle<Object> arg0, Handle<Object> arg1, \
+ Handle<Object> arg2) { \
+ return NewError(isolate()->name##_function(), template_index, arg0, arg1, \
+ arg2); \
+ }
+DEFINE_ERROR(Error, error)
+DEFINE_ERROR(EvalError, eval_error)
+DEFINE_ERROR(RangeError, range_error)
+DEFINE_ERROR(ReferenceError, reference_error)
+DEFINE_ERROR(SyntaxError, syntax_error)
+DEFINE_ERROR(TypeError, type_error)
+#undef DEFINE_ERROR
+
+
void Factory::InitializeFunction(Handle<JSFunction> function,
Handle<SharedFunctionInfo> info,
Handle<Context> context) {
Handle<Object> arg1 = Handle<Object>(),
Handle<Object> arg2 = Handle<Object>());
-#define DEFINE_ERROR(NAME, name) \
- Handle<Object> New##NAME(MessageTemplate::Template template_index, \
- Handle<Object> arg0 = Handle<Object>(), \
- Handle<Object> arg1 = Handle<Object>(), \
- Handle<Object> arg2 = Handle<Object>()) { \
- return NewError(isolate()->name##_function(), template_index, arg0, arg1, \
- arg2); \
- }
-
- DEFINE_ERROR(Error, error)
- DEFINE_ERROR(EvalError, eval_error)
- DEFINE_ERROR(RangeError, range_error)
- DEFINE_ERROR(ReferenceError, reference_error)
- DEFINE_ERROR(SyntaxError, syntax_error)
- DEFINE_ERROR(TypeError, type_error)
+#define DECLARE_ERROR(NAME) \
+ Handle<Object> New##NAME(MessageTemplate::Template template_index, \
+ Handle<Object> arg0 = Handle<Object>(), \
+ Handle<Object> arg1 = Handle<Object>(), \
+ Handle<Object> arg2 = Handle<Object>());
+ DECLARE_ERROR(Error)
+ DECLARE_ERROR(EvalError)
+ DECLARE_ERROR(RangeError)
+ DECLARE_ERROR(ReferenceError)
+ DECLARE_ERROR(SyntaxError)
+ DECLARE_ERROR(TypeError)
#undef DEFINE_ERROR
Handle<String> NumberToString(Handle<Object> number,
#include "src/assembler.h"
#include "src/base/functional.h"
#include "src/base/platform/platform.h"
-#include "src/objects-inl.h" // TODO(mstarzinger): Temporary cycle breaker!
+#include "src/list-inl.h"
#include "src/ostreams.h"
#include "src/utils.h"
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "src/full-codegen/full-codegen.h"
+
#include "src/ast.h"
#include "src/ast-numbering.h"
#include "src/code-factory.h"
#include "src/compiler.h"
#include "src/debug/debug.h"
#include "src/debug/liveedit.h"
-#include "src/full-codegen/full-codegen.h"
+#include "src/isolate-inl.h"
#include "src/macro-assembler.h"
#include "src/prettyprinter.h"
#include "src/scopeinfo.h"
#include "src/heap/gc-tracer.h"
#include "src/counters.h"
-#include "src/heap/heap.h"
+#include "src/heap/heap-inl.h"
#include "src/isolate.h"
-#include "src/objects-inl.h" // TODO(mstarzinger): Temporary cycle breaker!
namespace v8 {
namespace internal {
#include "src/list-inl.h"
#include "src/log.h"
#include "src/msan.h"
-#include "src/objects.h"
+#include "src/objects-inl.h"
namespace v8 {
namespace internal {
#include "src/flags.h"
#include "src/heap/gc-tracer.h"
-#include "src/heap/heap.h"
-#include "src/objects-inl.h" // TODO(mstarzinger): Temporary cycle breaker!
+#include "src/heap/heap-inl.h"
#include "src/utils.h"
#include "src/v8.h"
#include "src/ic/ic.h"
// GetRootConstructor
#include "src/ic/ic-inl.h"
+#include "src/isolate-inl.h"
#include "src/lithium-allocator.h"
#include "src/parser.h"
#include "src/runtime/runtime.h"
#include "src/ic/call-optimization.h"
#include "src/ic/handler-compiler.h"
#include "src/ic/ic.h"
+#include "src/isolate-inl.h"
namespace v8 {
namespace internal {
#include "src/ic/call-optimization.h"
#include "src/ic/handler-compiler.h"
#include "src/ic/ic.h"
+#include "src/isolate-inl.h"
namespace v8 {
namespace internal {
#include "src/ic/call-optimization.h"
#include "src/ic/ic.h"
#include "src/ic/ic-inl.h"
+#include "src/isolate-inl.h"
namespace v8 {
namespace internal {
#include "src/ic/call-optimization.h"
#include "src/ic/handler-compiler.h"
#include "src/ic/ic.h"
+#include "src/isolate-inl.h"
namespace v8 {
namespace internal {
#include "src/ic/ic-inl.h"
#include "src/ic/ic-compiler.h"
#include "src/ic/stub-cache.h"
+#include "src/isolate-inl.h"
#include "src/macro-assembler.h"
#include "src/prototype.h"
#include "src/runtime/runtime.h"
#include "src/ic/call-optimization.h"
#include "src/ic/handler-compiler.h"
#include "src/ic/ic.h"
+#include "src/isolate-inl.h"
namespace v8 {
namespace internal {
#include "src/ic/call-optimization.h"
#include "src/ic/handler-compiler.h"
#include "src/ic/ic.h"
+#include "src/isolate-inl.h"
namespace v8 {
namespace internal {
#include "src/ic/call-optimization.h"
#include "src/ic/handler-compiler.h"
#include "src/ic/ic.h"
+#include "src/isolate-inl.h"
namespace v8 {
namespace internal {
#include "src/ic/call-optimization.h"
#include "src/ic/handler-compiler.h"
#include "src/ic/ic.h"
+#include "src/isolate-inl.h"
namespace v8 {
namespace internal {
#include "src/ic/call-optimization.h"
#include "src/ic/handler-compiler.h"
#include "src/ic/ic.h"
+#include "src/isolate-inl.h"
namespace v8 {
namespace internal {
--- /dev/null
+// Copyright 2015 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 "src/isolate.h"
+#include "src/objects-inl.h"
+
+namespace v8 {
+namespace internal {
+
+
+void Isolate::set_context(Context* context) {
+ DCHECK(context == NULL || context->IsContext());
+ thread_local_top_.context_ = context;
+}
+
+
+Object* Isolate::pending_exception() {
+ DCHECK(has_pending_exception());
+ DCHECK(!thread_local_top_.pending_exception_->IsException());
+ return thread_local_top_.pending_exception_;
+}
+
+
+void Isolate::set_pending_exception(Object* exception_obj) {
+ DCHECK(!exception_obj->IsException());
+ thread_local_top_.pending_exception_ = exception_obj;
+}
+
+
+void Isolate::clear_pending_exception() {
+ DCHECK(!thread_local_top_.pending_exception_->IsException());
+ thread_local_top_.pending_exception_ = heap_.the_hole_value();
+}
+
+
+bool Isolate::has_pending_exception() {
+ DCHECK(!thread_local_top_.pending_exception_->IsException());
+ return !thread_local_top_.pending_exception_->IsTheHole();
+}
+
+
+void Isolate::clear_pending_message() {
+ thread_local_top_.pending_message_obj_ = heap_.the_hole_value();
+}
+
+
+Object* Isolate::scheduled_exception() {
+ DCHECK(has_scheduled_exception());
+ DCHECK(!thread_local_top_.scheduled_exception_->IsException());
+ return thread_local_top_.scheduled_exception_;
+}
+
+
+bool Isolate::has_scheduled_exception() {
+ DCHECK(!thread_local_top_.scheduled_exception_->IsException());
+ return thread_local_top_.scheduled_exception_ != heap_.the_hole_value();
+}
+
+
+void Isolate::clear_scheduled_exception() {
+ DCHECK(!thread_local_top_.scheduled_exception_->IsException());
+ thread_local_top_.scheduled_exception_ = heap_.the_hole_value();
+}
+
+
+bool Isolate::is_catchable_by_javascript(Object* exception) {
+ return exception != heap()->termination_exception();
+}
+
+
+Handle<GlobalObject> Isolate::global_object() {
+ return Handle<GlobalObject>(context()->global_object());
+}
+
+
+Isolate::ExceptionScope::ExceptionScope(Isolate* isolate)
+ : isolate_(isolate),
+ pending_exception_(isolate_->pending_exception(), isolate_) {}
+
+
+Isolate::ExceptionScope::~ExceptionScope() {
+ isolate_->set_pending_exception(*pending_exception_);
+}
+
+
+#define NATIVE_CONTEXT_FIELD_ACCESSOR(index, type, name) \
+ Handle<type> Isolate::name() { \
+ return Handle<type>(native_context()->name(), this); \
+ } \
+ bool Isolate::is_##name(type* value) { \
+ return native_context()->is_##name(value); \
+ }
+NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSOR)
+#undef NATIVE_CONTEXT_FIELD_ACCESSOR
+
+
+} // namespace internal
+} // namespace v8
+
+#endif // V8_ISOLATE_INL_H_
#include "src/hydrogen.h"
#include "src/ic/stub-cache.h"
#include "src/interpreter/interpreter.h"
+#include "src/isolate-inl.h"
#include "src/lithium-allocator.h"
#include "src/log.h"
#include "src/messages.h"
}
+SaveContext::~SaveContext() {
+ isolate_->set_context(context_.is_null() ? NULL : *context_);
+ isolate_->set_save_context(prev_);
+}
+
+
+#ifdef DEBUG
+AssertNoContextChange::AssertNoContextChange(Isolate* isolate)
+ : isolate_(isolate), context_(isolate->context(), isolate) {}
+#endif // DEBUG
+
+
bool PostponeInterruptsScope::Intercept(StackGuard::InterruptFlag flag) {
// First check whether the previous scope intercepts.
if (prev_ && prev_->Intercept(flag)) return true;
// Access to top context (where the current function object was created).
Context* context() { return thread_local_top_.context_; }
- void set_context(Context* context) {
- DCHECK(context == NULL || context->IsContext());
- thread_local_top_.context_ = context;
- }
+ inline void set_context(Context* context);
Context** context_address() { return &thread_local_top_.context_; }
THREAD_LOCAL_TOP_ACCESSOR(SaveContext*, save_context)
THREAD_LOCAL_TOP_ACCESSOR(ThreadId, thread_id)
// Interface to pending exception.
- Object* pending_exception() {
- DCHECK(has_pending_exception());
- DCHECK(!thread_local_top_.pending_exception_->IsException());
- return thread_local_top_.pending_exception_;
- }
-
- void set_pending_exception(Object* exception_obj) {
- DCHECK(!exception_obj->IsException());
- thread_local_top_.pending_exception_ = exception_obj;
- }
-
- void clear_pending_exception() {
- DCHECK(!thread_local_top_.pending_exception_->IsException());
- thread_local_top_.pending_exception_ = heap_.the_hole_value();
- }
+ inline Object* pending_exception();
+ inline void set_pending_exception(Object* exception_obj);
+ inline void clear_pending_exception();
THREAD_LOCAL_TOP_ADDRESS(Object*, pending_exception)
- bool has_pending_exception() {
- DCHECK(!thread_local_top_.pending_exception_->IsException());
- return !thread_local_top_.pending_exception_->IsTheHole();
- }
+ inline bool has_pending_exception();
THREAD_LOCAL_TOP_ADDRESS(Context*, pending_handler_context)
THREAD_LOCAL_TOP_ADDRESS(Code*, pending_handler_code)
THREAD_LOCAL_TOP_ACCESSOR(bool, external_caught_exception)
- void clear_pending_message() {
- thread_local_top_.pending_message_obj_ = heap_.the_hole_value();
- }
v8::TryCatch* try_catch_handler() {
return thread_local_top_.try_catch_handler();
}
THREAD_LOCAL_TOP_ADDRESS(Object*, scheduled_exception)
+ inline void clear_pending_message();
Address pending_message_obj_address() {
return reinterpret_cast<Address>(&thread_local_top_.pending_message_obj_);
}
- Object* scheduled_exception() {
- DCHECK(has_scheduled_exception());
- DCHECK(!thread_local_top_.scheduled_exception_->IsException());
- return thread_local_top_.scheduled_exception_;
- }
- bool has_scheduled_exception() {
- DCHECK(!thread_local_top_.scheduled_exception_->IsException());
- return thread_local_top_.scheduled_exception_ != heap_.the_hole_value();
- }
- void clear_scheduled_exception() {
- DCHECK(!thread_local_top_.scheduled_exception_->IsException());
- thread_local_top_.scheduled_exception_ = heap_.the_hole_value();
- }
+ inline Object* scheduled_exception();
+ inline bool has_scheduled_exception();
+ inline void clear_scheduled_exception();
bool IsJavaScriptHandlerOnTop(Object* exception);
bool IsExternalHandlerOnTop(Object* exception);
- bool is_catchable_by_javascript(Object* exception) {
- return exception != heap()->termination_exception();
- }
+ inline bool is_catchable_by_javascript(Object* exception);
// JS execution stack (see frames.h).
static Address c_entry_fp(ThreadLocalTop* thread) {
// Returns the global object of the current context. It could be
// a builtin object, or a JS global object.
- Handle<GlobalObject> global_object() {
- return Handle<GlobalObject>(context()->global_object());
- }
+ inline Handle<GlobalObject> global_object();
// Returns the global proxy object of the current context.
JSObject* global_proxy() {
public:
// Scope currently can only be used for regular exceptions,
// not termination exception.
- explicit ExceptionScope(Isolate* isolate)
- : isolate_(isolate),
- pending_exception_(isolate_->pending_exception(), isolate_) {}
-
- ~ExceptionScope() {
- isolate_->set_pending_exception(*pending_exception_);
- }
+ inline explicit ExceptionScope(Isolate* isolate);
+ inline ~ExceptionScope();
private:
Isolate* isolate_;
ISOLATE_INIT_ARRAY_LIST(GLOBAL_ARRAY_ACCESSOR)
#undef GLOBAL_ARRAY_ACCESSOR
-#define NATIVE_CONTEXT_FIELD_ACCESSOR(index, type, name) \
- Handle<type> name() { \
- return Handle<type>(native_context()->name(), this); \
- } \
- bool is_##name(type* value) { \
- return native_context()->is_##name(value); \
- }
+#define NATIVE_CONTEXT_FIELD_ACCESSOR(index, type, name) \
+ inline Handle<type> name(); \
+ inline bool is_##name(type* value);
NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSOR)
#undef NATIVE_CONTEXT_FIELD_ACCESSOR
class SaveContext BASE_EMBEDDED {
public:
explicit SaveContext(Isolate* isolate);
-
- ~SaveContext() {
- isolate_->set_context(context_.is_null() ? NULL : *context_);
- isolate_->set_save_context(prev_);
- }
+ ~SaveContext();
Handle<Context> context() { return context_; }
SaveContext* prev() { return prev_; }
class AssertNoContextChange BASE_EMBEDDED {
#ifdef DEBUG
public:
- explicit AssertNoContextChange(Isolate* isolate)
- : isolate_(isolate),
- context_(isolate->context(), isolate) { }
+ explicit AssertNoContextChange(Isolate* isolate);
~AssertNoContextChange() {
DCHECK(isolate_->context() == *context_);
}
#include "src/bootstrapper.h"
#include "src/deoptimizer.h"
+#include "src/isolate-inl.h"
#include "src/lookup-inl.h"
namespace v8 {
#include "src/api.h"
#include "src/execution.h"
+#include "src/isolate-inl.h"
#include "src/string-builder.h"
namespace v8 {
#include "src/base/atomicops.h"
#include "src/base/bits.h"
-#include "src/contexts.h"
+#include "src/contexts-inl.h"
#include "src/conversions-inl.h"
#include "src/factory.h"
#include "src/field-index-inl.h"
#include "src/hydrogen.h"
#include "src/ic/ic.h"
#include "src/interpreter/bytecodes.h"
+#include "src/isolate-inl.h"
#include "src/log.h"
#include "src/lookup.h"
#include "src/macro-assembler.h"
#include "src/compiler.h"
#include "src/execution.h"
#include "src/factory.h"
+#include "src/isolate-inl.h"
#include "src/messages.h"
#include "src/ostreams.h"
#include "src/parser.h"
#include "src/assembler.h"
#include "src/ast.h"
+#include "src/isolate-inl.h"
#include "src/regexp/regexp-stack.h"
#include "src/simulator.h"
#include "src/regexp/regexp-stack.h"
#include "src/isolate.h"
-#include "src/objects-inl.h" // TODO(mstarzinger): Temporary cycle breaker!
namespace v8 {
namespace internal {
#include "src/conversions-inl.h"
#include "src/elements.h"
#include "src/factory.h"
+#include "src/isolate-inl.h"
#include "src/messages.h"
#include "src/prototype.h"
#include "src/arguments.h"
#include "src/debug/debug.h"
#include "src/frames-inl.h"
+#include "src/isolate-inl.h"
#include "src/messages.h"
#include "src/runtime/runtime.h"
#include "src/deoptimizer.h"
#include "src/frames-inl.h"
#include "src/full-codegen/full-codegen.h"
+#include "src/isolate-inl.h"
#include "src/messages.h"
#include "src/v8threads.h"
#include "src/vm-state-inl.h"
#include "src/date.h"
#include "src/dateparser-inl.h"
#include "src/factory.h"
+#include "src/isolate-inl.h"
#include "src/messages.h"
namespace v8 {
#include "src/debug/debug-frames.h"
#include "src/debug/debug-scopes.h"
#include "src/frames-inl.h"
+#include "src/isolate-inl.h"
#include "src/runtime/runtime.h"
namespace v8 {
#include "src/cpu-profiler.h"
#include "src/deoptimizer.h"
#include "src/frames-inl.h"
+#include "src/isolate-inl.h"
#include "src/messages.h"
namespace v8 {
#include "src/arguments.h"
#include "src/factory.h"
#include "src/i18n.h"
+#include "src/isolate-inl.h"
#include "src/messages.h"
#include "unicode/brkiter.h"
#include "src/conversions.h"
#include "src/debug/debug.h"
#include "src/frames-inl.h"
+#include "src/isolate-inl.h"
#include "src/messages.h"
#include "src/parser.h"
#include "src/prettyprinter.h"
#include "src/arguments.h"
#include "src/char-predicates-inl.h"
+#include "src/isolate-inl.h"
#include "src/json-parser.h"
#include "src/json-stringifier.h"
#include "src/objects-inl.h"
#include "src/allocation-site-scopes.h"
#include "src/arguments.h"
#include "src/ast.h"
+#include "src/isolate-inl.h"
#include "src/parser.h"
#include "src/runtime/runtime.h"
#include "src/debug/debug-frames.h"
#include "src/debug/liveedit.h"
#include "src/frames-inl.h"
+#include "src/isolate-inl.h"
#include "src/runtime/runtime.h"
namespace v8 {
#include "src/arguments.h"
#include "src/bootstrapper.h"
#include "src/debug/debug.h"
+#include "src/isolate-inl.h"
#include "src/messages.h"
#include "src/runtime/runtime.h"
#include "src/arguments.h"
#include "src/debug/debug.h"
+#include "src/isolate-inl.h"
namespace v8 {
namespace internal {
#include "src/arguments.h"
#include "src/conversions-inl.h"
+#include "src/isolate-inl.h"
#include "src/messages.h"
#include "src/regexp/jsregexp-inl.h"
#include "src/regexp/jsregexp.h"
#include "src/accessors.h"
#include "src/arguments.h"
#include "src/frames-inl.h"
+#include "src/isolate-inl.h"
#include "src/messages.h"
#include "src/scopeinfo.h"
#include "src/scopes.h"
#include "src/arguments.h"
#include "src/conversions-inl.h"
+#include "src/isolate-inl.h"
#include "src/regexp/jsregexp-inl.h"
#include "src/regexp/jsregexp.h"
#include "src/string-builder.h"
#include "src/arguments.h"
#include "src/conversions.h"
+#include "src/isolate-inl.h"
#include "src/objects-inl.h"
#include "src/string-search.h"
#include "src/utils.h"
#include "src/string-builder.h"
+#include "src/isolate-inl.h"
#include "src/objects-inl.h"
namespace v8 {
#include "src/bootstrapper.h"
#include "src/debug/debug.h"
#include "src/execution.h"
+#include "src/isolate-inl.h"
#include "src/regexp/regexp-stack.h"
namespace v8 {
#define CCTEST_H_
#include "include/libplatform/libplatform.h"
+#include "src/isolate-inl.h" // TODO(everyone): Make cctest IWYU.
#include "src/objects-inl.h" // TODO(everyone): Make cctest IWYU.
#include "src/v8.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/node-properties.h"
#include "src/compiler/typer.h"
+#include "src/isolate-inl.h"
#include "test/unittests/compiler/graph-unittest.h"
#include "test/unittests/compiler/node-test-utils.h"
#include "testing/gmock-support.h"
#include "src/compiler/machine-operator.h"
#include "src/compiler/node-properties.h"
#include "src/compiler/operator-properties.h"
+#include "src/isolate-inl.h"
#include "test/unittests/compiler/compiler-test-utils.h"
#include "test/unittests/compiler/graph-unittest.h"
#include "test/unittests/compiler/node-test-utils.h"
'../../src/compiler.h',
'../../src/context-measure.cc',
'../../src/context-measure.h',
+ '../../src/contexts-inl.h',
'../../src/contexts.cc',
'../../src/contexts.h',
'../../src/conversions-inl.h',
'../../src/interpreter/bytecode-array-builder.h',
'../../src/interpreter/interpreter.cc',
'../../src/interpreter/interpreter.h',
+ '../../src/isolate-inl.h',
'../../src/isolate.cc',
'../../src/isolate.h',
'../../src/json-parser.h',