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

Side by Side Diff: src/isolate.h

Issue 11362007: Correctly check for stack overflow even when interrupt is pending. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: split tests. Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/json-parser-recursive.js » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after
1388 }; 1388 };
1389 1389
1390 1390
1391 // Support for checking for stack-overflows in C++ code. 1391 // Support for checking for stack-overflows in C++ code.
1392 class StackLimitCheck BASE_EMBEDDED { 1392 class StackLimitCheck BASE_EMBEDDED {
1393 public: 1393 public:
1394 explicit StackLimitCheck(Isolate* isolate) : isolate_(isolate) { } 1394 explicit StackLimitCheck(Isolate* isolate) : isolate_(isolate) { }
1395 1395
1396 bool HasOverflowed() const { 1396 bool HasOverflowed() const {
1397 StackGuard* stack_guard = isolate_->stack_guard(); 1397 StackGuard* stack_guard = isolate_->stack_guard();
1398 // Stack has overflowed in C++ code only if stack pointer exceeds the C++ 1398 return (reinterpret_cast<uintptr_t>(this) < stack_guard->real_climit());
1399 // stack guard and the limits are not set to interrupt values.
1400 // TODO(214): Stack overflows are ignored if a interrupt is pending. This
1401 // code should probably always use the initial C++ limit.
1402 return (reinterpret_cast<uintptr_t>(this) < stack_guard->climit()) &&
1403 stack_guard->IsStackOverflow();
1404 } 1399 }
1405 private: 1400 private:
1406 Isolate* isolate_; 1401 Isolate* isolate_;
1407 }; 1402 };
1408 1403
1409 1404
1410 // Support for temporarily postponing interrupts. When the outermost 1405 // Support for temporarily postponing interrupts. When the outermost
1411 // postpone scope is left the interrupts will be re-enabled and any 1406 // postpone scope is left the interrupts will be re-enabled and any
1412 // interrupts that occurred while in the scope will be taken into 1407 // interrupts that occurred while in the scope will be taken into
1413 // account. 1408 // account.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1445 1440
1446 // Mark the native context with out of memory. 1441 // Mark the native context with out of memory.
1447 inline void Context::mark_out_of_memory() { 1442 inline void Context::mark_out_of_memory() {
1448 native_context()->set_out_of_memory(HEAP->true_value()); 1443 native_context()->set_out_of_memory(HEAP->true_value());
1449 } 1444 }
1450 1445
1451 1446
1452 } } // namespace v8::internal 1447 } } // namespace v8::internal
1453 1448
1454 #endif // V8_ISOLATE_H_ 1449 #endif // V8_ISOLATE_H_
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/json-parser-recursive.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698