OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 13496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13507 Local<Script> script = v8_compile("(function () {" | 13507 Local<Script> script = v8_compile("(function () {" |
13508 " unlock_for_a_moment();" | 13508 " unlock_for_a_moment();" |
13509 " return 42;" | 13509 " return 42;" |
13510 "})();"); | 13510 "})();"); |
13511 CHECK_EQ(42, script->Run()->Int32Value()); | 13511 CHECK_EQ(42, script->Run()->Int32Value()); |
13512 } | 13512 } |
13513 } | 13513 } |
13514 | 13514 |
13515 | 13515 |
13516 static int GetGlobalObjectsCount() { | 13516 static int GetGlobalObjectsCount() { |
13517 CcTest::heap()->EnsureHeapIsIterable(); | |
13518 int count = 0; | 13517 int count = 0; |
13519 i::HeapIterator it(CcTest::heap()); | 13518 i::HeapIterator it(CcTest::heap()); |
13520 for (i::HeapObject* object = it.next(); object != NULL; object = it.next()) | 13519 for (i::HeapObject* object = it.next(); object != NULL; object = it.next()) |
13521 if (object->IsJSGlobalObject()) count++; | 13520 if (object->IsJSGlobalObject()) count++; |
13522 return count; | 13521 return count; |
13523 } | 13522 } |
13524 | 13523 |
13525 | 13524 |
13526 static void CheckSurvivingGlobalObjectsCount(int expected) { | 13525 static void CheckSurvivingGlobalObjectsCount(int expected) { |
13527 // We need to collect all garbage twice to be sure that everything | 13526 // We need to collect all garbage twice to be sure that everything |
(...skipping 9079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22607 v8::internal::FLAG_stack_size = 150; | 22606 v8::internal::FLAG_stack_size = 150; |
22608 LocalContext current; | 22607 LocalContext current; |
22609 v8::Isolate* isolate = current->GetIsolate(); | 22608 v8::Isolate* isolate = current->GetIsolate(); |
22610 v8::HandleScope scope(isolate); | 22609 v8::HandleScope scope(isolate); |
22611 V8::SetCaptureStackTraceForUncaughtExceptions( | 22610 V8::SetCaptureStackTraceForUncaughtExceptions( |
22612 true, 10, v8::StackTrace::kDetailed); | 22611 true, 10, v8::StackTrace::kDetailed); |
22613 v8::TryCatch try_catch; | 22612 v8::TryCatch try_catch; |
22614 CompileRun("(function f(x) { f(x+1); })(0)"); | 22613 CompileRun("(function f(x) { f(x+1); })(0)"); |
22615 CHECK(try_catch.HasCaught()); | 22614 CHECK(try_catch.HasCaught()); |
22616 } | 22615 } |
OLD | NEW |