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

Side by Side Diff: src/builtins/builtins-sharedarraybuffer.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 | « src/builtins/builtins-regexp.cc ('k') | src/builtins/builtins-string.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/base/macros.h" 5 #include "src/base/macros.h"
6 #include "src/base/platform/mutex.h" 6 #include "src/base/platform/mutex.h"
7 #include "src/base/platform/time.h" 7 #include "src/base/platform/time.h"
8 #include "src/builtins/builtins-utils.h" 8 #include "src/builtins/builtins-utils.h"
9 #include "src/builtins/builtins.h" 9 #include "src/builtins/builtins.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 STATIC_ASSERT(FIXED_UINT32_ARRAY_TYPE < FIXED_FLOAT32_ARRAY_TYPE); 78 STATIC_ASSERT(FIXED_UINT32_ARRAY_TYPE < FIXED_FLOAT32_ARRAY_TYPE);
79 a->Branch(a->Int32LessThan(elements_instance_type, 79 a->Branch(a->Int32LessThan(elements_instance_type,
80 a->Int32Constant(FIXED_FLOAT32_ARRAY_TYPE)), 80 a->Int32Constant(FIXED_FLOAT32_ARRAY_TYPE)),
81 &not_float_or_clamped, &is_float_or_clamped); 81 &not_float_or_clamped, &is_float_or_clamped);
82 a->Bind(&is_float_or_clamped); 82 a->Bind(&is_float_or_clamped);
83 a->Goto(&invalid); 83 a->Goto(&invalid);
84 84
85 a->Bind(&invalid); 85 a->Bind(&invalid);
86 a->CallRuntime(Runtime::kThrowNotIntegerSharedTypedArrayError, context, 86 a->CallRuntime(Runtime::kThrowNotIntegerSharedTypedArrayError, context,
87 tagged); 87 tagged);
88 a->Return(a->UndefinedConstant()); 88 a->Unreachable();
89 89
90 a->Bind(&not_float_or_clamped); 90 a->Bind(&not_float_or_clamped);
91 *out_instance_type = elements_instance_type; 91 *out_instance_type = elements_instance_type;
92 92
93 Node* backing_store = 93 Node* backing_store =
94 a->LoadObjectField(array_buffer, JSArrayBuffer::kBackingStoreOffset); 94 a->LoadObjectField(array_buffer, JSArrayBuffer::kBackingStoreOffset);
95 Node* byte_offset = a->ChangeUint32ToWord(a->TruncateTaggedToWord32( 95 Node* byte_offset = a->ChangeUint32ToWord(a->TruncateTaggedToWord32(
96 context, 96 context,
97 a->LoadObjectField(tagged, JSArrayBufferView::kByteOffsetOffset))); 97 a->LoadObjectField(tagged, JSArrayBufferView::kByteOffsetOffset)));
98 *out_backing_store = 98 *out_backing_store =
(...skipping 30 matching lines...) Expand all
129 a->Branch(a->Float64Equal(number_index_value, test_index), 129 a->Branch(a->Float64Equal(number_index_value, test_index),
130 &if_indexesareequal, &if_indexesarenotequal); 130 &if_indexesareequal, &if_indexesarenotequal);
131 131
132 a->Bind(&if_indexesareequal); 132 a->Bind(&if_indexesareequal);
133 { 133 {
134 var_result.Bind(access_index); 134 var_result.Bind(access_index);
135 a->Goto(&done); 135 a->Goto(&done);
136 } 136 }
137 137
138 a->Bind(&if_indexesarenotequal); 138 a->Bind(&if_indexesarenotequal);
139 a->Return( 139 a->CallRuntime(Runtime::kThrowInvalidAtomicAccessIndexError, context);
140 a->CallRuntime(Runtime::kThrowInvalidAtomicAccessIndexError, context)); 140 a->Unreachable();
141 } 141 }
142 142
143 a->Bind(&done); 143 a->Bind(&done);
144 return var_result.value(); 144 return var_result.value();
145 } 145 }
146 146
147 void ValidateAtomicIndex(CodeStubAssembler* a, compiler::Node* index_word, 147 void ValidateAtomicIndex(CodeStubAssembler* a, compiler::Node* index_word,
148 compiler::Node* array_length_word, 148 compiler::Node* array_length_word,
149 compiler::Node* context) { 149 compiler::Node* context) {
150 using compiler::Node; 150 using compiler::Node;
151 // Check if the index is in bounds. If not, throw RangeError. 151 // Check if the index is in bounds. If not, throw RangeError.
152 CodeStubAssembler::Label if_inbounds(a), if_notinbounds(a); 152 CodeStubAssembler::Label if_inbounds(a), if_notinbounds(a);
153 // TODO(jkummerow): Use unsigned comparison instead of "i<0 || i>length". 153 // TODO(jkummerow): Use unsigned comparison instead of "i<0 || i>length".
154 a->Branch( 154 a->Branch(
155 a->Word32Or(a->Int32LessThan(index_word, a->Int32Constant(0)), 155 a->Word32Or(a->Int32LessThan(index_word, a->Int32Constant(0)),
156 a->Int32GreaterThanOrEqual(index_word, array_length_word)), 156 a->Int32GreaterThanOrEqual(index_word, array_length_word)),
157 &if_notinbounds, &if_inbounds); 157 &if_notinbounds, &if_inbounds);
158 a->Bind(&if_notinbounds); 158 a->Bind(&if_notinbounds);
159 a->Return( 159 a->CallRuntime(Runtime::kThrowInvalidAtomicAccessIndexError, context);
160 a->CallRuntime(Runtime::kThrowInvalidAtomicAccessIndexError, context)); 160 a->Unreachable();
161 a->Bind(&if_inbounds); 161 a->Bind(&if_inbounds);
162 } 162 }
163 163
164 } // anonymous namespace 164 } // anonymous namespace
165 165
166 void Builtins::Generate_AtomicsLoad(compiler::CodeAssemblerState* state) { 166 void Builtins::Generate_AtomicsLoad(compiler::CodeAssemblerState* state) {
167 using compiler::Node; 167 using compiler::Node;
168 CodeStubAssembler a(state); 168 CodeStubAssembler a(state);
169 Node* array = a.Parameter(1); 169 Node* array = a.Parameter(1);
170 Node* index = a.Parameter(2); 170 Node* index = a.Parameter(2);
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 default: 993 default:
994 break; 994 break;
995 } 995 }
996 996
997 UNREACHABLE(); 997 UNREACHABLE();
998 return isolate->heap()->undefined_value(); 998 return isolate->heap()->undefined_value();
999 } 999 }
1000 1000
1001 } // namespace internal 1001 } // namespace internal
1002 } // namespace v8 1002 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-regexp.cc ('k') | src/builtins/builtins-string.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698