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

Unified Diff: src/arm64/macro-assembler-arm64-inl.h

Issue 1565193002: [arm64] Add assertions to Claim and Drop. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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/arm64/macro-assembler-arm64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/macro-assembler-arm64-inl.h
diff --git a/src/arm64/macro-assembler-arm64-inl.h b/src/arm64/macro-assembler-arm64-inl.h
index d567f97c2dc5c2fb544b33f9820c66648ba0c68b..60418ad8394dcd78667d80e91eceffb0a1703c67 100644
--- a/src/arm64/macro-assembler-arm64-inl.h
+++ b/src/arm64/macro-assembler-arm64-inl.h
@@ -1462,7 +1462,8 @@ void MacroAssembler::Push(Handle<Object> handle) {
}
-void MacroAssembler::Claim(uint64_t count, uint64_t unit_size) {
+void MacroAssembler::Claim(int64_t count, uint64_t unit_size) {
+ DCHECK(count >= 0);
uint64_t size = count * unit_size;
if (size == 0) {
@@ -1490,6 +1491,7 @@ void MacroAssembler::Claim(const Register& count, uint64_t unit_size) {
return;
}
+ AssertPositiveOrZero(count);
if (!csp.Is(StackPointer())) {
BumpSystemStackPointer(size);
}
@@ -1517,7 +1519,8 @@ void MacroAssembler::ClaimBySMI(const Register& count_smi, uint64_t unit_size) {
}
-void MacroAssembler::Drop(uint64_t count, uint64_t unit_size) {
+void MacroAssembler::Drop(int64_t count, uint64_t unit_size) {
+ DCHECK(count >= 0);
uint64_t size = count * unit_size;
if (size == 0) {
@@ -1548,6 +1551,7 @@ void MacroAssembler::Drop(const Register& count, uint64_t unit_size) {
return;
}
+ AssertPositiveOrZero(count);
Add(StackPointer(), StackPointer(), size);
if (!csp.Is(StackPointer()) && emit_debug_code()) {
« no previous file with comments | « src/arm64/macro-assembler-arm64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698