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 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1270 static void TestBreakPointSurviveGC(bool force_compaction) { | 1270 static void TestBreakPointSurviveGC(bool force_compaction) { |
1271 break_point_hit_count = 0; | 1271 break_point_hit_count = 0; |
1272 v8::HandleScope scope; | 1272 v8::HandleScope scope; |
1273 DebugLocalContext env; | 1273 DebugLocalContext env; |
1274 | 1274 |
1275 v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount, | 1275 v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount, |
1276 v8::Undefined()); | 1276 v8::Undefined()); |
1277 v8::Local<v8::Function> foo; | 1277 v8::Local<v8::Function> foo; |
1278 | 1278 |
1279 // Test IC store break point with garbage collection. | 1279 // Test IC store break point with garbage collection. |
1280 foo = CompileFunction(&env, "function foo(){bar=0;}", "foo"); | 1280 { |
1281 SetBreakPoint(foo, 0); | 1281 v8::Local<v8::Function> bar = |
1282 CompileFunction(&env, "function foo(){}", "foo"); | |
1283 foo = CompileFunction(&env, "function foo(){bar=0;}", "foo"); | |
1284 SetBreakPoint(foo, 0); | |
1285 } | |
1282 CallAndGC(env->Global(), foo, force_compaction); | 1286 CallAndGC(env->Global(), foo, force_compaction); |
1283 | 1287 |
1284 // Test IC load break point with garbage collection. | 1288 // Test IC load break point with garbage collection. |
1285 foo = CompileFunction(&env, "bar=1;function foo(){var x=bar;}", "foo"); | 1289 { |
1286 SetBreakPoint(foo, 0); | 1290 v8::Local<v8::Function> bar = |
1291 CompileFunction(&env, "function foo(){}", "foo"); | |
1292 foo = CompileFunction(&env, "bar=1;function foo(){var x=bar;}", "foo"); | |
1293 SetBreakPoint(foo, 0); | |
1294 } | |
1287 CallAndGC(env->Global(), foo, force_compaction); | 1295 CallAndGC(env->Global(), foo, force_compaction); |
1288 | 1296 |
1289 // Test IC call break point with garbage collection. | 1297 // Test IC call break point with garbage collection. |
1290 foo = CompileFunction(&env, "function bar(){};function foo(){bar();}", "foo"); | 1298 { |
1291 SetBreakPoint(foo, 0); | 1299 v8::Local<v8::Function> bar = |
1300 CompileFunction(&env, "function foo(){}", "foo"); | |
1301 foo = CompileFunction(&env, "function bar(){};function foo(){bar();}", "foo" ); | |
Søren Thygesen Gjesse
2010/08/05 13:26:30
Long line.
| |
1302 SetBreakPoint(foo, 0); | |
1303 } | |
1292 CallAndGC(env->Global(), foo, force_compaction); | 1304 CallAndGC(env->Global(), foo, force_compaction); |
1293 | 1305 |
1294 // Test return break point with garbage collection. | 1306 // Test return break point with garbage collection. |
1295 foo = CompileFunction(&env, "function foo(){}", "foo"); | 1307 { |
1296 SetBreakPoint(foo, 0); | 1308 v8::Local<v8::Function> bar = |
1309 CompileFunction(&env, "function foo(){}", "foo"); | |
1310 foo = CompileFunction(&env, "function foo(){}", "foo"); | |
1311 SetBreakPoint(foo, 0); | |
1312 } | |
1297 CallAndGC(env->Global(), foo, force_compaction); | 1313 CallAndGC(env->Global(), foo, force_compaction); |
1298 | 1314 |
1315 // Test non IC break point with garbage collection. | |
1316 { | |
1317 v8::Local<v8::Function> bar = | |
1318 CompileFunction(&env, "function foo(){}", "foo"); | |
1319 foo = CompileFunction(&env, "function foo(){var bar=0;}", "foo"); | |
1320 SetBreakPoint(foo, 0); | |
1321 } | |
1322 CallAndGC(env->Global(), foo, force_compaction); | |
1323 | |
1324 | |
1299 v8::Debug::SetDebugEventListener(NULL); | 1325 v8::Debug::SetDebugEventListener(NULL); |
1300 CheckDebuggerUnloaded(); | 1326 CheckDebuggerUnloaded(); |
1301 } | 1327 } |
1302 | 1328 |
1303 | 1329 |
1304 // Test that a break point can be set at a return store location. | 1330 // Test that a break point can be set at a return store location. |
1305 TEST(BreakPointSurviveGC) { | 1331 TEST(BreakPointSurviveGC) { |
1306 TestBreakPointSurviveGC(false); | 1332 TestBreakPointSurviveGC(false); |
1307 TestBreakPointSurviveGC(true); | 1333 TestBreakPointSurviveGC(true); |
1308 } | 1334 } |
(...skipping 5408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6717 | 6743 |
6718 CHECK_EQ(2, TestClientData::constructor_call_counter); | 6744 CHECK_EQ(2, TestClientData::constructor_call_counter); |
6719 CHECK_EQ(TestClientData::constructor_call_counter, | 6745 CHECK_EQ(TestClientData::constructor_call_counter, |
6720 TestClientData::destructor_call_counter); | 6746 TestClientData::destructor_call_counter); |
6721 | 6747 |
6722 v8::Debug::SetDebugEventListener(NULL); | 6748 v8::Debug::SetDebugEventListener(NULL); |
6723 CheckDebuggerUnloaded(); | 6749 CheckDebuggerUnloaded(); |
6724 } | 6750 } |
6725 | 6751 |
6726 #endif // ENABLE_DEBUGGER_SUPPORT | 6752 #endif // ENABLE_DEBUGGER_SUPPORT |
OLD | NEW |