OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-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 12 matching lines...) Expand all Loading... |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include <stdlib.h> | 28 #include <stdlib.h> |
29 | 29 |
30 #include "v8.h" | 30 #include "v8.h" |
31 | 31 |
32 #include "api.h" | 32 #include "api.h" |
| 33 #include "compilation-cache.h" |
33 #include "debug.h" | 34 #include "debug.h" |
34 #include "platform.h" | 35 #include "platform.h" |
35 #include "stub-cache.h" | 36 #include "stub-cache.h" |
36 #include "cctest.h" | 37 #include "cctest.h" |
37 | 38 |
38 | 39 |
39 using ::v8::internal::EmbeddedVector; | 40 using ::v8::internal::EmbeddedVector; |
40 using ::v8::internal::Object; | 41 using ::v8::internal::Object; |
41 using ::v8::internal::OS; | 42 using ::v8::internal::OS; |
42 using ::v8::internal::Handle; | 43 using ::v8::internal::Handle; |
(...skipping 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1671 f->Call(env->Global(), 0, NULL); | 1672 f->Call(env->Global(), 0, NULL); |
1672 CHECK_EQ(1, break_point_hit_count); | 1673 CHECK_EQ(1, break_point_hit_count); |
1673 | 1674 |
1674 ChangeScriptBreakPointIgnoreCountFromJS(sbp, 5); | 1675 ChangeScriptBreakPointIgnoreCountFromJS(sbp, 5); |
1675 break_point_hit_count = 0; | 1676 break_point_hit_count = 0; |
1676 for (int i = 0; i < 10; i++) { | 1677 for (int i = 0; i < 10; i++) { |
1677 f->Call(env->Global(), 0, NULL); | 1678 f->Call(env->Global(), 0, NULL); |
1678 } | 1679 } |
1679 CHECK_EQ(5, break_point_hit_count); | 1680 CHECK_EQ(5, break_point_hit_count); |
1680 | 1681 |
| 1682 // BUG(343): It should not really be necessary to clear the |
| 1683 // compilation cache here, but right now the debugger relies on the |
| 1684 // script being recompiled, not just fetched from the cache. |
| 1685 i::CompilationCache::Clear(); |
| 1686 |
1681 // Reload the script and get f again checking that the ignore survives. | 1687 // Reload the script and get f again checking that the ignore survives. |
1682 v8::Script::Compile(script, &origin)->Run(); | 1688 v8::Script::Compile(script, &origin)->Run(); |
1683 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f"))); | 1689 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f"))); |
1684 | 1690 |
1685 break_point_hit_count = 0; | 1691 break_point_hit_count = 0; |
1686 for (int i = 0; i < 10; i++) { | 1692 for (int i = 0; i < 10; i++) { |
1687 f->Call(env->Global(), 0, NULL); | 1693 f->Call(env->Global(), 0, NULL); |
1688 } | 1694 } |
1689 CHECK_EQ(5, break_point_hit_count); | 1695 CHECK_EQ(5, break_point_hit_count); |
1690 | 1696 |
(...skipping 2982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4673 v8::Context::Scope context_scope(context_2); | 4679 v8::Context::Scope context_scope(context_2); |
4674 expected_context = context_2; | 4680 expected_context = context_2; |
4675 expected_context_data = data_2; | 4681 expected_context_data = data_2; |
4676 v8::Local<v8::Function> f = CompileFunction(source, "f"); | 4682 v8::Local<v8::Function> f = CompileFunction(source, "f"); |
4677 f->Call(context_2->Global(), 0, NULL); | 4683 f->Call(context_2->Global(), 0, NULL); |
4678 } | 4684 } |
4679 | 4685 |
4680 // Two times compile event and two times break event. | 4686 // Two times compile event and two times break event. |
4681 CHECK_GT(message_handler_hit_count, 4); | 4687 CHECK_GT(message_handler_hit_count, 4); |
4682 } | 4688 } |
OLD | NEW |