Revert of [runtime] Initial step towards switching Execution::Call to callable. ...
authormachenbach <machenbach@chromium.org>
Thu, 17 Sep 2015 10:11:37 +0000 (03:11 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 17 Sep 2015 10:11:49 +0000 (10:11 +0000)
Reason for revert:
[Sheriff] Causes a dcheck failure in layout tests (and some test changes in release):
https://storage.googleapis.com/chromium-layout-test-archives/V8-Blink_Linux_64__dbg_/1442/layout-test-results/virtual/android/fullscreen/api/element-request-fullscreen-top-stderr.txt
from
http://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064%20%28dbg%29/builds/1442

Original issue's description:
> [runtime] Initial step towards switching Execution::Call to callable.
>
> Currently Execution::Call (and friends) still duplicate a lot of the
> Call sequence logic that should be encapsulated in the Call and
> CallFunction builtins. So the plan now is to switch Execution::Call
> to accept any Callable and just pass that through to the Call builtin.
>
> CQ_INCLUDE_TRYBOTS=tryserver.v8:v8_linux_nosnap_dbg
> R=jarin@chromium.org
> BUG=v8:4413
> LOG=n
>
> Committed: https://crrev.com/359645f48156e15f235e9a9ede7910e0bcd9ae45
> Cr-Commit-Position: refs/heads/master@{#30791}

TBR=jarin@chromium.org,bmeurer@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:4413

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

Cr-Commit-Position: refs/heads/master@{#30793}

16 files changed:
src/api.cc
src/arm/builtins-arm.cc
src/arm64/builtins-arm64.cc
src/code-stubs.cc
src/execution.cc
src/execution.h
src/ia32/builtins-ia32.cc
src/mips/builtins-mips.cc
src/mips64/builtins-mips64.cc
src/objects.cc
src/runtime/runtime-function.cc
src/x64/builtins-x64.cc
test/cctest/compiler/function-tester.h
test/cctest/compiler/test-run-bytecode-graph-builder.cc
test/cctest/compiler/test-simplified-lowering.cc
test/cctest/interpreter/test-interpreter.cc

index 62e50dd..1b5d428 100644 (file)
@@ -4254,8 +4254,10 @@ MaybeLocal<Value> Object::CallAsFunction(Local<Context> context,
     recv_obj = self;
   }
   Local<Value> result;
-  has_pending_exception = !ToLocal<Value>(
-      i::Execution::Call(isolate, fun, recv_obj, argc, args), &result);
+  has_pending_exception =
+      !ToLocal<Value>(
+          i::Execution::Call(isolate, fun, recv_obj, argc, args, true),
+          &result);
   RETURN_ON_FAILED_EXECUTION(Value);
   RETURN_ESCAPED(result);
 }
@@ -4363,8 +4365,10 @@ MaybeLocal<v8::Value> Function::Call(Local<Context> context,
   STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**));
   i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv);
   Local<Value> result;
-  has_pending_exception = !ToLocal<Value>(
-      i::Execution::Call(isolate, self, recv_obj, argc, args), &result);
+  has_pending_exception =
+      !ToLocal<Value>(
+          i::Execution::Call(isolate, self, recv_obj, argc, args, true),
+          &result);
   RETURN_ON_FAILED_EXECUTION(Value);
   RETURN_ESCAPED(result);
 }
@@ -6137,7 +6141,7 @@ MaybeLocal<Value> Map::Get(Local<Context> context, Local<Value> key) {
   i::Handle<i::Object> argv[] = {Utils::OpenHandle(*key)};
   has_pending_exception =
       !ToLocal<Value>(i::Execution::Call(isolate, isolate->map_get(), self,
-                                         arraysize(argv), argv),
+                                         arraysize(argv), argv, false),
                       &result);
   RETURN_ON_FAILED_EXECUTION(Value);
   RETURN_ESCAPED(result);
