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

Unified Diff: src/arm64/full-codegen-arm64.cc

Issue 339883002: Interrupts must not mask stack overflow. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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/arm/regexp-macro-assembler-arm.cc ('k') | src/arm64/regexp-macro-assembler-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/full-codegen-arm64.cc
diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc
index b74a0583fd11de71a6ea6e9f7d59e3704ee1c889..4a44e35b05d030e4f156db4ba6c2e1b08db979a8 100644
--- a/src/arm64/full-codegen-arm64.cc
+++ b/src/arm64/full-codegen-arm64.cc
@@ -87,29 +87,6 @@ class JumpPatchSite BASE_EMBEDDED {
};
-static void EmitStackCheck(MacroAssembler* masm_,
- int pointers = 0,
- Register scratch = jssp) {
- Isolate* isolate = masm_->isolate();
- Label ok;
- ASSERT(jssp.Is(__ StackPointer()));
- ASSERT(scratch.Is(jssp) == (pointers == 0));
- Heap::RootListIndex index;
- if (pointers != 0) {
- __ Sub(scratch, jssp, pointers * kPointerSize);
- index = Heap::kRealStackLimitRootIndex;
- } else {
- index = Heap::kStackLimitRootIndex;
- }
- __ CompareRoot(scratch, index);
- __ B(hs, &ok);
- PredictableCodeSizeScope predictable(masm_,
- Assembler::kCallSizeWithRelocation);
- __ Call(isolate->builtins()->StackCheck(), RelocInfo::CODE_TARGET);
- __ Bind(&ok);
-}
-
-
// Generate code for a JS function. On entry to the function the receiver
// and arguments have been pushed on the stack left to right. The actual
// argument count matches the formal parameter count expected by the
@@ -181,7 +158,13 @@ void FullCodeGenerator::Generate() {
if (locals_count > 0) {
if (locals_count >= 128) {
- EmitStackCheck(masm_, locals_count, x10);
+ Label ok;
+ ASSERT(jssp.Is(__ StackPointer()));
+ __ Sub(x10, jssp, locals_count * kPointerSize);
+ __ CompareRoot(x10, Heap::kRealStackLimitRootIndex);
+ __ B(hs, &ok);
+ __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION);
+ __ Bind(&ok);
}
__ LoadRoot(x10, Heap::kUndefinedValueRootIndex);
if (FLAG_optimize_for_size) {
@@ -319,7 +302,14 @@ void FullCodeGenerator::Generate() {
{ Comment cmnt(masm_, "[ Stack check");
PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS);
- EmitStackCheck(masm_);
+ Label ok;
+ ASSERT(jssp.Is(__ StackPointer()));
+ __ CompareRoot(jssp, Heap::kStackLimitRootIndex);
+ __ B(hs, &ok);
+ PredictableCodeSizeScope predictable(masm_,
+ Assembler::kCallSizeWithRelocation);
+ __ Call(isolate()->builtins()->StackCheck(), RelocInfo::CODE_TARGET);
+ __ Bind(&ok);
}
{ Comment cmnt(masm_, "[ Body");
« no previous file with comments | « src/arm/regexp-macro-assembler-arm.cc ('k') | src/arm64/regexp-macro-assembler-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698