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

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

Issue 2229723002: [wasm] Support validation of asm.js modules with != 3 args. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Created 4 years, 4 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 <memory> 7 #include <memory>
8 8
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/deoptimizer.h" 10 #include "src/deoptimizer.h"
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 } 615 }
616 616
617 617
618 RUNTIME_FUNCTION(Runtime_InNewSpace) { 618 RUNTIME_FUNCTION(Runtime_InNewSpace) {
619 SealHandleScope shs(isolate); 619 SealHandleScope shs(isolate);
620 DCHECK(args.length() == 1); 620 DCHECK(args.length() == 1);
621 CONVERT_ARG_CHECKED(Object, obj, 0); 621 CONVERT_ARG_CHECKED(Object, obj, 0);
622 return isolate->heap()->ToBoolean(isolate->heap()->InNewSpace(obj)); 622 return isolate->heap()->ToBoolean(isolate->heap()->InNewSpace(obj));
623 } 623 }
624 624
625 RUNTIME_FUNCTION(Runtime_IsAsmWasmCode) {
626 SealHandleScope shs(isolate);
627 DCHECK(args.length() == 1);
628 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
629
630 if (!function->shared()->HasAsmWasmData()) {
631 // Doesn't have wasm data.
632 return isolate->heap()->ToBoolean(false);
633 }
634 if (function->code() !=
Michael Starzinger 2016/08/12 09:21:56 Lets just test function->shared()->code() here. Th
bradn 2016/08/12 18:50:02 Done.
635 isolate->builtins()->builtin(Builtins::kInstantiateAsmJs)) {
636 // Hasn't been compiled yet.
637 return isolate->heap()->ToBoolean(false);
638 }
639 return isolate->heap()->ToBoolean(true);
640 }
625 641
626 #define ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(Name) \ 642 #define ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(Name) \
627 RUNTIME_FUNCTION(Runtime_Has##Name) { \ 643 RUNTIME_FUNCTION(Runtime_Has##Name) { \
628 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ 644 CONVERT_ARG_CHECKED(JSObject, obj, 0); \
629 return isolate->heap()->ToBoolean(obj->Has##Name()); \ 645 return isolate->heap()->ToBoolean(obj->Has##Name()); \
630 } 646 }
631 647
632 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiElements) 648 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiElements)
633 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastObjectElements) 649 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastObjectElements)
634 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiOrObjectElements) 650 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiOrObjectElements)
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 WasmCompiledModuleSerializer::DeserializeWasmModule(isolate, &sc); 709 WasmCompiledModuleSerializer::DeserializeWasmModule(isolate, &sc);
694 Handle<FixedArray> compiled_module; 710 Handle<FixedArray> compiled_module;
695 if (!maybe_compiled_module.ToHandle(&compiled_module)) { 711 if (!maybe_compiled_module.ToHandle(&compiled_module)) {
696 return isolate->heap()->undefined_value(); 712 return isolate->heap()->undefined_value();
697 } 713 }
698 return *wasm::CreateCompiledModuleObject(isolate, compiled_module); 714 return *wasm::CreateCompiledModuleObject(isolate, compiled_module);
699 } 715 }
700 716
701 } // namespace internal 717 } // namespace internal
702 } // namespace v8 718 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698