Upgrade V8 to version 4.9.385.28

https://chromium.googlesource.com/v8/v8/+/4.9.385.28

FPIIM-449

Change-Id: I4b2e74289d4bf3667f2f3dc8aa2e541f63e26eb4
diff --git a/src/isolate-inl.h b/src/isolate-inl.h
index b44c4d6..c27b7a7 100644
--- a/src/isolate-inl.h
+++ b/src/isolate-inl.h
@@ -1,47 +1,104 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
+// 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/base/utils/random-number-generator.h"
-#include "src/debug.h"
 #include "src/isolate.h"
+#include "src/objects-inl.h"
 
 namespace v8 {
 namespace internal {
 
 
-SaveContext::SaveContext(Isolate* isolate)
-  : isolate_(isolate),
-    prev_(isolate->save_context()) {
-  if (isolate->context() != NULL) {
-    context_ = Handle<Context>(isolate->context());
+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<JSGlobalObject> Isolate::global_object() {
+  return Handle<JSGlobalObject>(context()->global_object(), this);
+}
+
+
+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);           \
   }
-  isolate->set_save_context(this);
-
-  c_entry_fp_ = isolate->c_entry_fp(isolate->thread_local_top());
-}
+NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSOR)
+#undef NATIVE_CONTEXT_FIELD_ACCESSOR
 
 
-bool Isolate::DebuggerHasBreakPoints() {
-  return debug()->has_break_points();
-}
-
-
-base::RandomNumberGenerator* Isolate::random_number_generator() {
-  if (random_number_generator_ == NULL) {
-    if (FLAG_random_seed != 0) {
-      random_number_generator_ =
-          new base::RandomNumberGenerator(FLAG_random_seed);
-    } else {
-      random_number_generator_ = new base::RandomNumberGenerator();
-    }
-  }
-  return random_number_generator_;
-}
-
-} }  // namespace v8::internal
+}  // namespace internal
+}  // namespace v8
 
 #endif  // V8_ISOLATE_INL_H_