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

Unified Diff: src/builtins/builtins-string.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/builtins-regexp.cc ('k') | src/code-stub-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-string.cc
diff --git a/src/builtins/builtins-string.cc b/src/builtins/builtins-string.cc
index f210b8d9b4e666001a000d132a77c4ea35e0b096..6450a9d1f23f2f2c1767bfceb7c58c72b8c54893 100644
--- a/src/builtins/builtins-string.cc
+++ b/src/builtins/builtins-string.cc
@@ -1001,8 +1001,8 @@ void Builtins::Generate_StringPrototypeSubstr(CodeStubAssembler* a) {
// two cases according to the spec: if it is negative, "" is returned; if
// it is positive, then length is set to {string_length} - {start}.
- a->Assert(a->WordEqual(a->LoadMap(var_length.value()),
- a->HeapNumberMapConstant()));
+ CSA_ASSERT(a, a->WordEqual(a->LoadMap(var_length.value()),
+ a->HeapNumberMapConstant()));
Label if_isnegative(a), if_ispositive(a);
Node* const float_zero = a->Float64Constant(0.);
@@ -1071,7 +1071,8 @@ compiler::Node* ToSmiBetweenZeroAnd(CodeStubAssembler* a,
a->Bind(&if_isnotsmi);
{
// {value} is a heap number - in this case, it is definitely out of bounds.
- a->Assert(a->WordEqual(a->LoadMap(value_int), a->HeapNumberMapConstant()));
+ CSA_ASSERT(a,
+ a->WordEqual(a->LoadMap(value_int), a->HeapNumberMapConstant()));
Node* const float_zero = a->Float64Constant(0.);
Node* const smi_zero = a->SmiConstant(Smi::kZero);
@@ -1301,17 +1302,16 @@ compiler::Node* LoadSurrogatePairInternal(CodeStubAssembler* assembler,
{
Node* lead = var_result.value();
Node* trail = var_trail.value();
-#ifdef ENABLE_SLOW_DCHECKS
+
// Check that this path is only taken if a surrogate pair is found
- assembler->Assert(assembler->Uint32GreaterThanOrEqual(
- lead, assembler->Int32Constant(0xD800)));
- assembler->Assert(
- assembler->Uint32LessThan(lead, assembler->Int32Constant(0xDC00)));
- assembler->Assert(assembler->Uint32GreaterThanOrEqual(
- trail, assembler->Int32Constant(0xDC00)));
- assembler->Assert(
- assembler->Uint32LessThan(trail, assembler->Int32Constant(0xE000)));
-#endif
+ CSA_SLOW_ASSERT(assembler, assembler->Uint32GreaterThanOrEqual(
+ lead, assembler->Int32Constant(0xD800)));
+ CSA_SLOW_ASSERT(assembler, assembler->Uint32LessThan(
+ lead, assembler->Int32Constant(0xDC00)));
+ CSA_SLOW_ASSERT(assembler, assembler->Uint32GreaterThanOrEqual(
+ trail, assembler->Int32Constant(0xDC00)));
+ CSA_SLOW_ASSERT(assembler, assembler->Uint32LessThan(
+ trail, assembler->Int32Constant(0xE000)));
switch (encoding) {
case UnicodeEncoding::UTF16:
« no previous file with comments | « src/builtins/builtins-regexp.cc ('k') | src/code-stub-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698