| 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 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1603 f->Call(env->Global(), 0, NULL); | 1604 f->Call(env->Global(), 0, NULL); |
| 1604 CHECK_EQ(1, break_point_hit_count); | 1605 CHECK_EQ(1, break_point_hit_count); |
| 1605 | 1606 |
| 1606 ChangeScriptBreakPointIgnoreCountFromJS(sbp, 5); | 1607 ChangeScriptBreakPointIgnoreCountFromJS(sbp, 5); |
| 1607 break_point_hit_count = 0; | 1608 break_point_hit_count = 0; |
| 1608 for (int i = 0; i < 10; i++) { | 1609 for (int i = 0; i < 10; i++) { |
| 1609 f->Call(env->Global(), 0, NULL); | 1610 f->Call(env->Global(), 0, NULL); |
| 1610 } | 1611 } |
| 1611 CHECK_EQ(5, break_point_hit_count); | 1612 CHECK_EQ(5, break_point_hit_count); |
| 1612 | 1613 |
| 1614 // BUG(343): It should not really be necessary to clear the |
| 1615 // compilation cache here, but right now the debugger relies on the |
| 1616 // script being recompiled, not just fetched from the cache. |
| 1617 i::CompilationCache::Clear(); |
| 1618 |
| 1613 // Reload the script and get f again checking that the ignore survives. | 1619 // Reload the script and get f again checking that the ignore survives. |
| 1614 v8::Script::Compile(script, &origin)->Run(); | 1620 v8::Script::Compile(script, &origin)->Run(); |
| 1615 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f"))); | 1621 f = v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f"))); |
| 1616 | 1622 |
| 1617 break_point_hit_count = 0; | 1623 break_point_hit_count = 0; |
| 1618 for (int i = 0; i < 10; i++) { | 1624 for (int i = 0; i < 10; i++) { |
| 1619 f->Call(env->Global(), 0, NULL); | 1625 f->Call(env->Global(), 0, NULL); |
| 1620 } | 1626 } |
| 1621 CHECK_EQ(5, break_point_hit_count); | 1627 CHECK_EQ(5, break_point_hit_count); |
| 1622 | 1628 |
| (...skipping 2619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4242 bool allow_natives_syntax = i::FLAG_allow_natives_syntax; | 4248 bool allow_natives_syntax = i::FLAG_allow_natives_syntax; |
| 4243 i::FLAG_allow_natives_syntax = true; | 4249 i::FLAG_allow_natives_syntax = true; |
| 4244 CompileRun( | 4250 CompileRun( |
| 4245 "var scripts = %DebugGetLoadedScripts();" | 4251 "var scripts = %DebugGetLoadedScripts();" |
| 4246 "for (var i = 0; i < scripts.length; ++i) {" | 4252 "for (var i = 0; i < scripts.length; ++i) {" |
| 4247 " scripts[i].line_ends;" | 4253 " scripts[i].line_ends;" |
| 4248 "}"); | 4254 "}"); |
| 4249 // Must not crash while accessing line_ends. | 4255 // Must not crash while accessing line_ends. |
| 4250 i::FLAG_allow_natives_syntax = allow_natives_syntax; | 4256 i::FLAG_allow_natives_syntax = allow_natives_syntax; |
| 4251 } | 4257 } |
| OLD | NEW |