No longer use js builtins object as receiver for calls into JS.
authoryangguo <yangguo@chromium.org>
Fri, 14 Aug 2015 10:22:16 +0000 (03:22 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 14 Aug 2015 10:22:23 +0000 (10:22 +0000)
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}

src/execution.cc
src/factory.cc
src/messages.cc

index 52cff2f7900eabe3b554724f3525f449f850a6ad..d2dd41a12c6598ca170d80da314267382780e86e 100644 (file)
@@ -520,13 +520,11 @@ void StackGuard::InitThread(const ExecutionAccess& lock) {
 
 // --- C a l l s   t o   n a t i v e s ---
 
-#define RETURN_NATIVE_CALL(name, args)                                  \
-  do {                                                                  \
-    Handle<Object> argv[] = args;                                       \
-    return Call(isolate,                                                \
-                isolate->name##_fun(),                                  \
-                isolate->js_builtins_object(),                          \
-                arraysize(argv), argv);                                \
+#define RETURN_NATIVE_CALL(name, args)                                         \
+  do {                                                                         \
+    Handle<Object> argv[] = args;                                              \
+    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();
index 11afad45693cee917a62724c8819fc1e3e4ad0ef..43c0f8aac780d007b07a076a906458f8fa3aaefc 100644 (file)
@@ -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();
index 306fcc503f4ff4d34e75823bc6ced8246e7fd89d..4eb79a93061ca5548071376fee1fd6aca9e7a0b1 100644 (file)
@@ -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>"));