@@ -6151,9 +6155,9 @@ MaybeLocal<Map> Map::Set(Local<Context> context, Local<Value> key,
   i::Handle<i::Object> result;
   i::Handle<i::Object> argv[] = {Utils::OpenHandle(*key),
                                  Utils::OpenHandle(*value)};
-  has_pending_exception = !i::Execution::Call(isolate, isolate->map_set(), self,
-                                              arraysize(argv), argv)
-                               .ToHandle(&result);
+  has_pending_exception =
+      !i::Execution::Call(isolate, isolate->map_set(), self, arraysize(argv),
+                          argv, false).ToHandle(&result);
   RETURN_ON_FAILED_EXECUTION(Map);
   RETURN_ESCAPED(Local<Map>::Cast(Utils::ToLocal(result)));
 }
@@ -6164,9 +6168,9 @@ Maybe<bool> Map::Has(Local<Context> context, Local<Value> key) {
   auto self = Utils::OpenHandle(this);
   i::Handle<i::Object> result;
   i::Handle<i::Object> argv[] = {Utils::OpenHandle(*key)};
-  has_pending_exception = !i::Execution::Call(isolate, isolate->map_has(), self,
-                                              arraysize(argv), argv)
-                               .ToHandle(&result);
+  has_pending_exception =
+      !i::Execution::Call(isolate, isolate->map_has(), self, arraysize(argv),
+                          argv, false).ToHandle(&result);
   RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
   return Just(result->IsTrue());
 }
@@ -6177,9 +6181,9 @@ Maybe<bool> Map::Delete(Local<Context> context, Local<Value> key) {
   auto self = Utils::OpenHandle(this);
   i::Handle<i::Object> result;
   i::Handle<i::Object> argv[] = {Utils::OpenHandle(*key)};
-  has_pending_exception = !i::Execution::Call(isolate, isolate->map_delete(),
-                                              self, arraysize(argv), argv)
-                               .ToHandle(&result);
+  has_pending_exception =
+      !i::Execution::Call(isolate, isolate->map_delete(), self, arraysize(argv),
+                          argv, false).ToHandle(&result);
   RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
   return Just(result->IsTrue());
 }
@@ -6216,8 +6220,7 @@ MaybeLocal<Map> Map::FromArray(Local<Context> context, Local<Array> array) {
   has_pending_exception =
       !i::Execution::Call(isolate, isolate->map_from_array(),
                           isolate->factory()->undefined_value(),
-                          arraysize(argv), argv)
-           .ToHandle(&result);
+                          arraysize(argv), argv, false).ToHandle(&result);
   RETURN_ON_FAILED_EXECUTION(Map);
   RETURN_ESCAPED(Local<Map>::Cast(Utils::ToLocal(result)));
 }
@@ -6252,9 +6255,9 @@ MaybeLocal<Set> Set::Add(Local<Context> context, Local<Value> key) {
   auto self = Utils::OpenHandle(this);
   i::Handle<i::Object> result;
   i::Handle<i::Object> argv[] = {Utils::OpenHandle(*key)};
-  has_pending_exception = !i::Execution::Call(isolate, isolate->set_add(), self,
-                                              arraysize(argv), argv)
-                               .ToHandle(&result);
+  has_pending_exception =
+      !i::Execution::Call(isolate, isolate->set_add(), self, arraysize(argv),
+                          argv, false).ToHandle(&result);
   RETURN_ON_FAILED_EXECUTION(Set);
   RETURN_ESCAPED(Local<Set>::Cast(Utils::ToLocal(result)));
 }
@@ -6265,9 +6268,9 @@ Maybe<bool> Set::Has(Local<Context> context, Local<Value> key) {
   auto self = Utils::OpenHandle(this);
   i::Handle<i::Object> result;
   i::Handle<i::Object> argv[] = {Utils::OpenHandle(*key)};
-  has_pending_exception = !i::Execution::Call(isolate, isolate->set_has(), self,
-                                              arraysize(argv), argv)
-                               .ToHandle(&result);
+  has_pending_exception =
+      !i::Execution::Call(isolate, isolate->set_has(), self, arraysize(argv),
+                          argv, false).ToHandle(&result);
   RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
   return Just(result->IsTrue());
 }
@@ -6278,9 +6281,9 @@ Maybe<bool> Set::Delete(Local<Context> context, Local<Value> key) {
   auto self = Utils::OpenHandle(this);
   i::Handle<i::Object> result;
   i::Handle<i::Object> argv[] = {Utils::OpenHandle(*key)};
-  has_pending_exception = !i::Execution::Call(isolate, isolate->set_delete(),
-                                              self, arraysize(argv), argv)
-                               .ToHandle(&result);
+  has_pending_exception =
+      !i::Execution::Call(isolate, isolate->set_delete(), self, arraysize(argv),
+                          argv, false).ToHandle(&result);
   RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
   return Just(result->IsTrue());
 }
@@ -6314,8 +6317,7 @@ MaybeLocal<Set> Set::FromArray(Local<Context> context, Local<Array> array) {
   has_pending_exception =
       !i::Execution::Call(isolate, isolate->set_from_array(),
                           isolate->factory()->undefined_value(),
-                          arraysize(argv), argv)
-           .ToHandle(&result);
+                          arraysize(argv), argv, false).ToHandle(&result);
   RETURN_ON_FAILED_EXECUTION(Set);
   RETURN_ESCAPED(Local<Set>::Cast(Utils::ToLocal(result)));
 }
@@ -6330,10 +6332,12 @@ bool Value::IsPromise() const {
 MaybeLocal<Promise::Resolver> Promise::Resolver::New(Local<Context> context) {
   PREPARE_FOR_EXECUTION(context, "Promise::Resolver::New", Resolver);
   i::Handle<i::Object> result;
-  has_pending_exception =
-      !i::Execution::Call(isolate, isolate->promise_create(),
-                          isolate->factory()->undefined_value(), 0, NULL)
-           .ToHandle(&result);
+  has_pending_exception = !i::Execution::Call(
+      isolate,
+      isolate->promise_create(),
+      isolate->factory()->undefined_value(),
+      0, NULL,
+      false).ToHandle(&result);
   RETURN_ON_FAILED_EXECUTION(Promise::Resolver);
   RETURN_ESCAPED(Local<Promise::Resolver>::Cast(Utils::ToLocal(result)));
 }
@@ -6356,11 +6360,12 @@ Maybe<bool> Promise::Resolver::Resolve(Local<Context> context,
   PREPARE_FOR_EXECUTION_PRIMITIVE(context, "Promise::Resolver::Resolve", bool);
   auto self = Utils::OpenHandle(this);
   i::Handle<i::Object> argv[] = {self, Utils::OpenHandle(*value)};
-  has_pending_exception =
-      i::Execution::Call(isolate, isolate->promise_resolve(),
-                         isolate->factory()->undefined_value(), arraysize(argv),
-                         argv)
-          .is_null();
+  has_pending_exception = i::Execution::Call(
+      isolate,
+      isolate->promise_resolve(),
+      isolate->factory()->undefined_value(),
+      arraysize(argv), argv,
+      false).is_null();
   RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
   return Just(true);
 }
@@ -6377,11 +6382,12 @@ Maybe<bool> Promise::Resolver::Reject(Local<Context> context,
   PREPARE_FOR_EXECUTION_PRIMITIVE(context, "Promise::Resolver::Resolve", bool);
   auto self = Utils::OpenHandle(this);
   i::Handle<i::Object> argv[] = {self, Utils::OpenHandle(*value)};
-  has_pending_exception =
-      i::Execution::Call(isolate, isolate->promise_reject(),
-                         isolate->factory()->undefined_value(), arraysize(argv),
-                         argv)
-          .is_null();
+  has_pending_exception = i::Execution::Call(
+      isolate,
+      isolate->promise_reject(),
+      isolate->factory()->undefined_value(),
+      arraysize(argv), argv,
+      false).is_null();
   RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
   return Just(true);
 }
@@ -6399,9 +6405,9 @@ MaybeLocal<Promise> Promise::Chain(Local<Context> context,
   auto self = Utils::OpenHandle(this);
   i::Handle<i::Object> argv[] = {Utils::OpenHandle(*handler)};
   i::Handle<i::Object> result;
-  has_pending_exception = !i::Execution::Call(isolate, isolate->promise_chain(),
-                                              self, arraysize(argv), argv)
-                               .ToHandle(&result);
+  has_pending_exception =
+      !i::Execution::Call(isolate, isolate->promise_chain(), self,
+                          arraysize(argv), argv, false).ToHandle(&result);
   RETURN_ON_FAILED_EXECUTION(Promise);
   RETURN_ESCAPED(Local<Promise>::Cast(Utils::ToLocal(result)));
 }
@@ -6419,9 +6425,9 @@ MaybeLocal<Promise> Promise::Catch(Local<Context> context,
   auto self = Utils::OpenHandle(this);
   i::Handle<i::Object> argv[] = { Utils::OpenHandle(*handler) };
   i::Handle<i::Object> result;
-  has_pending_exception = !i::Execution::Call(isolate, isolate->promise_catch(),
-                                              self, arraysize(argv), argv)
-                               .ToHandle(&result);
+  has_pending_exception =
+      !i::Execution::Call(isolate, isolate->promise_catch(), self,
+                          arraysize(argv), argv, false).ToHandle(&result);
   RETURN_ON_FAILED_EXECUTION(Promise);
   RETURN_ESCAPED(Local<Promise>::Cast(Utils::ToLocal(result)));
 }
@@ -6439,9 +6445,9 @@ MaybeLocal<Promise> Promise::Then(Local<Context> context,
   auto self = Utils::OpenHandle(this);
   i::Handle<i::Object> argv[] = { Utils::OpenHandle(*handler) };
   i::Handle<i::Object> result;
-  has_pending_exception = !i::Execution::Call(isolate, isolate->promise_then(),
-                                              self, arraysize(argv), argv)
-                               .ToHandle(&result);
+  has_pending_exception =
+      !i::Execution::Call(isolate, isolate->promise_then(), self,
+                          arraysize(argv), argv, false).ToHandle(&result);
   RETURN_ON_FAILED_EXECUTION(Promise);
   RETURN_ESCAPED(Local<Promise>::Cast(Utils::ToLocal(result)));
 }
index 0410093..7daf1aa 100644 (file)
@@ -798,7 +798,8 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
       CallConstructStub stub(masm->isolate(), NO_CALL_CONSTRUCTOR_FLAGS);
       __ CallStub(&stub);
     } else {
-      __ Call(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
+      ParameterCount actual(r0);
+      __ InvokeFunction(r1, actual, CALL_FUNCTION, NullCallWrapper());
     }
     // Exit the JS frame and remove the parameters (except function), and
     // return.
index 01eef05..20f63f8 100644 (file)
@@ -835,7 +835,8 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
       CallConstructStub stub(masm->isolate(), NO_CALL_CONSTRUCTOR_FLAGS);
       __ CallStub(&stub);
     } else {
-      __ Call(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
+      ParameterCount actual(x0);
+      __ InvokeFunction(function, actual, CALL_FUNCTION, NullCallWrapper());
     }
     // Exit the JS internal frame and remove the parameters (except function),
     // and return.
index 3e1b548..e9fddf9 100644 (file)
@@ -489,8 +489,8 @@ Handle<Code> TurboFanCodeStub::GenerateCode() {
   Handle<Object> call_conv = factory->InternalizeUtf8String(name);
   Handle<Object> minor_key = factory->NewNumber(MinorKey());
   Handle<Object> args[] = {call_conv, minor_key};
-  MaybeHandle<Object> result =
-      Execution::Call(isolate(), outer, factory->undefined_value(), 2, args);
+  MaybeHandle<Object> result = Execution::Call(
+      isolate(), outer, factory->undefined_value(), 2, args, false);
   Handle<JSFunction> inner = Handle<JSFunction>::cast(result.ToHandleChecked());
   // Just to make sure nobody calls this...
   inner->set_code(isolate()->builtins()->builtin(Builtins::kIllegal));
index 2fc376a..2496439 100644 (file)
@@ -53,26 +53,21 @@ static void PrintDeserializedCodeInfo(Handle<JSFunction> function) {
 }
 
 
-namespace {
-
-MUST_USE_RESULT MaybeHandle<Object> Invoke(bool is_construct,
-                                           Handle<JSFunction> function,
-                                           Handle<Object> receiver, int argc,
-                                           Handle<Object> args[]) {
-  Isolate* const isolate = function->GetIsolate();
-
-  // Convert calls on global objects to be calls on the global
-  // receiver instead to avoid having a 'this' pointer which refers
-  // directly to a global object.
-  if (receiver->IsGlobalObject()) {
-    receiver =
-        handle(Handle<GlobalObject>::cast(receiver)->global_proxy(), isolate);
-  }
+MUST_USE_RESULT static MaybeHandle<Object> Invoke(
+    bool is_construct,
+    Handle<JSFunction> function,
+    Handle<Object> receiver,
+    int argc,
+    Handle<Object> args[]) {
+  Isolate* isolate = function->GetIsolate();
 
   // api callbacks can be called directly.
   if (!is_construct && function->shared()->IsApiFunction()) {
     SaveContext save(isolate);
     isolate->set_context(function->context());
+    if (receiver->IsGlobalObject()) {
+      receiver = handle(Handle<GlobalObject>::cast(receiver)->global_proxy());
+    }
     DCHECK(function->context()->global_object()->IsGlobalObject());
     auto value = Builtins::InvokeApiFunction(function, receiver, argc, args);
     bool has_exception = value.is_null();
@@ -108,6 +103,13 @@ MUST_USE_RESULT MaybeHandle<Object> Invoke(bool 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
+  // directly to a global object.
+  if (receiver->IsGlobalObject()) {
+    receiver = handle(Handle<GlobalObject>::cast(receiver)->global_proxy());
+  }
+
   // Make sure that the global object of the context we're about to
   // make the current one is indeed a global object.
   DCHECK(function->context()->global_object()->IsGlobalObject());
@@ -120,12 +122,13 @@ MUST_USE_RESULT MaybeHandle<Object> Invoke(bool is_construct,
     JSEntryFunction stub_entry = FUNCTION_CAST<JSEntryFunction>(code->entry());
 
     // Call the function through the right JS entry stub.
-    byte* ignored = nullptr;  // TODO(bmeurer): Remove this altogether.
+    byte* function_entry = function->code()->entry();
     JSFunction* func = *function;
     Object* recv = *receiver;
     Object*** argv = reinterpret_cast<Object***>(args);
     if (FLAG_profile_deserialization) PrintDeserializedCodeInfo(function);
-    value = CALL_GENERATED_CODE(stub_entry, ignored, func, recv, argc, argv);
+    value =
+        CALL_GENERATED_CODE(stub_entry, function_entry, func, recv, argc, argv);
   }
 
 #ifdef VERIFY_HEAP
@@ -151,18 +154,31 @@ MUST_USE_RESULT MaybeHandle<Object> Invoke(bool is_construct,
   return Handle<Object>(value, isolate);
 }
 
-}  // namespace
-
 
-MaybeHandle<Object> Execution::Call(Isolate* isolate, Handle<Object> callable,
-                                    Handle<Object> receiver, int argc,
-                                    Handle<Object> argv[]) {
+MaybeHandle<Object> Execution::Call(Isolate* isolate,
+                                    Handle<Object> callable,
+                                    Handle<Object> receiver,
+                                    int argc,
+                                    Handle<Object> argv[],
+                                    bool convert_receiver) {
   if (!callable->IsJSFunction()) {
     ASSIGN_RETURN_ON_EXCEPTION(isolate, callable,
                                GetFunctionDelegate(isolate, callable), Object);
   }
   Handle<JSFunction> func = Handle<JSFunction>::cast(callable);
 
+  // In sloppy mode, convert receiver.
+  if (convert_receiver && !receiver->IsJSReceiver() &&
+      !func->shared()->native() && is_sloppy(func->shared()->language_mode())) {
+    if (receiver->IsUndefined() || receiver->IsNull()) {
+      receiver = handle(func->global_proxy());
+      DCHECK(!receiver->IsJSBuiltinsObject());
+    } else {
+      ASSIGN_RETURN_ON_EXCEPTION(
+          isolate, receiver, ToObject(isolate, receiver), Object);
+    }
+  }
+
   return Invoke(false, func, receiver, argc, argv);
 }
 
@@ -191,7 +207,7 @@ MaybeHandle<Object> Execution::TryCall(Handle<JSFunction> func,
     catcher.SetVerbose(false);
     catcher.SetCaptureMessage(false);
 
-    maybe_result = Call(isolate, func, receiver, argc, args);
+    maybe_result = Invoke(false, func, receiver, argc, args);
 
     if (maybe_result.is_null()) {
       DCHECK(catcher.HasCaught());
index 51fe3d3..75f7a8e 100644 (file)
@@ -19,16 +19,23 @@ class JSRegExp;
 class Execution final : public AllStatic {
  public:
   // Call a function, the caller supplies a receiver and an array
-  // of arguments.
+  // of arguments. Arguments are Object* type. After function returns,
+  // pointers in 'args' might be invalid.
+  //
+  // *pending_exception tells whether the invoke resulted in
+  // a pending exception.
   //
-  // When the function called is not in strict mode, receiver is
-  // converted to an object.
+  // When convert_receiver is set, and the receiver is not an object,
+  // and the function called is not in strict mode, receiver is converted to
+  // an object.
   //
-  MUST_USE_RESULT static MaybeHandle<Object> Call(Isolate* isolate,
-                                                  Handle<Object> callable,
-                                                  Handle<Object> receiver,
-                                                  int argc,
-                                                  Handle<Object> argv[]);
+  MUST_USE_RESULT static MaybeHandle<Object> Call(
+      Isolate* isolate,
+      Handle<Object> callable,
+      Handle<Object> receiver,
+      int argc,
+      Handle<Object> argv[],
+      bool convert_receiver = false);
 
   // Construct object from function, the caller supplies an array of
   // arguments. Arguments are Object* type. After function returns,
index e205562..433c980 100644 (file)
@@ -534,7 +534,9 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
       CallConstructStub stub(masm->isolate(), NO_CALL_CONSTRUCTOR_FLAGS);
       __ CallStub(&stub);
     } else {
-      __ Call(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
+      ParameterCount actual(eax);
+      __ InvokeFunction(edi, actual, CALL_FUNCTION,
+                        NullCallWrapper());
     }
 
     // Exit the internal frame. Notice that this also removes the empty.
index 8c01d97..c78149f 100644 (file)
@@ -796,7 +796,8 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
       CallConstructStub stub(masm->isolate(), NO_CALL_CONSTRUCTOR_FLAGS);
       __ CallStub(&stub);
     } else {
-      __ Call(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
+      ParameterCount actual(a0);
+      __ InvokeFunction(a1, actual, CALL_FUNCTION, NullCallWrapper());
     }
 
     // Leave internal frame.
index fc937f6..e68f0fd 100644 (file)
@@ -794,7 +794,8 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
       CallConstructStub stub(masm->isolate(), NO_CALL_CONSTRUCTOR_FLAGS);
       __ CallStub(&stub);
     } else {
-      __ Call(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
+      ParameterCount actual(a0);
+      __ InvokeFunction(a1, actual, CALL_FUNCTION, NullCallWrapper());
     }
 
     // Leave internal frame.
index 3ab13a0..a642df0 100644 (file)
@@ -841,7 +841,7 @@ MaybeHandle<Object> Object::GetPropertyWithDefinedGetter(
   // TODO(rossberg): should this apply to getters that are function proxies?
   if (debug->is_active()) debug->HandleStepIn(getter, false);
 
-  return Execution::Call(isolate, getter, receiver, 0, NULL);
+  return Execution::Call(isolate, getter, receiver, 0, NULL, true);
 }
 
 
@@ -858,7 +858,7 @@ MaybeHandle<Object> Object::SetPropertyWithDefinedSetter(
 
   Handle<Object> argv[] = { value };
   RETURN_ON_EXCEPTION(isolate, Execution::Call(isolate, setter, receiver,
-                                               arraysize(argv), argv),
+                                               arraysize(argv), argv, true),
                       Object);
   return value;
 }
index 6585b4f..6666ba4 100644 (file)
@@ -522,7 +522,7 @@ RUNTIME_FUNCTION(Runtime_Call) {
   Handle<Object> result;
   ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
       isolate, result,
-      Execution::Call(isolate, target, receiver, argc, argv.start()));
+      Execution::Call(isolate, target, receiver, argc, argv.start(), true));
   return *result;
 }
 
@@ -559,7 +559,8 @@ RUNTIME_FUNCTION(Runtime_Apply) {
 
   Handle<Object> result;
   ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-      isolate, result, Execution::Call(isolate, fun, receiver, argc, argv));
+      isolate, result,
+      Execution::Call(isolate, fun, receiver, argc, argv, true));
   return *result;
 }
 
@@ -626,7 +627,8 @@ RUNTIME_FUNCTION(Runtime_CallFunction) {
   Handle<Object> hreceiver(receiver, isolate);
   Handle<Object> result;
   ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-      isolate, result, Execution::Call(isolate, hfun, hreceiver, argc, argv));
+      isolate, result,
+      Execution::Call(isolate, hfun, hreceiver, argc, argv, true));
   return *result;
 }
 
index 91db4c6..f04316c 100644 (file)
@@ -593,7 +593,9 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
       CallConstructStub stub(masm->isolate(), NO_CALL_CONSTRUCTOR_FLAGS);
       __ CallStub(&stub);
     } else {
-      __ Call(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
+      ParameterCount actual(rax);
+      // Function must be in rdi.
+      __ InvokeFunction(rdi, actual, CALL_FUNCTION, NullCallWrapper());
     }
     // Exit the internal frame. Notice that this also removes the empty
     // context and the function left on the stack by the code
index 1a1730e..56ab514 100644 (file)
@@ -51,13 +51,13 @@ class FunctionTester : public InitializedHandleScope {
 
   MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b) {
     Handle<Object> args[] = {a, b};
-    return Execution::Call(isolate, function, undefined(), 2, args);
+    return Execution::Call(isolate, function, undefined(), 2, args, false);
   }
 
   MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b, Handle<Object> c,
                            Handle<Object> d) {
     Handle<Object> args[] = {a, b, c, d};
-    return Execution::Call(isolate, function, undefined(), 4, args);
+    return Execution::Call(isolate, function, undefined(), 4, args, false);
   }
 
   void CheckThrows(Handle<Object> a, Handle<Object> b) {
index 06cb2f7..c64a934 100644 (file)
@@ -25,7 +25,8 @@ static const char kFunctionName[] = "f";
 static MaybeHandle<Object> CallFunction(Isolate* isolate,
                                         Handle<JSFunction> function) {
   return Execution::Call(isolate, function,
-                         isolate->factory()->undefined_value(), 0, nullptr);
+                         isolate->factory()->undefined_value(), 0, nullptr,
+                         false);
 }
 
 
@@ -36,7 +37,7 @@ static MaybeHandle<Object> CallFunction(Isolate* isolate,
   Handle<Object> argv[] = {args...};
   return Execution::Call(isolate, function,
                          isolate->factory()->undefined_value(), sizeof...(args),
-                         argv);
+                         argv, false);
 }
 
 
index 07f5153..8c6c5fd 100644 (file)
@@ -82,7 +82,7 @@ class SimplifiedLoweringTester : public GraphBuilderTester<ReturnType> {
     Handle<JSFunction> fun = FunctionTester::ForMachineGraph(this->graph());
     Handle<Object>* args = NULL;
     MaybeHandle<Object> result = Execution::Call(
-        this->isolate(), fun, factory()->undefined_value(), 0, args);
+        this->isolate(), fun, factory()->undefined_value(), 0, args, false);
     return T::cast(*result.ToHandleChecked());
   }
 
index b4a2eb3..ca4ddb4 100644 (file)
@@ -18,7 +18,8 @@ namespace interpreter {
 static MaybeHandle<Object> CallInterpreter(Isolate* isolate,
                                            Handle<JSFunction> function) {
   return Execution::Call(isolate, function,
-                         isolate->factory()->undefined_value(), 0, nullptr);
+                         isolate->factory()->undefined_value(), 0, nullptr,
+                         false);
 }
 
 
@@ -29,7 +30,7 @@ static MaybeHandle<Object> CallInterpreter(Isolate* isolate,
   Handle<Object> argv[] = { args... };
   return Execution::Call(isolate, function,
                          isolate->factory()->undefined_value(), sizeof...(args),
-                         argv);
+                         argv, false);
 }