static i::Handle<i::Object> CallV8HeapFunction(const char* name,
i::Handle<i::Object> recv,
int argc,
- i::Object** argv[],
+ i::Handle<i::Object> argv[],
bool* has_pending_exception) {
i::Isolate* isolate = i::Isolate::Current();
i::Handle<i::String> fmt_str = isolate->factory()->LookupAsciiSymbol(name);
static i::Handle<i::Object> CallV8HeapFunction(const char* name,
i::Handle<i::Object> data,
bool* has_pending_exception) {
- i::Object** argv[1] = { data.location() };
+ i::Handle<i::Object> argv[] = { data };
return CallV8HeapFunction(name,
i::Isolate::Current()->js_builtins_object(),
- 1,
+ ARRAY_SIZE(argv),
argv,
has_pending_exception);
}
if (obj->IsJSObject() && other->IsJSObject()) {
return *obj == *other;
}
- i::Object** args[1] = { other.location() };
+ i::Handle<i::Object> args[] = { other };
EXCEPTION_PREAMBLE(isolate);
i::Handle<i::Object> result =
- CallV8HeapFunction("EQUALS", obj, 1, args, &has_pending_exception);
+ CallV8HeapFunction("EQUALS", obj, ARRAY_SIZE(args), args,
+ &has_pending_exception);
EXCEPTION_BAILOUT_CHECK(isolate, false);
return *result == i::Smi::FromInt(i::EQUAL);
}
}
-Local<v8::Value> Object::CallAsFunction(v8::Handle<v8::Object> recv, int argc,
+Local<v8::Value> Object::CallAsFunction(v8::Handle<v8::Object> recv,
+ int argc,
v8::Handle<v8::Value> argv[]) {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
ON_BAILOUT(isolate, "v8::Object::CallAsFunction()",
i::Handle<i::JSObject> obj = Utils::OpenHandle(this);
i::Handle<i::Object> recv_obj = Utils::OpenHandle(*recv);
STATIC_ASSERT(sizeof(v8::Handle<v8::Value>) == sizeof(i::Object**));
- i::Object*** args = reinterpret_cast<i::Object***>(argv);
+ i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv);
i::Handle<i::JSFunction> fun = i::Handle<i::JSFunction>();
if (obj->IsJSFunction()) {
fun = i::Handle<i::JSFunction>::cast(obj);
i::HandleScope scope(isolate);
i::Handle<i::JSObject> obj = Utils::OpenHandle(this);
STATIC_ASSERT(sizeof(v8::Handle<v8::Value>) == sizeof(i::Object**));
- i::Object*** args = reinterpret_cast<i::Object***>(argv);
+ i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv);
if (obj->IsJSFunction()) {
i::Handle<i::JSFunction> fun = i::Handle<i::JSFunction>::cast(obj);
EXCEPTION_PREAMBLE(isolate);
HandleScope scope;
i::Handle<i::JSFunction> function = Utils::OpenHandle(this);
STATIC_ASSERT(sizeof(v8::Handle<v8::Value>) == sizeof(i::Object**));
- i::Object*** args = reinterpret_cast<i::Object***>(argv);
+ i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv);
EXCEPTION_PREAMBLE(isolate);
i::Handle<i::Object> returned =
i::Execution::New(function, argc, args, &has_pending_exception);
i::Handle<i::JSFunction> fun = Utils::OpenHandle(this);
i::Handle<i::Object> recv_obj = Utils::OpenHandle(*recv);
STATIC_ASSERT(sizeof(v8::Handle<v8::Value>) == sizeof(i::Object**));
- i::Object*** args = reinterpret_cast<i::Object***>(argv);
+ i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv);
EXCEPTION_PREAMBLE(isolate);
i::Handle<i::Object> returned =
i::Execution::Call(fun, recv_obj, argc, args, &has_pending_exception);
HandleScope handleScope(isolate);
Handle<Object> js_builtin =
- GetProperty(Handle<JSObject>(
- isolate->global_context()->builtins()),
- name);
- ASSERT(js_builtin->IsJSFunction());
- Handle<JSFunction> function(Handle<JSFunction>::cast(js_builtin));
- ScopedVector<Object**> argv(args.length() - 1);
- int n_args = args.length() - 1;
- for (int i = 0; i < n_args; i++) {
- argv[i] = args.at<Object>(i + 1).location();
+ GetProperty(Handle<JSObject>(isolate->global_context()->builtins()),
+ name);
+ Handle<JSFunction> function = Handle<JSFunction>::cast(js_builtin);
+ int argc = args.length() - 1;
+ ScopedVector<Handle<Object> > argv(argc);
+ for (int i = 0; i < argc; ++i) {
+ argv[i] = args.at<Object>(i + 1);
}
bool pending_exception;
Handle<Object> result = Execution::Call(function,
args.receiver(),
- n_args,
+ argc,
argv.start(),
&pending_exception);
if (pending_exception) return Failure::Exception();
// Call HandleBreakPointx.
bool caught_exception;
- const int argc = 2;
- Object** argv[argc] = {
- break_id.location(),
- reinterpret_cast<Object**>(break_point_object.location())
- };
+ Handle<Object> argv[] = { break_id, break_point_object };
Handle<Object> result = Execution::TryCall(check_break_point,
- isolate_->js_builtins_object(), argc, argv, &caught_exception);
+ isolate_->js_builtins_object(),
+ ARRAY_SIZE(argv),
+ argv,
+ &caught_exception);
// If exception or non boolean result handle as not triggered
if (caught_exception || !result->IsBoolean()) {
Handle<Object> Debugger::MakeJSObject(Vector<const char> constructor_name,
- int argc, Object*** argv,
+ int argc,
+ Handle<Object> argv[],
bool* caught_exception) {
ASSERT(isolate_->context() == *isolate_->debug()->debug_context());
Handle<Object> js_object = Execution::TryCall(
Handle<JSFunction>::cast(constructor),
Handle<JSObject>(isolate_->debug()->debug_context()->global()),
- argc, argv, caught_exception);
+ argc,
+ argv,
+ caught_exception);
return js_object;
}
// Create the execution state object.
Handle<Object> break_id = isolate_->factory()->NewNumberFromInt(
isolate_->debug()->break_id());
- const int argc = 1;
- Object** argv[argc] = { break_id.location() };
+ Handle<Object> argv[] = { break_id };
return MakeJSObject(CStrVector("MakeExecutionState"),
- argc, argv, caught_exception);
+ ARRAY_SIZE(argv),
+ argv,
+ caught_exception);
}
Handle<Object> break_points_hit,
bool* caught_exception) {
// Create the new break event object.
- const int argc = 2;
- Object** argv[argc] = { exec_state.location(),
- break_points_hit.location() };
+ Handle<Object> argv[] = { exec_state, break_points_hit };
return MakeJSObject(CStrVector("MakeBreakEvent"),
- argc,
+ ARRAY_SIZE(argv),
argv,
caught_exception);
}
bool* caught_exception) {
Factory* factory = isolate_->factory();
// Create the new exception event object.
- const int argc = 3;
- Object** argv[argc] = { exec_state.location(),
- exception.location(),
- uncaught ? factory->true_value().location() :
- factory->false_value().location()};
+ Handle<Object> argv[] = { exec_state,
+ exception,
+ uncaught ? factory->true_value()
+ : factory->false_value() };
return MakeJSObject(CStrVector("MakeExceptionEvent"),
- argc, argv, caught_exception);
+ ARRAY_SIZE(argv),
+ argv,
+ caught_exception);
}
Handle<Object> Debugger::MakeNewFunctionEvent(Handle<Object> function,
bool* caught_exception) {
// Create the new function event object.
- const int argc = 1;
- Object** argv[argc] = { function.location() };
+ Handle<Object> argv[] = { function };
return MakeJSObject(CStrVector("MakeNewFunctionEvent"),
- argc, argv, caught_exception);
+ ARRAY_SIZE(argv),
+ argv,
+ caught_exception);
}
// Create the compile event object.
Handle<Object> exec_state = MakeExecutionState(caught_exception);
Handle<Object> script_wrapper = GetScriptWrapper(script);
- const int argc = 3;
- Object** argv[argc] = { exec_state.location(),
- script_wrapper.location(),
- before ? factory->true_value().location() :
- factory->false_value().location() };
+ Handle<Object> argv[] = { exec_state,
+ script_wrapper,
+ before ? factory->true_value()
+ : factory->false_value() };
return MakeJSObject(CStrVector("MakeCompileEvent"),
- argc,
+ ARRAY_SIZE(argv),
argv,
caught_exception);
}
// Create the script collected event object.
Handle<Object> exec_state = MakeExecutionState(caught_exception);
Handle<Object> id_object = Handle<Smi>(Smi::FromInt(id));
- const int argc = 2;
- Object** argv[argc] = { exec_state.location(), id_object.location() };
+ Handle<Object> argv[] = { exec_state, id_object };
return MakeJSObject(CStrVector("MakeScriptCollectedEvent"),
- argc,
+ ARRAY_SIZE(argv),
argv,
caught_exception);
}
// Call UpdateScriptBreakPoints expect no exceptions.
bool caught_exception;
- const int argc = 1;
- Object** argv[argc] = { reinterpret_cast<Object**>(wrapper.location()) };
+ Handle<Object> argv[] = { wrapper };
Execution::TryCall(Handle<JSFunction>::cast(update_script_break_points),
- Isolate::Current()->js_builtins_object(), argc, argv,
- &caught_exception);
+ Isolate::Current()->js_builtins_object(),
+ ARRAY_SIZE(argv),
+ argv,
+ &caught_exception);
if (caught_exception) {
return;
}
Handle<JSFunction> fun(Handle<JSFunction>::cast(event_listener_));
// Invoke the JavaScript debug event listener.
- const int argc = 4;
- Object** argv[argc] = { Handle<Object>(Smi::FromInt(event)).location(),
- exec_state.location(),
- Handle<Object>::cast(event_data).location(),
- event_listener_data_.location() };
+ Handle<Object> argv[] = { Handle<Object>(Smi::FromInt(event)),
+ exec_state,
+ event_data,
+ event_listener_data_ };
bool caught_exception;
- Execution::TryCall(fun, isolate_->global(), argc, argv, &caught_exception);
+ Execution::TryCall(fun,
+ isolate_->global(),
+ ARRAY_SIZE(argv),
+ argv,
+ &caught_exception);
// Silently ignore exceptions from debug event listeners.
}
return isolate_->factory()->undefined_value();
}
- static const int kArgc = 2;
- Object** argv[kArgc] = { exec_state.location(), data.location() };
+ Handle<Object> argv[] = { exec_state, data };
Handle<Object> result = Execution::Call(
fun,
Handle<Object>(isolate_->debug()->debug_context_->global_proxy()),
- kArgc,
+ ARRAY_SIZE(argv),
argv,
pending_exception);
return result;
void DebugRequest(const uint16_t* json_request, int length);
Handle<Object> MakeJSObject(Vector<const char> constructor_name,
- int argc, Object*** argv,
+ int argc,
+ Handle<Object> argv[],
bool* caught_exception);
Handle<Object> MakeExecutionState(bool* caught_exception);
Handle<Object> MakeBreakEvent(Handle<Object> exec_state,
}
-static Handle<Object> Invoke(bool construct,
- Handle<JSFunction> func,
+static Handle<Object> Invoke(bool is_construct,
+ Handle<JSFunction> function,
Handle<Object> receiver,
int argc,
- Object*** args,
+ Handle<Object> args[],
bool* has_pending_exception) {
- Isolate* isolate = func->GetIsolate();
+ Isolate* isolate = function->GetIsolate();
// Entering JavaScript.
VMState state(isolate, JS);
// Placeholder for return value.
MaybeObject* value = reinterpret_cast<Object*>(kZapValue);
- typedef Object* (*JSEntryFunction)(
- byte* entry,
- Object* function,
- Object* receiver,
- int argc,
- Object*** args);
+ typedef Object* (*JSEntryFunction)(byte* entry,
+ Object* function,
+ Object* receiver,
+ int argc,
+ Object*** args);
- Handle<Code> code;
- if (construct) {
- code = isolate->factory()->js_construct_entry_code();
- } else {
- code = isolate->factory()->js_entry_code();
- }
+ Handle<Code> code = is_construct
+ ? isolate->factory()->js_construct_entry_code()
+ : isolate->factory()->js_entry_code();
// Convert calls on global objects to be calls on the global
// receiver instead to avoid having a 'this' pointer which refers
// Make sure that the global object of the context we're about to
// make the current one is indeed a global object.
- ASSERT(func->context()->global()->IsGlobalObject());
+ ASSERT(function->context()->global()->IsGlobalObject());
{
// Save and restore context around invocation and block the
// allocation of handles without explicit handle scopes.
SaveContext save(isolate);
NoHandleAllocation na;
- JSEntryFunction entry = FUNCTION_CAST<JSEntryFunction>(code->entry());
+ JSEntryFunction stub_entry = FUNCTION_CAST<JSEntryFunction>(code->entry());
// Call the function through the right JS entry stub.
- byte* entry_address = func->code()->entry();
- JSFunction* function = *func;
- Object* receiver_pointer = *receiver;
- value = CALL_GENERATED_CODE(entry, entry_address, function,
- receiver_pointer, argc, args);
+ byte* function_entry = function->code()->entry();
+ JSFunction* func = *function;
+ Object* recv = *receiver;
+ Object*** argv = reinterpret_cast<Object***>(args);
+ value =
+ CALL_GENERATED_CODE(stub_entry, function_entry, func, recv, argc, argv);
}
#ifdef DEBUG
Handle<Object> Execution::Call(Handle<Object> callable,
Handle<Object> receiver,
int argc,
- Object*** args,
+ Handle<Object> argv[],
bool* pending_exception,
bool convert_receiver) {
*pending_exception = false;
if (*pending_exception) return callable;
}
- return Invoke(false, func, receiver, argc, args, pending_exception);
+ return Invoke(false, func, receiver, argc, argv, pending_exception);
}
-Handle<Object> Execution::New(Handle<JSFunction> func, int argc,
- Object*** args, bool* pending_exception) {
- return Invoke(true, func, Isolate::Current()->global(), argc, args,
+Handle<Object> Execution::New(Handle<JSFunction> func,
+ int argc,
+ Handle<Object> argv[],
+ bool* pending_exception) {
+ return Invoke(true, func, Isolate::Current()->global(), argc, argv,
pending_exception);
}
Handle<Object> Execution::TryCall(Handle<JSFunction> func,
Handle<Object> receiver,
int argc,
- Object*** args,
+ Handle<Object> args[],
bool* caught_exception) {
// Enter a try-block while executing the JavaScript code. To avoid
// duplicate error printing it must be non-verbose. Also, to avoid
// --- C a l l s t o n a t i v e s ---
-#define RETURN_NATIVE_CALL(name, argc, argv, has_pending_exception) \
- do { \
- Isolate* isolate = Isolate::Current(); \
- Object** args[argc] = argv; \
- ASSERT(has_pending_exception != NULL); \
- return Call(isolate->name##_fun(), \
- isolate->js_builtins_object(), argc, args, \
- has_pending_exception); \
+#define RETURN_NATIVE_CALL(name, args, has_pending_exception) \
+ do { \
+ Isolate* isolate = Isolate::Current(); \
+ Handle<Object> argv[] = args; \
+ ASSERT(has_pending_exception != NULL); \
+ return Call(isolate->name##_fun(), \
+ isolate->js_builtins_object(), \
+ ARRAY_SIZE(argv), argv, \
+ has_pending_exception); \
} while (false)
Handle<Object> Execution::ToNumber(Handle<Object> obj, bool* exc) {
- RETURN_NATIVE_CALL(to_number, 1, { obj.location() }, exc);
+ RETURN_NATIVE_CALL(to_number, { obj }, exc);
}
Handle<Object> Execution::ToString(Handle<Object> obj, bool* exc) {
- RETURN_NATIVE_CALL(to_string, 1, { obj.location() }, exc);
+ RETURN_NATIVE_CALL(to_string, { obj }, exc);
}
Handle<Object> Execution::ToDetailString(Handle<Object> obj, bool* exc) {
- RETURN_NATIVE_CALL(to_detail_string, 1, { obj.location() }, exc);
+ RETURN_NATIVE_CALL(to_detail_string, { obj }, exc);
}
Handle<Object> Execution::ToObject(Handle<Object> obj, bool* exc) {
if (obj->IsSpecObject()) return obj;
- RETURN_NATIVE_CALL(to_object, 1, { obj.location() }, exc);
+ RETURN_NATIVE_CALL(to_object, { obj }, exc);
}
Handle<Object> Execution::ToInteger(Handle<Object> obj, bool* exc) {
- RETURN_NATIVE_CALL(to_integer, 1, { obj.location() }, exc);
+ RETURN_NATIVE_CALL(to_integer, { obj }, exc);
}
Handle<Object> Execution::ToUint32(Handle<Object> obj, bool* exc) {
- RETURN_NATIVE_CALL(to_uint32, 1, { obj.location() }, exc);
+ RETURN_NATIVE_CALL(to_uint32, { obj }, exc);
}
Handle<Object> Execution::ToInt32(Handle<Object> obj, bool* exc) {
- RETURN_NATIVE_CALL(to_int32, 1, { obj.location() }, exc);
+ RETURN_NATIVE_CALL(to_int32, { obj }, exc);
}
Handle<Object> Execution::NewDate(double time, bool* exc) {
Handle<Object> time_obj = FACTORY->NewNumber(time);
- RETURN_NATIVE_CALL(create_date, 1, { time_obj.location() }, exc);
+ RETURN_NATIVE_CALL(create_date, { time_obj }, exc);
}
bool caught_exception;
Handle<Object> index_object = factory->NewNumberFromInt(int_index);
- Object** index_arg[] = { index_object.location() };
+ Handle<Object> index_arg[] = { index_object };
Handle<Object> result = TryCall(Handle<JSFunction>::cast(char_at),
string,
ARRAY_SIZE(index_arg),
Handle<JSFunction> Execution::InstantiateFunction(
- Handle<FunctionTemplateInfo> data, bool* exc) {
+ Handle<FunctionTemplateInfo> data,
+ bool* exc) {
Isolate* isolate = data->GetIsolate();
// Fast case: see if the function has already been instantiated
int serial_number = Smi::cast(data->serial_number())->value();
GetElementNoExceptionThrown(serial_number);
if (elm->IsJSFunction()) return Handle<JSFunction>(JSFunction::cast(elm));
// The function has not yet been instantiated in this context; do it.
- Object** args[1] = { Handle<Object>::cast(data).location() };
- Handle<Object> result =
- Call(isolate->instantiate_fun(),
- isolate->js_builtins_object(), 1, args, exc);
+ Handle<Object> args[] = { data };
+ Handle<Object> result = Call(isolate->instantiate_fun(),
+ isolate->js_builtins_object(),
+ ARRAY_SIZE(args),
+ args,
+ exc);
if (*exc) return Handle<JSFunction>::null();
return Handle<JSFunction>::cast(result);
}
ASSERT(!*exc);
return Handle<JSObject>(JSObject::cast(result));
} else {
- Object** args[1] = { Handle<Object>::cast(data).location() };
- Handle<Object> result =
- Call(isolate->instantiate_fun(),
- isolate->js_builtins_object(), 1, args, exc);
+ Handle<Object> args[] = { data };
+ Handle<Object> result = Call(isolate->instantiate_fun(),
+ isolate->js_builtins_object(),
+ ARRAY_SIZE(args),
+ args,
+ exc);
if (*exc) return Handle<JSObject>::null();
return Handle<JSObject>::cast(result);
}
Handle<Object> instance_template,
bool* exc) {
Isolate* isolate = Isolate::Current();
- Object** args[2] = { instance.location(), instance_template.location() };
+ Handle<Object> args[] = { instance, instance_template };
Execution::Call(isolate->configure_instance_fun(),
- isolate->js_builtins_object(), 2, args, exc);
+ isolate->js_builtins_object(),
+ ARRAY_SIZE(args),
+ args,
+ exc);
}
Handle<Object> pos,
Handle<Object> is_global) {
Isolate* isolate = fun->GetIsolate();
- const int argc = 4;
- Object** args[argc] = { recv.location(),
- Handle<Object>::cast(fun).location(),
- pos.location(),
- is_global.location() };
+ Handle<Object> args[] = { recv, fun, pos, is_global };
bool caught_exception;
- Handle<Object> result =
- TryCall(isolate->get_stack_trace_line_fun(),
- isolate->js_builtins_object(), argc, args,
- &caught_exception);
+ Handle<Object> result = TryCall(isolate->get_stack_trace_line_fun(),
+ isolate->js_builtins_object(),
+ ARRAY_SIZE(args),
+ args,
+ &caught_exception);
if (caught_exception || !result->IsString()) {
return isolate->factory()->empty_symbol();
}
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
static Handle<Object> Call(Handle<Object> callable,
Handle<Object> receiver,
int argc,
- Object*** args,
+ Handle<Object> argv[],
bool* pending_exception,
bool convert_receiver = false);
//
static Handle<Object> New(Handle<JSFunction> func,
int argc,
- Object*** args,
+ Handle<Object> argv[],
bool* pending_exception);
// Call a function, just like Call(), but make sure to silently catch
static Handle<Object> TryCall(Handle<JSFunction> func,
Handle<Object> receiver,
int argc,
- Object*** args,
+ Handle<Object> argv[],
bool* caught_exception);
// ECMA-262 9.2
return undefined_value();
Handle<JSFunction> fun = Handle<JSFunction>::cast(fun_obj);
Handle<Object> type_obj = LookupAsciiSymbol(type);
- Object** argv[2] = { type_obj.location(),
- Handle<Object>::cast(args).location() };
+ Handle<Object> argv[] = { type_obj, args };
// Invoke the JavaScript factory method. If an exception is thrown while
// running the factory method, use the exception as the result.
bool caught_exception;
Handle<Object> result = Execution::TryCall(fun,
- isolate()->js_builtins_object(), 2, argv, &caught_exception);
+ isolate()->js_builtins_object(),
+ ARRAY_SIZE(argv),
+ argv,
+ &caught_exception);
return result;
}
Handle<JSFunction> fun = Handle<JSFunction>(
JSFunction::cast(isolate()->js_builtins_object()->
GetPropertyNoExceptionThrown(*constr)));
- Object** argv[1] = { Handle<Object>::cast(message).location() };
+ Handle<Object> argv[] = { message };
// Invoke the JavaScript factory method. If an exception is thrown while
// running the factory method, use the exception as the result.
bool caught_exception;
Handle<Object> result = Execution::TryCall(fun,
- isolate()->js_builtins_object(), 1, argv, &caught_exception);
+ isolate()->js_builtins_object(),
+ ARRAY_SIZE(argv),
+ argv,
+ &caught_exception);
return result;
}
Handle<JSFunction> builtin_function(JSFunction::cast(builtin), isolate);
bool caught_exception;
- Object** builtin_args[] = { right.location() };
+ Handle<Object> builtin_args[] = { right };
Handle<Object> result = Execution::Call(builtin_function,
left,
ARRAY_SIZE(builtin_args),
Handle<String> flags,
bool* has_pending_exception) {
// Call the construct code with 2 arguments.
- Object** argv[2] = { Handle<Object>::cast(pattern).location(),
- Handle<Object>::cast(flags).location() };
- return Execution::New(constructor, 2, argv, has_pending_exception);
+ Handle<Object> argv[] = { pattern, flags };
+ return Execution::New(constructor, ARRAY_SIZE(argv), argv,
+ has_pending_exception);
}
-
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
JSFunction::cast(
Isolate::Current()->js_builtins_object()->
GetPropertyNoExceptionThrown(*fmt_str)));
- Object** argv[1] = { data.location() };
+ Handle<Object> argv[] = { data };
bool caught_exception;
Handle<Object> result =
Execution::TryCall(fun,
- Isolate::Current()->js_builtins_object(), 1, argv, &caught_exception);
+ Isolate::Current()->js_builtins_object(),
+ ARRAY_SIZE(argv),
+ argv,
+ &caught_exception);
if (caught_exception || !result->IsString()) {
return FACTORY->LookupAsciiSymbol("<error>");
}
#endif
bool has_pending_exception;
- Object** argv[] = { value_handle.location() };
- Execution::Call(fun, self, 1, argv, &has_pending_exception);
+ Handle<Object> argv[] = { value_handle };
+ Execution::Call(fun, self, ARRAY_SIZE(argv), argv, &has_pending_exception);
// Check for pending exception and return the result.
if (has_pending_exception) return Failure::Exception();
return *value_handle;
// Check whether it is virtualized as an accessor.
// Emulate [[GetProperty]] semantics for proxies.
bool has_pending_exception;
- Object** argv[] = { result.location() };
+ Handle<Object> argv[] = { result };
Handle<Object> desc =
Execution::Call(isolate->to_complete_property_descriptor(), result,
ARRAY_SIZE(argv), argv, &has_pending_exception);
if (result->IsUndefined()) return ABSENT;
bool has_pending_exception;
- Object** argv[] = { result.location() };
+ Handle<Object> argv[] = { result };
Handle<Object> desc =
Execution::Call(isolate->to_complete_property_descriptor(), result,
ARRAY_SIZE(argv), argv, &has_pending_exception);
}
-MUST_USE_RESULT Handle<Object> JSProxy::CallTrap(
- const char* name,
- Handle<Object> derived,
- int argc,
- Handle<Object> args[]) {
+MUST_USE_RESULT Handle<Object> JSProxy::CallTrap(const char* name,
+ Handle<Object> derived,
+ int argc,
+ Handle<Object> argv[]) {
Isolate* isolate = GetIsolate();
Handle<Object> handler(this->handler());
trap = Handle<Object>(derived);
}
- Object*** argv = reinterpret_cast<Object***>(args);
bool threw;
return Execution::Call(trap, handler, argc, argv, &threw);
}
}
-static SmartArrayPointer<Object**> GetNonBoundArguments(int bound_argc,
- int* total_argc) {
+static SmartArrayPointer<Handle<Object> > GetNonBoundArguments(
+ int bound_argc,
+ int* total_argc) {
// Find frame containing arguments passed to the caller.
JavaScriptFrameIterator it;
JavaScriptFrame* frame = it.frame();
&args_slots);
*total_argc = bound_argc + args_count;
- SmartArrayPointer<Object**> param_data(NewArray<Object**>(*total_argc));
+ SmartArrayPointer<Handle<Object> > param_data(
+ NewArray<Handle<Object> >(*total_argc));
for (int i = 0; i < args_count; i++) {
Handle<Object> val = args_slots[i].GetValue();
- param_data[bound_argc + i] = val.location();
+ param_data[bound_argc + i] = val;
}
return param_data;
} else {
int args_count = frame->ComputeParametersCount();
*total_argc = bound_argc + args_count;
- SmartArrayPointer<Object**> param_data(NewArray<Object**>(*total_argc));
+ SmartArrayPointer<Handle<Object> > param_data(
+ NewArray<Handle<Object> >(*total_argc));
for (int i = 0; i < args_count; i++) {
Handle<Object> val = Handle<Object>(frame->GetParameter(i));
- param_data[bound_argc + i] = val.location();
+ param_data[bound_argc + i] = val;
}
return param_data;
}
}
int total_argc = 0;
- SmartArrayPointer<Object**> param_data =
+ SmartArrayPointer<Handle<Object> > param_data =
GetNonBoundArguments(bound_argc, &total_argc);
for (int i = 0; i < bound_argc; i++) {
Handle<Object> val = Handle<Object>(bound_args->get(i));
- param_data[i] = val.location();
+ param_data[i] = val;
}
bool exception = false;
bool threw;
Handle<JSReceiver> hfun(fun);
Handle<Object> hreceiver(receiver);
- Handle<Object> result = Execution::Call(
- hfun, hreceiver, argc, reinterpret_cast<Object***>(argv), &threw, true);
+ Handle<Object> result =
+ Execution::Call(hfun, hreceiver, argc, argv, &threw, true);
if (threw) return Failure::Exception();
return *result;
&sinfo, function_context);
// Invoke the evaluation function and return the result.
- const int argc = 2;
- Object** argv[argc] = { arguments.location(),
- Handle<Object>::cast(source).location() };
+ Handle<Object> argv[] = { arguments, source };
Handle<Object> result =
- Execution::Call(Handle<JSFunction>::cast(evaluation_function), receiver,
- argc, argv, &has_pending_exception);
+ Execution::Call(Handle<JSFunction>::cast(evaluation_function),
+ receiver,
+ ARRAY_SIZE(argv),
+ argv,
+ &has_pending_exception);
if (has_pending_exception) return Failure::Exception();
// Skip the global proxy as it has no properties and always delegates to the
// TODO(antonm): consider passing a receiver when constructing a cache.
Handle<Object> receiver(isolate->global_context()->global());
// This handle is nor shared, nor used later, so it's safe.
- Object** argv[] = { key_handle.location() };
+ Handle<Object> argv[] = { key_handle };
bool pending_exception;
value = Execution::Call(factory,
receiver,
- 1,
+ ARRAY_SIZE(argv),
argv,
&pending_exception);
if (pending_exception) return Failure::Exception();
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
Handle<Object> fun1(fun1_object->ToObjectChecked());
CHECK(fun1->IsJSFunction());
- Object** argv[1] = {
- Handle<Object>::cast(FACTORY->LookupAsciiSymbol("hello")).location()
- };
- Execution::Call(Handle<JSFunction>::cast(fun1), global, 1, argv,
+ Handle<Object> argv[] = { FACTORY->LookupAsciiSymbol("hello") };
+ Execution::Call(Handle<JSFunction>::cast(fun1),
+ global,
+ ARRAY_SIZE(argv),
+ argv,
&has_pending_exception);
CHECK(!has_pending_exception);
}