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

Side by Side Diff: src/top.cc

Issue 12826: RegExp stack and zone limits. (Closed)
Patch Set: Created 12 years 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
« src/parser.cc ('K') | « src/top.h ('k') | src/zone.h » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 VMState state(OTHER); 596 VMState state(OTHER);
597 result = callback(v8::Utils::ToLocal(receiver_handle), 597 result = callback(v8::Utils::ToLocal(receiver_handle),
598 index, 598 index,
599 type, 599 type,
600 v8::Utils::ToLocal(data)); 600 v8::Utils::ToLocal(data));
601 } 601 }
602 return result; 602 return result;
603 } 603 }
604 604
605 605
606 const char* Top::kStackOverflowMessage =
607 "Uncaught RangeError: Maximum call stack size exceeded";
608
609
606 Failure* Top::StackOverflow() { 610 Failure* Top::StackOverflow() {
607 HandleScope scope; 611 HandleScope scope;
608 Handle<String> key = Factory::stack_overflow_symbol(); 612 Handle<String> key = Factory::stack_overflow_symbol();
609 Handle<JSObject> boilerplate = 613 Handle<JSObject> boilerplate =
610 Handle<JSObject>::cast(GetProperty(Top::builtins(), key)); 614 Handle<JSObject>::cast(GetProperty(Top::builtins(), key));
611 Handle<Object> exception = Copy(boilerplate); 615 Handle<Object> exception = Copy(boilerplate);
612 // TODO(1240995): To avoid having to call JavaScript code to compute 616 // TODO(1240995): To avoid having to call JavaScript code to compute
613 // the message for stack overflow exceptions which is very likely to 617 // the message for stack overflow exceptions which is very likely to
614 // double fault with another stack overflow exception, we use a 618 // double fault with another stack overflow exception, we use a
615 // precomputed message. This is somewhat problematic in that it 619 // precomputed message. This is somewhat problematic in that it
616 // doesn't use ReportUncaughtException to determine the location 620 // doesn't use ReportUncaughtException to determine the location
617 // from where the exception occurred. It should probably be 621 // from where the exception occurred. It should probably be
618 // reworked. 622 // reworked.
619 static const char* kMessage = 623 DoThrow(*exception, NULL, kStackOverflowMessage);
620 "Uncaught RangeError: Maximum call stack size exceeded";
621 DoThrow(*exception, NULL, kMessage);
622 return Failure::Exception(); 624 return Failure::Exception();
623 } 625 }
624 626
625 627
626 Failure* Top::Throw(Object* exception, MessageLocation* location) { 628 Failure* Top::Throw(Object* exception, MessageLocation* location) {
627 DoThrow(exception, location, NULL); 629 DoThrow(exception, location, NULL);
628 return Failure::Exception(); 630 return Failure::Exception();
629 } 631 }
630 632
631 633
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 Top::break_access_->Lock(); 919 Top::break_access_->Lock();
918 } 920 }
919 921
920 922
921 ExecutionAccess::~ExecutionAccess() { 923 ExecutionAccess::~ExecutionAccess() {
922 Top::break_access_->Unlock(); 924 Top::break_access_->Unlock();
923 } 925 }
924 926
925 927
926 } } // namespace v8::internal 928 } } // namespace v8::internal
OLDNEW
« src/parser.cc ('K') | « src/top.h ('k') | src/zone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698