Merge V8 5.2.361.47 DO NOT MERGE
https://chromium.googlesource.com/v8/v8/+/5.2.361.47
FPIIM-449
Change-Id: Ibec421b85a9b88cb3a432ada642e469fe7e78346
(cherry picked from commit bcf72ee8e3b26f1d0726869c7ddb3921c68b09a8)
diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc
index 011f9ff..56cf3b6 100644
--- a/src/runtime/runtime-function.cc
+++ b/src/runtime/runtime-function.cc
@@ -11,6 +11,7 @@
#include "src/isolate-inl.h"
#include "src/messages.h"
#include "src/profiler/cpu-profiler.h"
+#include "src/wasm/wasm-module.h"
namespace v8 {
namespace internal {
@@ -20,16 +21,15 @@
DCHECK(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(JSReceiver, function, 0);
- if (function->IsJSBoundFunction()) {
Handle<Object> result;
+ if (function->IsJSBoundFunction()) {
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, result, JSBoundFunction::GetName(
isolate, Handle<JSBoundFunction>::cast(function)));
- return *result;
} else {
- RUNTIME_ASSERT(function->IsJSFunction());
- return Handle<JSFunction>::cast(function)->shared()->name();
+ result = JSFunction::GetName(isolate, Handle<JSFunction>::cast(function));
}
+ return *result;
}
@@ -289,10 +289,7 @@
HandleScope scope(isolate);
DCHECK(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 0);
- if (receiver->IsNull() || receiver->IsUndefined()) {
- return isolate->global_proxy();
- }
- return *Object::ToObject(isolate, receiver).ToHandleChecked();
+ return *Object::ConvertReceiver(isolate, receiver).ToHandleChecked();
}
@@ -314,5 +311,15 @@
: *JSFunction::ToString(Handle<JSFunction>::cast(function));
}
+RUNTIME_FUNCTION(Runtime_WasmGetFunctionName) {
+ HandleScope scope(isolate);
+ DCHECK_EQ(2, args.length());
+
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, wasm, 0);
+ CONVERT_SMI_ARG_CHECKED(func_index, 1);
+
+ return *wasm::GetWasmFunctionName(wasm, func_index);
+}
+
} // namespace internal
} // namespace v8