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

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

Issue 2489743002: [stubs] Ensure CSA_ASSERT and CSA_SLOW_ASSERT do not produce unused instructions in release mode. (Closed)
Patch Set: ((void)0) Created 4 years, 1 month 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-regexp.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/contexts.h" 9 #include "src/contexts.h"
10 #include "src/elements.h" 10 #include "src/elements.h"
(...skipping 2161 matching lines...) Expand 10 before | Expand all | Expand 10 after
2172 iterator, JSArrayIterator::kIteratedObjectMapOffset); 2172 iterator, JSArrayIterator::kIteratedObjectMapOffset);
2173 Node* array_map = assembler->LoadMap(array); 2173 Node* array_map = assembler->LoadMap(array);
2174 2174
2175 Label if_isfastarray(assembler), if_isnotfastarray(assembler); 2175 Label if_isfastarray(assembler), if_isnotfastarray(assembler);
2176 2176
2177 assembler->Branch(assembler->WordEqual(orig_map, array_map), &if_isfastarray, 2177 assembler->Branch(assembler->WordEqual(orig_map, array_map), &if_isfastarray,
2178 &if_isnotfastarray); 2178 &if_isnotfastarray);
2179 2179
2180 assembler->Bind(&if_isfastarray); 2180 assembler->Bind(&if_isfastarray);
2181 { 2181 {
2182 assembler->Assert( 2182 CSA_ASSERT(assembler,
2183 assembler->Word32Equal(assembler->LoadMapInstanceType(array_map), 2183 assembler->Word32Equal(assembler->LoadMapInstanceType(array_map),
2184 assembler->Int32Constant(JS_ARRAY_TYPE))); 2184 assembler->Int32Constant(JS_ARRAY_TYPE)));
2185 2185
2186 Node* length = assembler->LoadObjectField(array, JSArray::kLengthOffset); 2186 Node* length = assembler->LoadObjectField(array, JSArray::kLengthOffset);
2187 2187
2188 assembler->Assert(assembler->TaggedIsSmi(length)); 2188 CSA_ASSERT(assembler, assembler->TaggedIsSmi(length));
2189 assembler->Assert(assembler->TaggedIsSmi(index)); 2189 CSA_ASSERT(assembler, assembler->TaggedIsSmi(index));
2190 2190
2191 assembler->GotoUnless(assembler->SmiBelow(index, length), &set_done); 2191 assembler->GotoUnless(assembler->SmiBelow(index, length), &set_done);
2192 2192
2193 Node* one = assembler->SmiConstant(Smi::FromInt(1)); 2193 Node* one = assembler->SmiConstant(Smi::FromInt(1));
2194 assembler->StoreObjectFieldNoWriteBarrier( 2194 assembler->StoreObjectFieldNoWriteBarrier(
2195 iterator, JSArrayIterator::kNextIndexOffset, 2195 iterator, JSArrayIterator::kNextIndexOffset,
2196 assembler->IntPtrAdd(assembler->BitcastTaggedToWord(index), 2196 assembler->IntPtrAdd(assembler->BitcastTaggedToWord(index),
2197 assembler->BitcastTaggedToWord(one))); 2197 assembler->BitcastTaggedToWord(one)));
2198 2198
2199 var_done.Bind(assembler->FalseConstant()); 2199 var_done.Bind(assembler->FalseConstant());
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
2377 2377
2378 assembler->Bind(&if_isdetached); 2378 assembler->Bind(&if_isdetached);
2379 { 2379 {
2380 var_length.Bind(assembler->SmiConstant(Smi::kZero)); 2380 var_length.Bind(assembler->SmiConstant(Smi::kZero));
2381 assembler->Goto(&done); 2381 assembler->Goto(&done);
2382 } 2382 }
2383 2383
2384 assembler->Bind(&done); 2384 assembler->Bind(&done);
2385 length = var_length.value(); 2385 length = var_length.value();
2386 } 2386 }
2387 assembler->Assert(assembler->TaggedIsSmi(length)); 2387 CSA_ASSERT(assembler, assembler->TaggedIsSmi(length));
2388 assembler->Assert(assembler->TaggedIsSmi(index)); 2388 CSA_ASSERT(assembler, assembler->TaggedIsSmi(index));
2389 2389
2390 assembler->GotoUnless(assembler->SmiBelow(index, length), &set_done); 2390 assembler->GotoUnless(assembler->SmiBelow(index, length), &set_done);
2391 2391
2392 Node* one = assembler->SmiConstant(Smi::FromInt(1)); 2392 Node* one = assembler->SmiConstant(Smi::FromInt(1));
2393 assembler->StoreObjectFieldNoWriteBarrier( 2393 assembler->StoreObjectFieldNoWriteBarrier(
2394 iterator, JSArrayIterator::kNextIndexOffset, 2394 iterator, JSArrayIterator::kNextIndexOffset,
2395 assembler->IntPtrAdd(assembler->BitcastTaggedToWord(index), 2395 assembler->IntPtrAdd(assembler->BitcastTaggedToWord(index),
2396 assembler->BitcastTaggedToWord(one))); 2396 assembler->BitcastTaggedToWord(one)));
2397 var_done.Bind(assembler->FalseConstant()); 2397 var_done.Bind(assembler->FalseConstant());
2398 2398
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
2583 Runtime::kThrowIncompatibleMethodReceiver, context, 2583 Runtime::kThrowIncompatibleMethodReceiver, context,
2584 assembler->HeapConstant(assembler->factory()->NewStringFromAsciiChecked( 2584 assembler->HeapConstant(assembler->factory()->NewStringFromAsciiChecked(
2585 "Array Iterator.prototype.next", TENURED)), 2585 "Array Iterator.prototype.next", TENURED)),
2586 iterator); 2586 iterator);
2587 assembler->Return(result); 2587 assembler->Return(result);
2588 } 2588 }
2589 } 2589 }
2590 2590
2591 } // namespace internal 2591 } // namespace internal
2592 } // namespace v8 2592 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/builtins/builtins-regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698