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 19516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19527 explicit InitDefaultIsolateThread(TestCase testCase) | 19527 explicit InitDefaultIsolateThread(TestCase testCase) |
19528 : Thread("InitDefaultIsolateThread"), | 19528 : Thread("InitDefaultIsolateThread"), |
19529 testCase_(testCase), | 19529 testCase_(testCase), |
19530 result_(false) { } | 19530 result_(false) { } |
19531 | 19531 |
19532 void Run() { | 19532 void Run() { |
19533 v8::Isolate* isolate = v8::Isolate::New(); | 19533 v8::Isolate* isolate = v8::Isolate::New(); |
19534 isolate->Enter(); | 19534 isolate->Enter(); |
19535 switch (testCase_) { | 19535 switch (testCase_) { |
19536 case SetResourceConstraints: { | 19536 case SetResourceConstraints: { |
19537 static const int K = 1024; | |
19538 v8::ResourceConstraints constraints; | 19537 v8::ResourceConstraints constraints; |
19539 constraints.set_max_new_space_size(2 * K * K); | 19538 constraints.set_max_semi_space_size(1); |
19540 constraints.set_max_old_space_size(4 * K * K); | 19539 constraints.set_max_old_space_size(4); |
19541 v8::SetResourceConstraints(CcTest::isolate(), &constraints); | 19540 v8::SetResourceConstraints(CcTest::isolate(), &constraints); |
19542 break; | 19541 break; |
19543 } | 19542 } |
19544 | 19543 |
19545 case SetFatalHandler: | 19544 case SetFatalHandler: |
19546 v8::V8::SetFatalErrorHandler(NULL); | 19545 v8::V8::SetFatalErrorHandler(NULL); |
19547 break; | 19546 break; |
19548 | 19547 |
19549 case SetCounterFunction: | 19548 case SetCounterFunction: |
19550 v8::V8::SetCounterFunction(NULL); | 19549 v8::V8::SetCounterFunction(NULL); |
(...skipping 2965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22516 v8::internal::FLAG_stack_size = 150; | 22515 v8::internal::FLAG_stack_size = 150; |
22517 LocalContext current; | 22516 LocalContext current; |
22518 v8::Isolate* isolate = current->GetIsolate(); | 22517 v8::Isolate* isolate = current->GetIsolate(); |
22519 v8::HandleScope scope(isolate); | 22518 v8::HandleScope scope(isolate); |
22520 V8::SetCaptureStackTraceForUncaughtExceptions( | 22519 V8::SetCaptureStackTraceForUncaughtExceptions( |
22521 true, 10, v8::StackTrace::kDetailed); | 22520 true, 10, v8::StackTrace::kDetailed); |
22522 v8::TryCatch try_catch; | 22521 v8::TryCatch try_catch; |
22523 CompileRun("(function f(x) { f(x+1); })(0)"); | 22522 CompileRun("(function f(x) { f(x+1); })(0)"); |
22524 CHECK(try_catch.HasCaught()); | 22523 CHECK(try_catch.HasCaught()); |
22525 } | 22524 } |
OLD | NEW |