Commit f3a4d2c5 authored by yangguo's avatar yangguo Committed by Commit bot

No longer use js builtins object as receiver for calls into JS.

This is no longer necessary. Everything the callee needs should
be in its context chain.

R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/1289203003

Cr-Commit-Position: refs/heads/master@{#30173}
parent 374a4da8
......@@ -523,10 +523,8 @@ void StackGuard::InitThread(const ExecutionAccess& lock) {
#define RETURN_NATIVE_CALL(name, args) \
do { \
Handle<Object> argv[] = args; \
return Call(isolate, \
isolate->name##_fun(), \
isolate->js_builtins_object(), \
arraysize(argv), argv); \
return Call(isolate, isolate->name##_fun(), \
isolate->factory()->undefined_value(), arraysize(argv), argv); \
} while (false)
......@@ -615,9 +613,7 @@ Handle<String> Execution::GetStackTraceLine(Handle<Object> recv,
Handle<Object> args[] = { recv, fun, pos, is_global };
MaybeHandle<Object> maybe_result =
TryCall(isolate->get_stack_trace_line_fun(),
isolate->js_builtins_object(),
arraysize(args),
args);
isolate->factory()->undefined_value(), arraysize(args), args);
Handle<Object> result;
if (!maybe_result.ToHandle(&result) || !result->IsString()) {
return isolate->factory()->empty_string();
......
......@@ -1239,11 +1239,9 @@ Handle<Object> Factory::NewError(const char* maker, const char* message,
// running the factory method, use the exception as the result.
Handle<Object> result;
MaybeHandle<Object> exception;
if (!Execution::TryCall(fun,
isolate()->js_builtins_object(),
arraysize(argv),
argv,
&exception).ToHandle(&result)) {
if (!Execution::TryCall(fun, undefined_value(), arraysize(argv), argv,
&exception)
.ToHandle(&result)) {
Handle<Object> exception_obj;
if (exception.ToHandle(&exception_obj)) return exception_obj;
return undefined_value();
......@@ -1263,11 +1261,9 @@ Handle<Object> Factory::NewError(const char* constructor,
// running the factory method, use the exception as the result.
Handle<Object> result;
MaybeHandle<Object> exception;
if (!Execution::TryCall(fun,
isolate()->js_builtins_object(),
arraysize(argv),
argv,
&exception).ToHandle(&result)) {
if (!Execution::TryCall(fun, undefined_value(), arraysize(argv), argv,
&exception)
.ToHandle(&result)) {
Handle<Object> exception_obj;
if (exception.ToHandle(&exception_obj)) return exception_obj;
return undefined_value();
......
......@@ -304,7 +304,7 @@ Handle<String> MessageTemplate::FormatMessage(Isolate* isolate,
.ToHandleChecked());
MaybeHandle<Object> maybe_result =
Execution::TryCall(fun, isolate->js_builtins_object(), 1, &arg);
Execution::TryCall(fun, factory->undefined_value(), 1, &arg);
Handle<Object> result;
if (!maybe_result.ToHandle(&result) || !result->IsString()) {
return factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("<error>"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment