| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |