Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: src/runtime/runtime-function.cc

Issue 1970503004: [wasm] Differentiate unnamed and empty names (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@add-utf8-check
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/frames-inl.h" 10 #include "src/frames-inl.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 return function->IsJSBoundFunction() 300 return function->IsJSBoundFunction()
301 ? *JSBoundFunction::ToString( 301 ? *JSBoundFunction::ToString(
302 Handle<JSBoundFunction>::cast(function)) 302 Handle<JSBoundFunction>::cast(function))
303 : *JSFunction::ToString(Handle<JSFunction>::cast(function)); 303 : *JSFunction::ToString(Handle<JSFunction>::cast(function));
304 } 304 }
305 305
306 RUNTIME_FUNCTION(Runtime_WasmGetFunctionName) { 306 RUNTIME_FUNCTION(Runtime_WasmGetFunctionName) {
307 HandleScope scope(isolate); 307 HandleScope scope(isolate);
308 DCHECK_EQ(2, args.length()); 308 DCHECK_EQ(2, args.length());
309 309
310 CONVERT_ARG_HANDLE_CHECKED(JSObject, wasm, 0); 310 CONVERT_ARG_HANDLE_CHECKED(Object, wasm, 0);
311 CONVERT_SMI_ARG_CHECKED(func_index, 1); 311 CONVERT_SMI_ARG_CHECKED(func_index, 1);
312 312
313 return *wasm::GetWasmFunctionName(wasm, func_index); 313 RUNTIME_ASSERT(wasm->IsUndefined() || wasm->IsJSObject());
314 Handle<Object> funName =
315 wasm->IsUndefined()
316 ? wasm
317 : wasm::GetWasmFunctionName(Handle<JSObject>::cast(wasm), func_index);
318 return *funName;
314 } 319 }
315 320
316 } // namespace internal 321 } // namespace internal
317 } // namespace v8 322 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698