Reviewers: Jakob,

Description:
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.

[email protected]

Please review this at https://codereview.chromium.org/1289203003/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+13, -21 lines):
  M src/execution.cc
  M src/factory.cc
  M src/messages.cc


Index: src/execution.cc
diff --git a/src/execution.cc b/src/execution.cc
index 52cff2f7900eabe3b554724f3525f449f850a6ad..d2dd41a12c6598ca170d80da314267382780e86e 100644
--- a/src/execution.cc
+++ b/src/execution.cc
@@ -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: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 11afad45693cee917a62724c8819fc1e3e4ad0ef..43c0f8aac780d007b07a076a906458f8fa3aaefc 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -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: src/messages.cc
diff --git a/src/messages.cc b/src/messages.cc
index 306fcc503f4ff4d34e75823bc6ced8246e7fd89d..4eb79a93061ca5548071376fee1fd6aca9e7a0b1 100644
--- a/src/messages.cc
+++ b/src/messages.cc
@@ -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>"));


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to