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

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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 } 595 }
596 596
597 597
598 RUNTIME_FUNCTION(Runtime_InNewSpace) { 598 RUNTIME_FUNCTION(Runtime_InNewSpace) {
599 SealHandleScope shs(isolate); 599 SealHandleScope shs(isolate);
600 DCHECK(args.length() == 1); 600 DCHECK(args.length() == 1);
601 CONVERT_ARG_CHECKED(Object, obj, 0); 601 CONVERT_ARG_CHECKED(Object, obj, 0);
602 return isolate->heap()->ToBoolean(isolate->heap()->InNewSpace(obj)); 602 return isolate->heap()->ToBoolean(isolate->heap()->InNewSpace(obj));
603 } 603 }
604 604
605 RUNTIME_FUNCTION(Runtime_IsAsmWasmCode) {
606 SealHandleScope shs(isolate);
607 DCHECK(args.length() == 1);
608 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
609
610 if (!function->shared()->HasAsmWasmData()) {
611 // Doesn't have wasm data.
612 return isolate->heap()->ToBoolean(false);
613 }
614 if (function->code() !=
615 isolate->builtins()->builtin(Builtins::kInstantiateAsmJs)) {
616 // Hasn't been compiled yet.
617 return isolate->heap()->ToBoolean(false);
618 }
619 return isolate->heap()->ToBoolean(true);
620 }
605 621
606 #define ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(Name) \ 622 #define ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(Name) \
607 RUNTIME_FUNCTION(Runtime_Has##Name) { \ 623 RUNTIME_FUNCTION(Runtime_Has##Name) { \
608 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ 624 CONVERT_ARG_CHECKED(JSObject, obj, 0); \
609 return isolate->heap()->ToBoolean(obj->Has##Name()); \ 625 return isolate->heap()->ToBoolean(obj->Has##Name()); \
610 } 626 }
611 627
612 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiElements) 628 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiElements)
613 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastObjectElements) 629 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastObjectElements)
614 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiOrObjectElements) 630 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiOrObjectElements)
(...skipping 21 matching lines...) Expand all
636 652
637 RUNTIME_FUNCTION(Runtime_SpeciesProtector) { 653 RUNTIME_FUNCTION(Runtime_SpeciesProtector) {
638 SealHandleScope shs(isolate); 654 SealHandleScope shs(isolate);
639 DCHECK_EQ(0, args.length()); 655 DCHECK_EQ(0, args.length());
640 return isolate->heap()->ToBoolean(isolate->IsArraySpeciesLookupChainIntact()); 656 return isolate->heap()->ToBoolean(isolate->IsArraySpeciesLookupChainIntact());
641 } 657 }
642 658
643 659
644 } // namespace internal 660 } // namespace internal
645 } // namespace v8 661 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698