Revert "Revert "Upgrade to 5.0.71.48"" DO NOT MERGE
This reverts commit f2e3994fa5148cc3d9946666f0b0596290192b0e,
and updates the x64 makefile properly so it doesn't break that
build.
FPIIM-449
Change-Id: Ib83e35bfbae6af627451c926a9650ec57c045605
(cherry picked from commit 109988c7ccb6f3fd1a58574fa3dfb88beaef6632)
diff --git a/include/v8.h b/include/v8.h
index d9ad17c..9ccbc6e 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -329,9 +329,7 @@
friend class PersistentValueMapBase;
template<class F1, class F2> friend class PersistentValueVector;
- template <class S>
- V8_INLINE Local(S* that)
- : val_(that) {}
+ explicit V8_INLINE Local(T* that) : val_(that) {}
V8_INLINE static Local<T> New(Isolate* isolate, T* that);
T* val_;
};
@@ -434,7 +432,10 @@
return internal_fields_[1];
}
- bool IsFirstPass() const { return callback_ != nullptr; }
+ V8_DEPRECATED("Not realiable once SetSecondPassCallback() was used.",
+ bool IsFirstPass() const) {
+ return callback_ != nullptr;
+ }
// When first called, the embedder MUST Reset() the Global which triggered the
// callback. The Global itself is unusable for anything else. No v8 other api
@@ -787,7 +788,7 @@
template<class F1, class F2> friend class Persistent;
template<class F> friend class ReturnValue;
- template <class S> V8_INLINE Persistent(S* that) : PersistentBase<T>(that) { }
+ explicit V8_INLINE Persistent(T* that) : PersistentBase<T>(that) {}
V8_INLINE T* operator*() const { return this->val_; }
template<class S, class M2>
V8_INLINE void Copy(const Persistent<S, M2>& that);
@@ -886,7 +887,7 @@
*/
class V8_EXPORT HandleScope {
public:
- HandleScope(Isolate* isolate);
+ explicit HandleScope(Isolate* isolate);
~HandleScope();
@@ -939,7 +940,7 @@
*/
class V8_EXPORT EscapableHandleScope : public HandleScope {
public:
- EscapableHandleScope(Isolate* isolate);
+ explicit EscapableHandleScope(Isolate* isolate);
V8_INLINE ~EscapableHandleScope() {}
/**
@@ -2678,10 +2679,10 @@
V8_DEPRECATED("Use CreateDataProperty / DefineOwnProperty",
bool ForceSet(Local<Value> key, Local<Value> value,
PropertyAttribute attribs = None));
- V8_DEPRECATED("Use CreateDataProperty / DefineOwnProperty",
- Maybe<bool> ForceSet(Local<Context> context, Local<Value> key,
- Local<Value> value,
- PropertyAttribute attribs = None));
+ V8_DEPRECATE_SOON("Use CreateDataProperty / DefineOwnProperty",
+ Maybe<bool> ForceSet(Local<Context> context,
+ Local<Value> key, Local<Value> value,
+ PropertyAttribute attribs = None));
V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
@@ -3147,7 +3148,8 @@
public:
V8_INLINE int Length() const;
V8_INLINE Local<Value> operator[](int i) const;
- V8_INLINE Local<Function> Callee() const;
+ V8_INLINE V8_DEPRECATED("Use Data() to explicitly pass Callee instead",
+ Local<Function> Callee() const);
V8_INLINE Local<Object> This() const;
V8_INLINE Local<Object> Holder() const;
V8_INLINE bool IsConstructCall() const;
@@ -3191,19 +3193,21 @@
V8_INLINE Local<Object> This() const;
V8_INLINE Local<Object> Holder() const;
V8_INLINE ReturnValue<T> GetReturnValue() const;
+ V8_INLINE bool ShouldThrowOnError() const;
// This shouldn't be public, but the arm compiler needs it.
- static const int kArgsLength = 6;
+ static const int kArgsLength = 7;
protected:
friend class MacroAssembler;
friend class internal::PropertyCallbackArguments;
friend class internal::CustomArguments<PropertyCallbackInfo>;
- static const int kHolderIndex = 0;
- static const int kIsolateIndex = 1;
- static const int kReturnValueDefaultValueIndex = 2;
- static const int kReturnValueIndex = 3;
- static const int kDataIndex = 4;
- static const int kThisIndex = 5;
+ static const int kShouldThrowOnErrorIndex = 0;
+ static const int kHolderIndex = 1;
+ static const int kIsolateIndex = 2;
+ static const int kReturnValueDefaultValueIndex = 3;
+ static const int kReturnValueIndex = 4;
+ static const int kDataIndex = 5;
+ static const int kThisIndex = 6;
V8_INLINE PropertyCallbackInfo(internal::Object** args) : args_(args) {}
internal::Object** args_;
@@ -4322,8 +4326,10 @@
* object.
*/
typedef bool (*AccessCheckCallback)(Local<Context> accessing_context,
- Local<Object> accessed_object);
-
+ Local<Object> accessed_object,
+ Local<Value> data);
+typedef bool (*DeprecatedAccessCheckCallback)(Local<Context> accessing_context,
+ Local<Object> accessed_object);
/**
* Returns true if cross-context access should be allowed to the named
@@ -4753,6 +4759,10 @@
*/
void SetAccessCheckCallback(AccessCheckCallback callback,
Local<Value> data = Local<Value>());
+ V8_DEPRECATED(
+ "Use SetAccessCheckCallback with new AccessCheckCallback signature.",
+ void SetAccessCheckCallback(DeprecatedAccessCheckCallback callback,
+ Local<Value> data = Local<Value>()));
V8_DEPRECATED(
"Use SetAccessCheckCallback instead",
@@ -4999,8 +5009,10 @@
AllocationAction action,
int size);
-// --- Leave Script Callback ---
-typedef void (*CallCompletedCallback)();
+// --- Enter/Leave Script Callback ---
+typedef void (*BeforeCallEnteredCallback)(Isolate*);
+typedef void (*CallCompletedCallback)(Isolate*);
+typedef void (*DeprecatedCallCompletedCallback)();
// --- Promise Reject Callback ---
enum PromiseRejectEvent {
@@ -5069,11 +5081,24 @@
kGCTypeIncrementalMarking | kGCTypeProcessWeakCallbacks
};
+/**
+ * GCCallbackFlags is used to notify additional information about the GC
+ * callback.
+ * - kGCCallbackFlagConstructRetainedObjectInfos: The GC callback is for
+ * constructing retained object infos.
+ * - kGCCallbackFlagForced: The GC callback is for a forced GC for testing.
+ * - kGCCallbackFlagSynchronousPhantomCallbackProcessing: The GC callback
+ * is called synchronously without getting posted to an idle task.
+ * - kGCCallbackFlagCollectAllAvailableGarbage: The GC callback is called
+ * in a phase where V8 is trying to collect all available garbage
+ * (e.g., handling a low memory notification).
+ */
enum GCCallbackFlags {
kNoGCCallbackFlags = 0,
kGCCallbackFlagConstructRetainedObjectInfos = 1 << 1,
kGCCallbackFlagForced = 1 << 2,
- kGCCallbackFlagSynchronousPhantomCallbackProcessing = 1 << 3
+ kGCCallbackFlagSynchronousPhantomCallbackProcessing = 1 << 3,
+ kGCCallbackFlagCollectAllAvailableGarbage = 1 << 4,
};
typedef void (*GCCallback)(GCType type, GCCallbackFlags flags);
@@ -5455,6 +5480,18 @@
kPromiseChain = 17,
kPromiseAccept = 18,
kPromiseDefer = 19,
+ kHtmlCommentInExternalScript = 20,
+ kHtmlComment = 21,
+ kSloppyModeBlockScopedFunctionRedefinition = 22,
+ kForInInitializer = 23,
+ kArrayProtectorDirtied = 24,
+ kArraySpeciesModified = 25,
+ kArrayPrototypeConstructorModified = 26,
+ kArrayInstanceProtoModified = 27,
+ kArrayInstanceConstructorModified = 28,
+
+ // If you add new values here, you'll also need to update V8Initializer.cpp
+ // in Chromium.
kUseCounterFeatureCount // This enum value must be last.
};
@@ -5796,6 +5833,19 @@
void SetEventLogger(LogEventCallback that);
/**
+ * Adds a callback to notify the host application right before a script
+ * is about to run. If a script re-enters the runtime during executing, the
+ * BeforeCallEnteredCallback is invoked for each re-entrance.
+ * Executing scripts inside the callback will re-trigger the callback.
+ */
+ void AddBeforeCallEnteredCallback(BeforeCallEnteredCallback callback);
+
+ /**
+ * Removes callback that was installed by AddBeforeCallEnteredCallback.
+ */
+ void RemoveBeforeCallEnteredCallback(BeforeCallEnteredCallback callback);
+
+ /**
* Adds a callback to notify the host application when a script finished
* running. If a script re-enters the runtime during executing, the
* CallCompletedCallback is only invoked when the outer-most script
@@ -5803,12 +5853,18 @@
* further callbacks.
*/
void AddCallCompletedCallback(CallCompletedCallback callback);
+ V8_DEPRECATE_SOON(
+ "Use callback with parameter",
+ void AddCallCompletedCallback(DeprecatedCallCompletedCallback callback));
/**
* Removes callback that was installed by AddCallCompletedCallback.
*/
void RemoveCallCompletedCallback(CallCompletedCallback callback);
-
+ V8_DEPRECATE_SOON(
+ "Use callback with parameter",
+ void RemoveCallCompletedCallback(
+ DeprecatedCallCompletedCallback callback));
/**
* Set callback to notify about promise reject with no handler, or
@@ -7132,7 +7188,7 @@
static const int kNodeIsPartiallyDependentShift = 4;
static const int kNodeIsActiveShift = 4;
- static const int kJSObjectType = 0xb7;
+ static const int kJSObjectType = 0xb5;
static const int kFirstNonstringType = 0x80;
static const int kOddballType = 0x83;
static const int kForeignType = 0x87;
@@ -8262,6 +8318,12 @@
return ReturnValue<T>(&args_[kReturnValueIndex]);
}
+template <typename T>
+bool PropertyCallbackInfo<T>::ShouldThrowOnError() const {
+ typedef internal::Internals I;
+ return args_[kShouldThrowOnErrorIndex] != I::IntToSmi(0);
+}
+
Local<Primitive> Undefined(Isolate* isolate) {
typedef internal::Object* S;