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

Unified Diff: src/code-stub-assembler.cc

Issue 2414373002: Revert of Improve CodeStubAssembler assert functionality (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/code-stub-assembler.h ('k') | src/runtime/runtime-test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index 294f39285ea8a365780f4df1a8490d23943d54c6..6672b15728ffb55be1a26e54ebad3e357d7114a1 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -26,28 +26,11 @@
const char* name)
: compiler::CodeAssembler(isolate, zone, parameter_count, flags, name) {}
-void CodeStubAssembler::Assert(Node* condition, const char* message,
- const char* file, int line) {
+void CodeStubAssembler::Assert(Node* condition) {
#if defined(DEBUG)
Label ok(this);
- Vector<char> buffer(Vector<char>::New(1024));
- if (message != nullptr && FLAG_code_comments) {
- Comment("[ Assert: %s", message);
- } else {
- Comment("[ Assert ");
- }
-
+ Comment("[ Assert");
GotoIf(condition, &ok);
- if (message != nullptr) {
- if (file != nullptr) {
- SNPrintF(buffer, "CSA_ASSERT failed: %s [%s:%d]\n", message, file, line);
- } else {
- SNPrintF(buffer, "CSA_ASSERT failed: %s\n", message);
- }
- CallRuntime(
- Runtime::kGlobalPrint, SmiConstant(Smi::kZero),
- HeapConstant(factory()->NewStringFromAsciiChecked(&(buffer[0]))));
- }
DebugBreak();
Goto(&ok);
Bind(&ok);
@@ -920,8 +903,7 @@
void CodeStubAssembler::AssertInstanceType(Node* object,
InstanceType instance_type) {
- CSA_ASSERT(
- Word32Equal(LoadInstanceType(object), Int32Constant(instance_type)));
+ Assert(Word32Equal(LoadInstanceType(object), Int32Constant(instance_type)));
}
Node* CodeStubAssembler::LoadProperties(Node* object) {
@@ -981,8 +963,8 @@
Node* CodeStubAssembler::LoadMapInobjectProperties(Node* map) {
// See Map::GetInObjectProperties() for details.
STATIC_ASSERT(LAST_JS_OBJECT_TYPE == LAST_TYPE);
- CSA_ASSERT(Int32GreaterThanOrEqual(LoadMapInstanceType(map),
- Int32Constant(FIRST_JS_OBJECT_TYPE)));
+ Assert(Int32GreaterThanOrEqual(LoadMapInstanceType(map),
+ Int32Constant(FIRST_JS_OBJECT_TYPE)));
return ChangeUint32ToWord(LoadObjectField(
map, Map::kInObjectPropertiesOrConstructorFunctionIndexOffset,
MachineType::Uint8()));
@@ -991,8 +973,8 @@
Node* CodeStubAssembler::LoadMapConstructorFunctionIndex(Node* map) {
// See Map::GetConstructorFunctionIndex() for details.
STATIC_ASSERT(FIRST_PRIMITIVE_TYPE == FIRST_TYPE);
- CSA_ASSERT(Int32LessThanOrEqual(LoadMapInstanceType(map),
- Int32Constant(LAST_PRIMITIVE_TYPE)));
+ Assert(Int32LessThanOrEqual(LoadMapInstanceType(map),
+ Int32Constant(LAST_PRIMITIVE_TYPE)));
return ChangeUint32ToWord(LoadObjectField(
map, Map::kInObjectPropertiesOrConstructorFunctionIndexOffset,
MachineType::Uint8()));
@@ -1406,7 +1388,7 @@
Node* index, Node* input) {
Node* const max_length =
SmiConstant(Smi::FromInt(JSArray::kInitialMaxFastElementArray));
- CSA_ASSERT(SmiLessThanOrEqual(length, max_length));
+ Assert(SmiLessThanOrEqual(length, max_length));
// Allocate the JSRegExpResult.
// TODO(jgruber): Fold JSArray and FixedArray allocations, then remove
@@ -3176,8 +3158,8 @@
Node* CodeStubAssembler::NonNumberToNumber(Node* context, Node* input) {
// Assert input is a HeapObject (not smi or heap number)
- CSA_ASSERT(Word32BinaryNot(TaggedIsSmi(input)));
- CSA_ASSERT(Word32NotEqual(LoadMap(input), HeapNumberMapConstant()));
+ Assert(Word32BinaryNot(TaggedIsSmi(input)));
+ Assert(Word32NotEqual(LoadMap(input), HeapNumberMapConstant()));
// We might need to loop once here due to ToPrimitive conversions.
Variable var_input(this, MachineRepresentation::kTagged);
@@ -3639,7 +3621,7 @@
Node* bit_field = LoadMapBitField(map);
Node* mask = Int32Constant(1 << Map::kHasNamedInterceptor |
1 << Map::kIsAccessCheckNeeded);
- CSA_ASSERT(Word32Equal(Word32And(bit_field, mask), Int32Constant(0)));
+ Assert(Word32Equal(Word32And(bit_field, mask), Int32Constant(0)));
Node* bit_field3 = LoadMapBitField3(map);
Node* bit = BitFieldDecode<Map::DictionaryMap>(bit_field3);
@@ -4054,7 +4036,7 @@
{
AssertInstanceType(object, JS_VALUE_TYPE);
Node* string = LoadJSValueValue(object);
- CSA_ASSERT(IsStringInstanceType(LoadInstanceType(string)));
+ Assert(IsStringInstanceType(LoadInstanceType(string)));
Node* length = LoadStringLength(string);
GotoIf(UintPtrLessThan(intptr_index, SmiUntag(length)), if_found);
Goto(&if_isobjectorsmi);
@@ -4063,7 +4045,7 @@
{
AssertInstanceType(object, JS_VALUE_TYPE);
Node* string = LoadJSValueValue(object);
- CSA_ASSERT(IsStringInstanceType(LoadInstanceType(string)));
+ Assert(IsStringInstanceType(LoadInstanceType(string)));
Node* length = LoadStringLength(string);
GotoIf(UintPtrLessThan(intptr_index, SmiUntag(length)), if_found);
Goto(&if_isdictionary);
@@ -4494,7 +4476,7 @@
STATIC_ASSERT(StubCache::kCacheIndexShift == Name::kHashShift);
// Compute the hash of the name (use entire hash field).
Node* hash_field = LoadNameHashField(name);
- CSA_ASSERT(Word32Equal(
+ Assert(Word32Equal(
Word32And(hash_field, Int32Constant(Name::kHashNotComputedMask)),
Int32Constant(0)));
@@ -4975,10 +4957,10 @@
LoadWeakCellValue(LoadObjectField(handler, Tuple3::kValue2Offset));
// The |holder| is guaranteed to be alive at this point since we passed
// both the receiver map check and the validity cell check.
- CSA_ASSERT(WordNotEqual(holder, IntPtrConstant(0)));
+ Assert(WordNotEqual(holder, IntPtrConstant(0)));
Node* smi_handler = LoadObjectField(handler, Tuple3::kValue3Offset);
- CSA_ASSERT(TaggedIsSmi(smi_handler));
+ Assert(TaggedIsSmi(smi_handler));
var_holder.Bind(holder);
var_smi_handler.Bind(smi_handler);
@@ -5362,9 +5344,8 @@
FixedArrayBase::GetMaxLengthForNewSpaceAllocation(kind));
// The size of a new properties backing store is guaranteed to be small
// enough that the new backing store will be allocated in new space.
- CSA_ASSERT(UintPtrLessThan(
- new_capacity,
- IntPtrConstant(kMaxNumberOfDescriptors + JSObject::kFieldsAdded)));
+ Assert(UintPtrLessThan(new_capacity, IntPtrConstant(kMaxNumberOfDescriptors +
+ JSObject::kFieldsAdded)));
Node* new_properties = AllocateFixedArray(kind, new_capacity, mode);
@@ -5511,7 +5492,7 @@
Bind(&if_mapped);
{
- CSA_ASSERT(TaggedIsSmi(mapped_index));
+ Assert(TaggedIsSmi(mapped_index));
mapped_index = SmiUntag(mapped_index);
Node* the_context = LoadFixedArrayElement(elements, IntPtrConstant(0), 0,
INTPTR_PARAMETERS);
@@ -5523,7 +5504,7 @@
if (is_load) {
Node* result = LoadFixedArrayElement(the_context, mapped_index, 0,
INTPTR_PARAMETERS);
- CSA_ASSERT(WordNotEqual(result, TheHoleConstant()));
+ Assert(WordNotEqual(result, TheHoleConstant()));
var_result.Bind(result);
} else {
StoreFixedArrayElement(the_context, mapped_index, value,
@@ -7387,7 +7368,7 @@
SIMD128_TYPES(SIMD128_BRANCH)
#undef SIMD128_BRANCH
- CSA_ASSERT(Word32Equal(instance_type, Int32Constant(SYMBOL_TYPE)));
+ Assert(Word32Equal(instance_type, Int32Constant(SYMBOL_TYPE)));
result_var.Bind(HeapConstant(isolate()->factory()->symbol_string()));
Goto(&return_result);
« no previous file with comments | « src/code-stub-assembler.h ('k') | src/runtime/runtime-test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698