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

Side by Side Diff: src/builtins/builtins-array.cc

Issue 2705163005: [csa] Add Unreachable() and use it after throw sites (Closed)
Patch Set: Rebase Created 3 years, 10 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
« no previous file with comments | « no previous file | src/builtins/builtins-date.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/builtins/builtins.h" 5 #include "src/builtins/builtins.h"
6 #include "src/builtins/builtins-utils.h" 6 #include "src/builtins/builtins-utils.h"
7 7
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stub-assembler.h" 9 #include "src/code-stub-assembler.h"
10 #include "src/contexts.h" 10 #include "src/contexts.h"
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 Bind(&after_loop); 645 Bind(&after_loop);
646 Return(UndefinedConstant()); 646 Return(UndefinedConstant());
647 } 647 }
648 648
649 Bind(&throw_null_undefined_exception); 649 Bind(&throw_null_undefined_exception);
650 { 650 {
651 CallRuntime(Runtime::kThrowTypeError, context, 651 CallRuntime(Runtime::kThrowTypeError, context,
652 SmiConstant(MessageTemplate::kCalledOnNullOrUndefined), 652 SmiConstant(MessageTemplate::kCalledOnNullOrUndefined),
653 HeapConstant(isolate()->factory()->NewStringFromAsciiChecked( 653 HeapConstant(isolate()->factory()->NewStringFromAsciiChecked(
654 "Array.prototype.forEach"))); 654 "Array.prototype.forEach")));
655 Return(UndefinedConstant()); 655 Unreachable();
656 } 656 }
657 657
658 Bind(&type_exception); 658 Bind(&type_exception);
659 { 659 {
660 CallRuntime(Runtime::kThrowTypeError, context, 660 CallRuntime(Runtime::kThrowTypeError, context,
661 SmiConstant(MessageTemplate::kCalledNonCallable), callbackfn); 661 SmiConstant(MessageTemplate::kCalledNonCallable), callbackfn);
662 Return(UndefinedConstant()); 662 Unreachable();
663 } 663 }
664 } 664 }
665 665
666 BUILTIN(ArraySlice) { 666 BUILTIN(ArraySlice) {
667 HandleScope scope(isolate); 667 HandleScope scope(isolate);
668 Handle<Object> receiver = args.receiver(); 668 Handle<Object> receiver = args.receiver();
669 int len = -1; 669 int len = -1;
670 int relative_start = 0; 670 int relative_start = 0;
671 int relative_end = 0; 671 int relative_end = 0;
672 672
(...skipping 2156 matching lines...) Expand 10 before | Expand all | Expand 10 after
2829 assembler.StoreObjectFieldNoWriteBarrier( 2829 assembler.StoreObjectFieldNoWriteBarrier(
2830 result, JSIteratorResult::kValueOffset, var_value.value()); 2830 result, JSIteratorResult::kValueOffset, var_value.value());
2831 assembler.StoreObjectFieldNoWriteBarrier( 2831 assembler.StoreObjectFieldNoWriteBarrier(
2832 result, JSIteratorResult::kDoneOffset, var_done.value()); 2832 result, JSIteratorResult::kDoneOffset, var_done.value());
2833 assembler.Return(result); 2833 assembler.Return(result);
2834 } 2834 }
2835 2835
2836 assembler.Bind(&throw_bad_receiver); 2836 assembler.Bind(&throw_bad_receiver);
2837 { 2837 {
2838 // The {receiver} is not a valid JSArrayIterator. 2838 // The {receiver} is not a valid JSArrayIterator.
2839 Node* result = assembler.CallRuntime( 2839 assembler.CallRuntime(Runtime::kThrowIncompatibleMethodReceiver, context,
2840 Runtime::kThrowIncompatibleMethodReceiver, context, 2840 assembler.HeapConstant(operation), iterator);
2841 assembler.HeapConstant(operation), iterator); 2841 assembler.Unreachable();
2842 assembler.Return(result);
2843 } 2842 }
2844 2843
2845 assembler.Bind(&if_isdetached); 2844 assembler.Bind(&if_isdetached);
2846 { 2845 {
2847 Node* message = assembler.SmiConstant(MessageTemplate::kDetachedOperation); 2846 Node* message = assembler.SmiConstant(MessageTemplate::kDetachedOperation);
2848 Node* result = 2847 assembler.CallRuntime(Runtime::kThrowTypeError, context, message,
2849 assembler.CallRuntime(Runtime::kThrowTypeError, context, message, 2848 assembler.HeapConstant(operation));
2850 assembler.HeapConstant(operation)); 2849 assembler.Unreachable();
2851 assembler.Return(result);
2852 } 2850 }
2853 } 2851 }
2854 2852
2855 } // namespace internal 2853 } // namespace internal
2856 } // namespace v8 2854 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/builtins/builtins-date.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698