Make v8::Handle as "deprecated soon"
BUG=v8:4131 R=bmeurer@chromium.org LOG=n Review URL: https://codereview.chromium.org/1224623004 Cr-Commit-Position: refs/heads/master@{#29473}
This commit is contained in:
parent
b8ecd94c72
commit
f022e53b95
@ -60,20 +60,20 @@ class V8_EXPORT Debug {
|
||||
* callbacks as their content becomes invalid. These objects are from the
|
||||
* debugger event that started the debug message loop.
|
||||
*/
|
||||
virtual Handle<Object> GetExecutionState() const = 0;
|
||||
virtual Handle<Object> GetEventData() const = 0;
|
||||
virtual Local<Object> GetExecutionState() const = 0;
|
||||
virtual Local<Object> GetEventData() const = 0;
|
||||
|
||||
/**
|
||||
* Get the debugger protocol JSON.
|
||||
*/
|
||||
virtual Handle<String> GetJSON() const = 0;
|
||||
virtual Local<String> GetJSON() const = 0;
|
||||
|
||||
/**
|
||||
* Get the context active when the debug event happened. Note this is not
|
||||
* the current active context as the JavaScript part of the debugger is
|
||||
* running in its own context which is entered at this point.
|
||||
*/
|
||||
virtual Handle<Context> GetEventContext() const = 0;
|
||||
virtual Local<Context> GetEventContext() const = 0;
|
||||
|
||||
/**
|
||||
* Client data passed with the corresponding request if any. This is the
|
||||
@ -104,21 +104,21 @@ class V8_EXPORT Debug {
|
||||
* Access to execution state and event data of the debug event. Don't store
|
||||
* these cross callbacks as their content becomes invalid.
|
||||
*/
|
||||
virtual Handle<Object> GetExecutionState() const = 0;
|
||||
virtual Handle<Object> GetEventData() const = 0;
|
||||
virtual Local<Object> GetExecutionState() const = 0;
|
||||
virtual Local<Object> GetEventData() const = 0;
|
||||
|
||||
/**
|
||||
* Get the context active when the debug event happened. Note this is not
|
||||
* the current active context as the JavaScript part of the debugger is
|
||||
* running in its own context which is entered at this point.
|
||||
*/
|
||||
virtual Handle<Context> GetEventContext() const = 0;
|
||||
virtual Local<Context> GetEventContext() const = 0;
|
||||
|
||||
/**
|
||||
* Client data passed with the corresponding callback when it was
|
||||
* registered.
|
||||
*/
|
||||
virtual Handle<Value> GetCallbackData() const = 0;
|
||||
virtual Local<Value> GetCallbackData() const = 0;
|
||||
|
||||
/**
|
||||
* Client data passed to DebugBreakForCommand function. The
|
||||
@ -156,7 +156,7 @@ class V8_EXPORT Debug {
|
||||
typedef void (*DebugMessageDispatchHandler)();
|
||||
|
||||
static bool SetDebugEventListener(EventCallback that,
|
||||
Handle<Value> data = Handle<Value>());
|
||||
Local<Value> data = Local<Value>());
|
||||
|
||||
// Schedule a debugger break to happen when JavaScript code is run
|
||||
// in the given isolate.
|
||||
@ -196,20 +196,20 @@ class V8_EXPORT Debug {
|
||||
*/
|
||||
static V8_DEPRECATE_SOON(
|
||||
"Use maybe version",
|
||||
Local<Value> Call(v8::Handle<v8::Function> fun,
|
||||
Handle<Value> data = Handle<Value>()));
|
||||
Local<Value> Call(v8::Local<v8::Function> fun,
|
||||
Local<Value> data = Local<Value>()));
|
||||
// TODO(dcarney): data arg should be a MaybeLocal
|
||||
static MaybeLocal<Value> Call(Local<Context> context,
|
||||
v8::Handle<v8::Function> fun,
|
||||
Handle<Value> data = Handle<Value>());
|
||||
v8::Local<v8::Function> fun,
|
||||
Local<Value> data = Local<Value>());
|
||||
|
||||
/**
|
||||
* Returns a mirror object for the given object.
|
||||
*/
|
||||
static V8_DEPRECATE_SOON("Use maybe version",
|
||||
Local<Value> GetMirror(v8::Handle<v8::Value> obj));
|
||||
Local<Value> GetMirror(v8::Local<v8::Value> obj));
|
||||
static MaybeLocal<Value> GetMirror(Local<Context> context,
|
||||
v8::Handle<v8::Value> obj);
|
||||
v8::Local<v8::Value> obj);
|
||||
|
||||
/**
|
||||
* Makes V8 process all pending debug messages.
|
||||
|
@ -60,13 +60,13 @@ class V8_EXPORT CpuProfileNode {
|
||||
};
|
||||
|
||||
/** Returns function name (empty string for anonymous functions.) */
|
||||
Handle<String> GetFunctionName() const;
|
||||
Local<String> GetFunctionName() const;
|
||||
|
||||
/** Returns id of the script where function is located. */
|
||||
int GetScriptId() const;
|
||||
|
||||
/** Returns resource name for script from where the function originates. */
|
||||
Handle<String> GetScriptResourceName() const;
|
||||
Local<String> GetScriptResourceName() const;
|
||||
|
||||
/**
|
||||
* Returns the number, 1-based, of the line where the function originates.
|
||||
@ -129,7 +129,7 @@ class V8_EXPORT CpuProfileNode {
|
||||
class V8_EXPORT CpuProfile {
|
||||
public:
|
||||
/** Returns CPU profile title. */
|
||||
Handle<String> GetTitle() const;
|
||||
Local<String> GetTitle() const;
|
||||
|
||||
/** Returns the root node of the top down call tree. */
|
||||
const CpuProfileNode* GetTopDownRoot() const;
|
||||
@ -198,13 +198,13 @@ class V8_EXPORT CpuProfiler {
|
||||
* |record_samples| parameter controls whether individual samples should
|
||||
* be recorded in addition to the aggregated tree.
|
||||
*/
|
||||
void StartProfiling(Handle<String> title, bool record_samples = false);
|
||||
void StartProfiling(Local<String> title, bool record_samples = false);
|
||||
|
||||
/**
|
||||
* Stops collecting CPU profile with a given title and returns it.
|
||||
* If the title given is empty, finishes the last profile started.
|
||||
*/
|
||||
CpuProfile* StopProfiling(Handle<String> title);
|
||||
CpuProfile* StopProfiling(Local<String> title);
|
||||
|
||||
/**
|
||||
* Tells the profiler whether the embedder is idle.
|
||||
@ -246,7 +246,7 @@ class V8_EXPORT HeapGraphEdge {
|
||||
* Returns edge name. This can be a variable name, an element index, or
|
||||
* a property name.
|
||||
*/
|
||||
Handle<Value> GetName() const;
|
||||
Local<Value> GetName() const;
|
||||
|
||||
/** Returns origin node. */
|
||||
const HeapGraphNode* GetFromNode() const;
|
||||
@ -287,7 +287,7 @@ class V8_EXPORT HeapGraphNode {
|
||||
* of the constructor (for objects), the name of the function (for
|
||||
* closures), string value, or an empty string (for compiled code).
|
||||
*/
|
||||
Handle<String> GetName() const;
|
||||
Local<String> GetName() const;
|
||||
|
||||
/**
|
||||
* Returns node id. For the same heap object, the id remains the same
|
||||
@ -430,8 +430,8 @@ class V8_EXPORT HeapProfiler {
|
||||
* while the callback is running: only getters on the handle and
|
||||
* GetPointerFromInternalField on the objects are allowed.
|
||||
*/
|
||||
typedef RetainedObjectInfo* (*WrapperInfoCallback)
|
||||
(uint16_t class_id, Handle<Value> wrapper);
|
||||
typedef RetainedObjectInfo* (*WrapperInfoCallback)(uint16_t class_id,
|
||||
Local<Value> wrapper);
|
||||
|
||||
/** Returns the number of snapshots taken. */
|
||||
int GetSnapshotCount();
|
||||
@ -443,13 +443,13 @@ class V8_EXPORT HeapProfiler {
|
||||
* Returns SnapshotObjectId for a heap object referenced by |value| if
|
||||
* it has been seen by the heap profiler, kUnknownObjectId otherwise.
|
||||
*/
|
||||
SnapshotObjectId GetObjectId(Handle<Value> value);
|
||||
SnapshotObjectId GetObjectId(Local<Value> value);
|
||||
|
||||
/**
|
||||
* Returns heap object with given SnapshotObjectId if the object is alive,
|
||||
* otherwise empty handle is returned.
|
||||
*/
|
||||
Handle<Value> FindObjectById(SnapshotObjectId id);
|
||||
Local<Value> FindObjectById(SnapshotObjectId id);
|
||||
|
||||
/**
|
||||
* Clears internal map from SnapshotObjectId to heap object. The new objects
|
||||
@ -474,7 +474,8 @@ class V8_EXPORT HeapProfiler {
|
||||
* Returns name to be used in the heap snapshot for given node. Returned
|
||||
* string must stay alive until snapshot collection is completed.
|
||||
*/
|
||||
virtual const char* GetName(Handle<Object> object) = 0;
|
||||
virtual const char* GetName(Local<Object> object) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~ObjectNameResolver() {}
|
||||
};
|
||||
|
540
include/v8.h
540
include/v8.h
File diff suppressed because it is too large
Load Diff
445
src/api.cc
445
src/api.cc
File diff suppressed because it is too large
Load Diff
@ -11,18 +11,18 @@ namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
|
||||
template<typename T>
|
||||
template<typename V>
|
||||
v8::Handle<V> CustomArguments<T>::GetReturnValue(Isolate* isolate) {
|
||||
template <typename T>
|
||||
template <typename V>
|
||||
v8::Local<V> CustomArguments<T>::GetReturnValue(Isolate* isolate) {
|
||||
// Check the ReturnValue.
|
||||
Object** handle = &this->begin()[kReturnValueOffset];
|
||||
// Nothing was set, return empty handle as per previous behaviour.
|
||||
if ((*handle)->IsTheHole()) return v8::Handle<V>();
|
||||
if ((*handle)->IsTheHole()) return v8::Local<V>();
|
||||
return Utils::Convert<Object, V>(Handle<Object>(handle));
|
||||
}
|
||||
|
||||
|
||||
v8::Handle<v8::Value> FunctionCallbackArguments::Call(FunctionCallback f) {
|
||||
v8::Local<v8::Value> FunctionCallbackArguments::Call(FunctionCallback f) {
|
||||
Isolate* isolate = this->isolate();
|
||||
VMState<EXTERNAL> state(isolate);
|
||||
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
|
||||
@ -35,40 +35,39 @@ v8::Handle<v8::Value> FunctionCallbackArguments::Call(FunctionCallback f) {
|
||||
}
|
||||
|
||||
|
||||
#define WRITE_CALL_0(Function, ReturnValue) \
|
||||
v8::Handle<ReturnValue> PropertyCallbackArguments::Call(Function f) { \
|
||||
Isolate* isolate = this->isolate(); \
|
||||
VMState<EXTERNAL> state(isolate); \
|
||||
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
|
||||
PropertyCallbackInfo<ReturnValue> info(begin()); \
|
||||
f(info); \
|
||||
return GetReturnValue<ReturnValue>(isolate); \
|
||||
}
|
||||
#define WRITE_CALL_0(Function, ReturnValue) \
|
||||
v8::Local<ReturnValue> PropertyCallbackArguments::Call(Function f) { \
|
||||
Isolate* isolate = this->isolate(); \
|
||||
VMState<EXTERNAL> state(isolate); \
|
||||
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
|
||||
PropertyCallbackInfo<ReturnValue> info(begin()); \
|
||||
f(info); \
|
||||
return GetReturnValue<ReturnValue>(isolate); \
|
||||
}
|
||||
|
||||
|
||||
#define WRITE_CALL_1(Function, ReturnValue, Arg1) \
|
||||
v8::Handle<ReturnValue> PropertyCallbackArguments::Call(Function f, \
|
||||
Arg1 arg1) { \
|
||||
Isolate* isolate = this->isolate(); \
|
||||
VMState<EXTERNAL> state(isolate); \
|
||||
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
|
||||
PropertyCallbackInfo<ReturnValue> info(begin()); \
|
||||
f(arg1, info); \
|
||||
return GetReturnValue<ReturnValue>(isolate); \
|
||||
}
|
||||
#define WRITE_CALL_1(Function, ReturnValue, Arg1) \
|
||||
v8::Local<ReturnValue> PropertyCallbackArguments::Call(Function f, \
|
||||
Arg1 arg1) { \
|
||||
Isolate* isolate = this->isolate(); \
|
||||
VMState<EXTERNAL> state(isolate); \
|
||||
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
|
||||
PropertyCallbackInfo<ReturnValue> info(begin()); \
|
||||
f(arg1, info); \
|
||||
return GetReturnValue<ReturnValue>(isolate); \
|
||||
}
|
||||
|
||||
|
||||
#define WRITE_CALL_2(Function, ReturnValue, Arg1, Arg2) \
|
||||
v8::Handle<ReturnValue> PropertyCallbackArguments::Call(Function f, \
|
||||
Arg1 arg1, \
|
||||
Arg2 arg2) { \
|
||||
Isolate* isolate = this->isolate(); \
|
||||
VMState<EXTERNAL> state(isolate); \
|
||||
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
|
||||
PropertyCallbackInfo<ReturnValue> info(begin()); \
|
||||
f(arg1, arg2, info); \
|
||||
return GetReturnValue<ReturnValue>(isolate); \
|
||||
}
|
||||
#define WRITE_CALL_2(Function, ReturnValue, Arg1, Arg2) \
|
||||
v8::Local<ReturnValue> PropertyCallbackArguments::Call( \
|
||||
Function f, Arg1 arg1, Arg2 arg2) { \
|
||||
Isolate* isolate = this->isolate(); \
|
||||
VMState<EXTERNAL> state(isolate); \
|
||||
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
|
||||
PropertyCallbackInfo<ReturnValue> info(begin()); \
|
||||
f(arg1, arg2, info); \
|
||||
return GetReturnValue<ReturnValue>(isolate); \
|
||||
}
|
||||
|
||||
|
||||
#define WRITE_CALL_2_VOID(Function, ReturnValue, Arg1, Arg2) \
|
||||
|
@ -128,8 +128,8 @@ class CustomArguments : public CustomArgumentsBase<T::kArgsLength> {
|
||||
protected:
|
||||
explicit inline CustomArguments(Isolate* isolate) : Super(isolate) {}
|
||||
|
||||
template<typename V>
|
||||
v8::Handle<V> GetReturnValue(Isolate* isolate);
|
||||
template <typename V>
|
||||
v8::Local<V> GetReturnValue(Isolate* isolate);
|
||||
|
||||
inline Isolate* isolate() {
|
||||
return reinterpret_cast<Isolate*>(this->begin()[T::kIsolateIndex]);
|
||||
@ -177,14 +177,14 @@ class PropertyCallbackArguments
|
||||
* and used if it's been set to anything inside the callback.
|
||||
* New style callbacks always use the return value.
|
||||
*/
|
||||
#define WRITE_CALL_0(Function, ReturnValue) \
|
||||
v8::Handle<ReturnValue> Call(Function f); \
|
||||
#define WRITE_CALL_0(Function, ReturnValue) \
|
||||
v8::Local<ReturnValue> Call(Function f);
|
||||
|
||||
#define WRITE_CALL_1(Function, ReturnValue, Arg1) \
|
||||
v8::Handle<ReturnValue> Call(Function f, Arg1 arg1); \
|
||||
#define WRITE_CALL_1(Function, ReturnValue, Arg1) \
|
||||
v8::Local<ReturnValue> Call(Function f, Arg1 arg1);
|
||||
|
||||
#define WRITE_CALL_2(Function, ReturnValue, Arg1, Arg2) \
|
||||
v8::Handle<ReturnValue> Call(Function f, Arg1 arg1, Arg2 arg2); \
|
||||
#define WRITE_CALL_2(Function, ReturnValue, Arg1, Arg2) \
|
||||
v8::Local<ReturnValue> Call(Function f, Arg1 arg1, Arg2 arg2);
|
||||
|
||||
#define WRITE_CALL_2_VOID(Function, ReturnValue, Arg1, Arg2) \
|
||||
void Call(Function f, Arg1 arg1, Arg2 arg2); \
|
||||
@ -250,7 +250,7 @@ class FunctionCallbackArguments
|
||||
* and used if it's been set to anything inside the callback.
|
||||
* New style callbacks always use the return value.
|
||||
*/
|
||||
v8::Handle<v8::Value> Call(FunctionCallback f);
|
||||
v8::Local<v8::Value> Call(FunctionCallback f);
|
||||
|
||||
private:
|
||||
internal::Object** argv_;
|
||||
|
@ -148,9 +148,8 @@ void Bootstrapper::TearDown() {
|
||||
|
||||
class Genesis BASE_EMBEDDED {
|
||||
public:
|
||||
Genesis(Isolate* isolate,
|
||||
MaybeHandle<JSGlobalProxy> maybe_global_proxy,
|
||||
v8::Handle<v8::ObjectTemplate> global_proxy_template,
|
||||
Genesis(Isolate* isolate, MaybeHandle<JSGlobalProxy> maybe_global_proxy,
|
||||
v8::Local<v8::ObjectTemplate> global_proxy_template,
|
||||
v8::ExtensionConfiguration* extensions);
|
||||
~Genesis() { }
|
||||
|
||||
@ -185,7 +184,7 @@ class Genesis BASE_EMBEDDED {
|
||||
// we have to used the deserialized ones that are linked together with the
|
||||
// rest of the context snapshot.
|
||||
Handle<GlobalObject> CreateNewGlobals(
|
||||
v8::Handle<v8::ObjectTemplate> global_proxy_template,
|
||||
v8::Local<v8::ObjectTemplate> global_proxy_template,
|
||||
Handle<JSGlobalProxy> global_proxy);
|
||||
// Hooks the given global proxy into the context. If the context was created
|
||||
// by deserialization then this will unhook the global proxy that was
|
||||
@ -274,7 +273,7 @@ class Genesis BASE_EMBEDDED {
|
||||
bool ConfigureApiObject(Handle<JSObject> object,
|
||||
Handle<ObjectTemplateInfo> object_template);
|
||||
bool ConfigureGlobalObjects(
|
||||
v8::Handle<v8::ObjectTemplate> global_proxy_template);
|
||||
v8::Local<v8::ObjectTemplate> global_proxy_template);
|
||||
|
||||
// Migrates all properties from the 'from' object to the 'to'
|
||||
// object and overrides the prototype in 'to' with the one from
|
||||
@ -350,7 +349,7 @@ void Bootstrapper::Iterate(ObjectVisitor* v) {
|
||||
|
||||
Handle<Context> Bootstrapper::CreateEnvironment(
|
||||
MaybeHandle<JSGlobalProxy> maybe_global_proxy,
|
||||
v8::Handle<v8::ObjectTemplate> global_proxy_template,
|
||||
v8::Local<v8::ObjectTemplate> global_proxy_template,
|
||||
v8::ExtensionConfiguration* extensions) {
|
||||
HandleScope scope(isolate_);
|
||||
Genesis genesis(
|
||||
@ -855,7 +854,7 @@ void Genesis::HookUpGlobalThisBinding(Handle<FixedArray> outdated_contexts) {
|
||||
|
||||
|
||||
Handle<GlobalObject> Genesis::CreateNewGlobals(
|
||||
v8::Handle<v8::ObjectTemplate> global_proxy_template,
|
||||
v8::Local<v8::ObjectTemplate> global_proxy_template,
|
||||
Handle<JSGlobalProxy> global_proxy) {
|
||||
// The argument global_proxy_template aka data is an ObjectTemplateInfo.
|
||||
// It has a constructor pointer that points at global_constructor which is a
|
||||
@ -2858,7 +2857,7 @@ bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) {
|
||||
|
||||
|
||||
bool Genesis::ConfigureGlobalObjects(
|
||||
v8::Handle<v8::ObjectTemplate> global_proxy_template) {
|
||||
v8::Local<v8::ObjectTemplate> global_proxy_template) {
|
||||
Handle<JSObject> global_proxy(
|
||||
JSObject::cast(native_context()->global_proxy()));
|
||||
Handle<JSObject> global_object(
|
||||
@ -3079,10 +3078,9 @@ class NoTrackDoubleFieldsForSerializerScope {
|
||||
|
||||
Genesis::Genesis(Isolate* isolate,
|
||||
MaybeHandle<JSGlobalProxy> maybe_global_proxy,
|
||||
v8::Handle<v8::ObjectTemplate> global_proxy_template,
|
||||
v8::Local<v8::ObjectTemplate> global_proxy_template,
|
||||
v8::ExtensionConfiguration* extensions)
|
||||
: isolate_(isolate),
|
||||
active_(isolate->bootstrapper()) {
|
||||
: isolate_(isolate), active_(isolate->bootstrapper()) {
|
||||
NoTrackDoubleFieldsForSerializerScope disable_scope(isolate);
|
||||
result_ = Handle<Context>::null();
|
||||
// Before creating the roots we must save the context and restore it
|
||||
|
@ -77,7 +77,7 @@ class Bootstrapper final {
|
||||
// The returned value is a global handle casted to V8Environment*.
|
||||
Handle<Context> CreateEnvironment(
|
||||
MaybeHandle<JSGlobalProxy> maybe_global_proxy,
|
||||
v8::Handle<v8::ObjectTemplate> global_object_template,
|
||||
v8::Local<v8::ObjectTemplate> global_object_template,
|
||||
v8::ExtensionConfiguration* extensions);
|
||||
|
||||
// Detach the environment from its outer global object.
|
||||
|
@ -1089,7 +1089,7 @@ MUST_USE_RESULT static MaybeHandle<Object> HandleApiCallHelper(
|
||||
args.length() - 1,
|
||||
is_construct);
|
||||
|
||||
v8::Handle<v8::Value> value = custom.Call(callback);
|
||||
v8::Local<v8::Value> value = custom.Call(callback);
|
||||
Handle<Object> result;
|
||||
if (value.IsEmpty()) {
|
||||
result = isolate->factory()->undefined_value();
|
||||
@ -1226,7 +1226,7 @@ MUST_USE_RESULT static Object* HandleApiCallAsFunctionOrConstructor(
|
||||
&args[0] - 1,
|
||||
args.length() - 1,
|
||||
is_construct_call);
|
||||
v8::Handle<v8::Value> value = custom.Call(callback);
|
||||
v8::Local<v8::Value> value = custom.Call(callback);
|
||||
if (value.IsEmpty()) {
|
||||
result = heap->undefined_value();
|
||||
} else {
|
||||
|
@ -468,7 +468,7 @@ namespace {
|
||||
Handle<JSFunction> GetFunction(Isolate* isolate, const char* name) {
|
||||
v8::ExtensionConfiguration no_extensions;
|
||||
Handle<Context> ctx = isolate->bootstrapper()->CreateEnvironment(
|
||||
MaybeHandle<JSGlobalProxy>(), v8::Handle<v8::ObjectTemplate>(),
|
||||
MaybeHandle<JSGlobalProxy>(), v8::Local<v8::ObjectTemplate>(),
|
||||
&no_extensions);
|
||||
Handle<JSBuiltinsObject> builtins = handle(ctx->builtins());
|
||||
MaybeHandle<Object> fun = Object::GetProperty(isolate, builtins, name);
|
||||
|
32
src/debug.cc
32
src/debug.cc
@ -48,7 +48,7 @@ Debug::Debug(Isolate* isolate)
|
||||
}
|
||||
|
||||
|
||||
static v8::Handle<v8::Context> GetDebugEventContext(Isolate* isolate) {
|
||||
static v8::Local<v8::Context> GetDebugEventContext(Isolate* isolate) {
|
||||
Handle<Context> context = isolate->debug()->debugger_entry()->GetContext();
|
||||
// Isolate::context() may have been NULL when "script collected" event
|
||||
// occured.
|
||||
@ -684,11 +684,9 @@ bool Debug::Load() {
|
||||
// Create the debugger context.
|
||||
HandleScope scope(isolate_);
|
||||
ExtensionConfiguration no_extensions;
|
||||
Handle<Context> context =
|
||||
isolate_->bootstrapper()->CreateEnvironment(
|
||||
MaybeHandle<JSGlobalProxy>(),
|
||||
v8::Handle<ObjectTemplate>(),
|
||||
&no_extensions);
|
||||
Handle<Context> context = isolate_->bootstrapper()->CreateEnvironment(
|
||||
MaybeHandle<JSGlobalProxy>(), v8::Local<ObjectTemplate>(),
|
||||
&no_extensions);
|
||||
|
||||
// Fail if no context could be created.
|
||||
if (context.is_null()) return false;
|
||||
@ -3201,7 +3199,7 @@ bool MessageImpl::WillStartRunning() const {
|
||||
}
|
||||
|
||||
|
||||
v8::Handle<v8::Object> MessageImpl::GetExecutionState() const {
|
||||
v8::Local<v8::Object> MessageImpl::GetExecutionState() const {
|
||||
return v8::Utils::ToLocal(exec_state_);
|
||||
}
|
||||
|
||||
@ -3211,12 +3209,12 @@ v8::Isolate* MessageImpl::GetIsolate() const {
|
||||
}
|
||||
|
||||
|
||||
v8::Handle<v8::Object> MessageImpl::GetEventData() const {
|
||||
v8::Local<v8::Object> MessageImpl::GetEventData() const {
|
||||
return v8::Utils::ToLocal(event_data_);
|
||||
}
|
||||
|
||||
|
||||
v8::Handle<v8::String> MessageImpl::GetJSON() const {
|
||||
v8::Local<v8::String> MessageImpl::GetJSON() const {
|
||||
Isolate* isolate = event_data_->GetIsolate();
|
||||
v8::EscapableHandleScope scope(reinterpret_cast<v8::Isolate*>(isolate));
|
||||
|
||||
@ -3225,14 +3223,14 @@ v8::Handle<v8::String> MessageImpl::GetJSON() const {
|
||||
Handle<Object> fun = Object::GetProperty(
|
||||
isolate, event_data_, "toJSONProtocol").ToHandleChecked();
|
||||
if (!fun->IsJSFunction()) {
|
||||
return v8::Handle<v8::String>();
|
||||
return v8::Local<v8::String>();
|
||||
}
|
||||
|
||||
MaybeHandle<Object> maybe_json =
|
||||
Execution::TryCall(Handle<JSFunction>::cast(fun), event_data_, 0, NULL);
|
||||
Handle<Object> json;
|
||||
if (!maybe_json.ToHandle(&json) || !json->IsString()) {
|
||||
return v8::Handle<v8::String>();
|
||||
return v8::Local<v8::String>();
|
||||
}
|
||||
return scope.Escape(v8::Utils::ToLocal(Handle<String>::cast(json)));
|
||||
} else {
|
||||
@ -3241,9 +3239,9 @@ v8::Handle<v8::String> MessageImpl::GetJSON() const {
|
||||
}
|
||||
|
||||
|
||||
v8::Handle<v8::Context> MessageImpl::GetEventContext() const {
|
||||
v8::Local<v8::Context> MessageImpl::GetEventContext() const {
|
||||
Isolate* isolate = event_data_->GetIsolate();
|
||||
v8::Handle<v8::Context> context = GetDebugEventContext(isolate);
|
||||
v8::Local<v8::Context> context = GetDebugEventContext(isolate);
|
||||
// Isolate::context() may be NULL when "script collected" event occurs.
|
||||
DCHECK(!context.IsEmpty());
|
||||
return context;
|
||||
@ -3272,22 +3270,22 @@ DebugEvent EventDetailsImpl::GetEvent() const {
|
||||
}
|
||||
|
||||
|
||||
v8::Handle<v8::Object> EventDetailsImpl::GetExecutionState() const {
|
||||
v8::Local<v8::Object> EventDetailsImpl::GetExecutionState() const {
|
||||
return v8::Utils::ToLocal(exec_state_);
|
||||
}
|
||||
|
||||
|
||||
v8::Handle<v8::Object> EventDetailsImpl::GetEventData() const {
|
||||
v8::Local<v8::Object> EventDetailsImpl::GetEventData() const {
|
||||
return v8::Utils::ToLocal(event_data_);
|
||||
}
|
||||
|
||||
|
||||
v8::Handle<v8::Context> EventDetailsImpl::GetEventContext() const {
|
||||
v8::Local<v8::Context> EventDetailsImpl::GetEventContext() const {
|
||||
return GetDebugEventContext(exec_state_->GetIsolate());
|
||||
}
|
||||
|
||||
|
||||
v8::Handle<v8::Value> EventDetailsImpl::GetCallbackData() const {
|
||||
v8::Local<v8::Value> EventDetailsImpl::GetCallbackData() const {
|
||||
return v8::Utils::ToLocal(callback_data_);
|
||||
}
|
||||
|
||||
|
16
src/debug.h
16
src/debug.h
@ -285,10 +285,10 @@ class MessageImpl: public v8::Debug::Message {
|
||||
virtual bool IsResponse() const;
|
||||
virtual DebugEvent GetEvent() const;
|
||||
virtual bool WillStartRunning() const;
|
||||
virtual v8::Handle<v8::Object> GetExecutionState() const;
|
||||
virtual v8::Handle<v8::Object> GetEventData() const;
|
||||
virtual v8::Handle<v8::String> GetJSON() const;
|
||||
virtual v8::Handle<v8::Context> GetEventContext() const;
|
||||
virtual v8::Local<v8::Object> GetExecutionState() const;
|
||||
virtual v8::Local<v8::Object> GetEventData() const;
|
||||
virtual v8::Local<v8::String> GetJSON() const;
|
||||
virtual v8::Local<v8::Context> GetEventContext() const;
|
||||
virtual v8::Debug::ClientData* GetClientData() const;
|
||||
virtual v8::Isolate* GetIsolate() const;
|
||||
|
||||
@ -320,10 +320,10 @@ class EventDetailsImpl : public v8::Debug::EventDetails {
|
||||
Handle<Object> callback_data,
|
||||
v8::Debug::ClientData* client_data);
|
||||
virtual DebugEvent GetEvent() const;
|
||||
virtual v8::Handle<v8::Object> GetExecutionState() const;
|
||||
virtual v8::Handle<v8::Object> GetEventData() const;
|
||||
virtual v8::Handle<v8::Context> GetEventContext() const;
|
||||
virtual v8::Handle<v8::Value> GetCallbackData() const;
|
||||
virtual v8::Local<v8::Object> GetExecutionState() const;
|
||||
virtual v8::Local<v8::Object> GetEventData() const;
|
||||
virtual v8::Local<v8::Context> GetEventContext() const;
|
||||
virtual v8::Local<v8::Value> GetCallbackData() const;
|
||||
virtual v8::Debug::ClientData* GetClientData() const;
|
||||
private:
|
||||
DebugEvent event_; // Debug event causing the break.
|
||||
|
@ -37,9 +37,9 @@ const char* const ExternalizeStringExtension::kSource =
|
||||
"native function externalizeString();"
|
||||
"native function isOneByteString();";
|
||||
|
||||
v8::Handle<v8::FunctionTemplate>
|
||||
v8::Local<v8::FunctionTemplate>
|
||||
ExternalizeStringExtension::GetNativeFunctionTemplate(
|
||||
v8::Isolate* isolate, v8::Handle<v8::String> str) {
|
||||
v8::Isolate* isolate, v8::Local<v8::String> str) {
|
||||
if (strcmp(*v8::String::Utf8Value(str), "externalizeString") == 0) {
|
||||
return v8::FunctionTemplate::New(isolate,
|
||||
ExternalizeStringExtension::Externalize);
|
||||
|
@ -13,9 +13,8 @@ namespace internal {
|
||||
class ExternalizeStringExtension : public v8::Extension {
|
||||
public:
|
||||
ExternalizeStringExtension() : v8::Extension("v8/externalize", kSource) {}
|
||||
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
|
||||
v8::Isolate* isolate,
|
||||
v8::Handle<v8::String> name);
|
||||
virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
|
||||
v8::Isolate* isolate, v8::Local<v8::String> name);
|
||||
static void Externalize(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
static void IsOneByte(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
|
||||
|
@ -11,16 +11,15 @@ namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
|
||||
v8::Handle<v8::FunctionTemplate> FreeBufferExtension::GetNativeFunctionTemplate(
|
||||
v8::Isolate* isolate,
|
||||
v8::Handle<v8::String> str) {
|
||||
v8::Local<v8::FunctionTemplate> FreeBufferExtension::GetNativeFunctionTemplate(
|
||||
v8::Isolate* isolate, v8::Local<v8::String> str) {
|
||||
return v8::FunctionTemplate::New(isolate, FreeBufferExtension::FreeBuffer);
|
||||
}
|
||||
|
||||
|
||||
void FreeBufferExtension::FreeBuffer(
|
||||
const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||
v8::Handle<v8::ArrayBuffer> arrayBuffer = args[0].As<v8::ArrayBuffer>();
|
||||
v8::Local<v8::ArrayBuffer> arrayBuffer = args[0].As<v8::ArrayBuffer>();
|
||||
v8::ArrayBuffer::Contents contents = arrayBuffer->Externalize();
|
||||
Isolate* isolate = reinterpret_cast<Isolate*>(args.GetIsolate());
|
||||
isolate->array_buffer_allocator()->Free(contents.Data(),
|
||||
|
@ -14,9 +14,8 @@ class FreeBufferExtension : public v8::Extension {
|
||||
public:
|
||||
FreeBufferExtension()
|
||||
: v8::Extension("v8/free-buffer", "native function freeBuffer();") {}
|
||||
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
|
||||
v8::Isolate* isolate,
|
||||
v8::Handle<v8::String> name);
|
||||
virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
|
||||
v8::Isolate* isolate, v8::Local<v8::String> name);
|
||||
static void FreeBuffer(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
};
|
||||
|
||||
|
@ -10,9 +10,8 @@ namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
|
||||
v8::Handle<v8::FunctionTemplate> GCExtension::GetNativeFunctionTemplate(
|
||||
v8::Isolate* isolate,
|
||||
v8::Handle<v8::String> str) {
|
||||
v8::Local<v8::FunctionTemplate> GCExtension::GetNativeFunctionTemplate(
|
||||
v8::Isolate* isolate, v8::Local<v8::String> str) {
|
||||
return v8::FunctionTemplate::New(isolate, GCExtension::GC);
|
||||
}
|
||||
|
||||
|
@ -15,9 +15,8 @@ class GCExtension : public v8::Extension {
|
||||
explicit GCExtension(const char* fun_name)
|
||||
: v8::Extension("v8/gc",
|
||||
BuildSource(buffer_, sizeof(buffer_), fun_name)) {}
|
||||
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
|
||||
v8::Isolate* isolate,
|
||||
v8::Handle<v8::String> name);
|
||||
virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
|
||||
v8::Isolate* isolate, v8::Local<v8::String> name);
|
||||
static void GC(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
|
||||
private:
|
||||
|
@ -11,9 +11,8 @@ const char* const StatisticsExtension::kSource =
|
||||
"native function getV8Statistics();";
|
||||
|
||||
|
||||
v8::Handle<v8::FunctionTemplate> StatisticsExtension::GetNativeFunctionTemplate(
|
||||
v8::Isolate* isolate,
|
||||
v8::Handle<v8::String> str) {
|
||||
v8::Local<v8::FunctionTemplate> StatisticsExtension::GetNativeFunctionTemplate(
|
||||
v8::Isolate* isolate, v8::Local<v8::String> str) {
|
||||
DCHECK(strcmp(*v8::String::Utf8Value(str), "getV8Statistics") == 0);
|
||||
return v8::FunctionTemplate::New(isolate, StatisticsExtension::GetCounters);
|
||||
}
|
||||
|
@ -13,9 +13,8 @@ namespace internal {
|
||||
class StatisticsExtension : public v8::Extension {
|
||||
public:
|
||||
StatisticsExtension() : v8::Extension("v8/statistics", kSource) {}
|
||||
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
|
||||
v8::Isolate* isolate,
|
||||
v8::Handle<v8::String> name);
|
||||
virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
|
||||
v8::Isolate* isolate, v8::Local<v8::String> name);
|
||||
static void GetCounters(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
|
||||
private:
|
||||
|
@ -15,10 +15,9 @@ const char* const TriggerFailureExtension::kSource =
|
||||
"native function triggerSlowAssertFalse();";
|
||||
|
||||
|
||||
v8::Handle<v8::FunctionTemplate>
|
||||
TriggerFailureExtension::GetNativeFunctionTemplate(
|
||||
v8::Isolate* isolate,
|
||||
v8::Handle<v8::String> str) {
|
||||
v8::Local<v8::FunctionTemplate>
|
||||
TriggerFailureExtension::GetNativeFunctionTemplate(v8::Isolate* isolate,
|
||||
v8::Local<v8::String> str) {
|
||||
if (strcmp(*v8::String::Utf8Value(str), "triggerCheckFalse") == 0) {
|
||||
return v8::FunctionTemplate::New(
|
||||
isolate,
|
||||
|
@ -13,9 +13,8 @@ namespace internal {
|
||||
class TriggerFailureExtension : public v8::Extension {
|
||||
public:
|
||||
TriggerFailureExtension() : v8::Extension("v8/trigger-failure", kSource) {}
|
||||
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
|
||||
v8::Isolate* isolate,
|
||||
v8::Handle<v8::String> name);
|
||||
virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
|
||||
v8::Isolate* isolate, v8::Local<v8::String> name);
|
||||
static void TriggerCheckFalse(
|
||||
const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
static void TriggerAssertFalse(
|
||||
|
@ -1456,7 +1456,7 @@ void FullCodeGenerator::VisitNativeFunctionLiteral(
|
||||
|
||||
// Compute the function template for the native function.
|
||||
Handle<String> name = expr->name();
|
||||
v8::Handle<v8::FunctionTemplate> fun_template =
|
||||
v8::Local<v8::FunctionTemplate> fun_template =
|
||||
expr->extension()->GetNativeFunctionTemplate(v8_isolate,
|
||||
v8::Utils::ToLocal(name));
|
||||
DCHECK(!fun_template.IsEmpty());
|
||||
|
@ -738,7 +738,7 @@ icu::SimpleDateFormat* DateFormat::UnpackDateFormat(
|
||||
template<class T>
|
||||
void DeleteNativeObjectAt(const v8::WeakCallbackData<v8::Value, void>& data,
|
||||
int index) {
|
||||
v8::Local<v8::Object> obj = v8::Handle<v8::Object>::Cast(data.GetValue());
|
||||
v8::Local<v8::Object> obj = v8::Local<v8::Object>::Cast(data.GetValue());
|
||||
delete reinterpret_cast<T*>(obj->GetAlignedPointerFromInternalField(index));
|
||||
}
|
||||
|
||||
|
@ -334,8 +334,7 @@ MaybeHandle<Object> Object::GetPropertyWithAccessor(
|
||||
|
||||
LOG(isolate, ApiNamedPropertyAccess("load", *holder, *name));
|
||||
PropertyCallbackArguments args(isolate, info->data(), *receiver, *holder);
|
||||
v8::Handle<v8::Value> result =
|
||||
args.Call(call_fun, v8::Utils::ToLocal(name));
|
||||
v8::Local<v8::Value> result = args.Call(call_fun, v8::Utils::ToLocal(name));
|
||||
RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
|
||||
if (result.IsEmpty()) {
|
||||
return ReadAbsentProperty(isolate, receiver, name, language_mode);
|
||||
@ -2982,7 +2981,7 @@ MaybeHandle<Object> JSObject::SetPropertyWithInterceptor(LookupIterator* it,
|
||||
if (interceptor->setter()->IsUndefined()) return MaybeHandle<Object>();
|
||||
|
||||
Handle<JSObject> holder = it->GetHolder<JSObject>();
|
||||
v8::Handle<v8::Value> result;
|
||||
v8::Local<v8::Value> result;
|
||||
PropertyCallbackArguments args(isolate, interceptor->data(),
|
||||
*it->GetReceiver(), *holder);
|
||||
|
||||
@ -4347,7 +4346,7 @@ Maybe<PropertyAttributes> JSObject::GetPropertyAttributesWithInterceptor(
|
||||
PropertyCallbackArguments args(isolate, interceptor->data(),
|
||||
*it->GetReceiver(), *holder);
|
||||
if (!interceptor->query()->IsUndefined()) {
|
||||
v8::Handle<v8::Integer> result;
|
||||
v8::Local<v8::Integer> result;
|
||||
if (it->IsElement()) {
|
||||
uint32_t index = it->index();
|
||||
v8::IndexedPropertyQueryCallback query =
|
||||
@ -4372,7 +4371,7 @@ Maybe<PropertyAttributes> JSObject::GetPropertyAttributesWithInterceptor(
|
||||
}
|
||||
} else if (!interceptor->getter()->IsUndefined()) {
|
||||
// TODO(verwaest): Use GetPropertyWithInterceptor?
|
||||
v8::Handle<v8::Value> result;
|
||||
v8::Local<v8::Value> result;
|
||||
if (it->IsElement()) {
|
||||
uint32_t index = it->index();
|
||||
v8::IndexedPropertyGetterCallback getter =
|
||||
@ -5114,7 +5113,7 @@ MaybeHandle<Object> JSObject::DeletePropertyWithInterceptor(
|
||||
|
||||
PropertyCallbackArguments args(isolate, interceptor->data(),
|
||||
*it->GetReceiver(), *holder);
|
||||
v8::Handle<v8::Boolean> result;
|
||||
v8::Local<v8::Boolean> result;
|
||||
if (it->IsElement()) {
|
||||
uint32_t index = it->index();
|
||||
v8::IndexedPropertyDeleterCallback deleter =
|
||||
@ -12901,7 +12900,7 @@ MaybeHandle<Object> JSObject::GetPropertyWithInterceptor(LookupIterator* it,
|
||||
}
|
||||
|
||||
Handle<JSObject> holder = it->GetHolder<JSObject>();
|
||||
v8::Handle<v8::Value> result;
|
||||
v8::Local<v8::Value> result;
|
||||
PropertyCallbackArguments args(isolate, interceptor->data(),
|
||||
*it->GetReceiver(), *holder);
|
||||
|
||||
@ -12944,7 +12943,7 @@ MaybeHandle<JSObject> JSObject::GetKeysForNamedInterceptor(
|
||||
Handle<InterceptorInfo> interceptor(object->GetNamedInterceptor());
|
||||
PropertyCallbackArguments
|
||||
args(isolate, interceptor->data(), *receiver, *object);
|
||||
v8::Handle<v8::Object> result;
|
||||
v8::Local<v8::Object> result;
|
||||
if (!interceptor->enumerator()->IsUndefined()) {
|
||||
v8::GenericNamedPropertyEnumeratorCallback enum_fun =
|
||||
v8::ToCData<v8::GenericNamedPropertyEnumeratorCallback>(
|
||||
@ -12967,7 +12966,7 @@ MaybeHandle<JSObject> JSObject::GetKeysForIndexedInterceptor(
|
||||
Handle<InterceptorInfo> interceptor(object->GetIndexedInterceptor());
|
||||
PropertyCallbackArguments
|
||||
args(isolate, interceptor->data(), *receiver, *object);
|
||||
v8::Handle<v8::Object> result;
|
||||
v8::Local<v8::Object> result;
|
||||
if (!interceptor->enumerator()->IsUndefined()) {
|
||||
v8::IndexedPropertyEnumeratorCallback enum_fun =
|
||||
v8::ToCData<v8::IndexedPropertyEnumeratorCallback>(
|
||||
|
Loading…
Reference in New Issue
Block a user