| 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 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 } | 928 } |
| 929 | 929 |
| 930 | 930 |
| 931 TEST(EmptyHandleEscapeFrom) { | 931 TEST(EmptyHandleEscapeFrom) { |
| 932 CcTest::InitializeVM(); | 932 CcTest::InitializeVM(); |
| 933 | 933 |
| 934 v8::HandleScope scope(CcTest::isolate()); | 934 v8::HandleScope scope(CcTest::isolate()); |
| 935 Handle<JSObject> runaway; | 935 Handle<JSObject> runaway; |
| 936 | 936 |
| 937 { | 937 { |
| 938 v8::HandleScope nested(CcTest::isolate()); | 938 v8::EscapableHandleScope nested(CcTest::isolate()); |
| 939 Handle<JSObject> empty; | 939 Handle<JSObject> empty; |
| 940 runaway = empty.EscapeFrom(&nested); | 940 runaway = empty.EscapeFrom(&nested); |
| 941 } | 941 } |
| 942 | 942 |
| 943 CHECK(runaway.is_null()); | 943 CHECK(runaway.is_null()); |
| 944 } | 944 } |
| 945 | 945 |
| 946 | 946 |
| 947 static int LenFromSize(int size) { | 947 static int LenFromSize(int size) { |
| 948 return (size - FixedArray::kHeaderSize) / kPointerSize; | 948 return (size - FixedArray::kHeaderSize) / kPointerSize; |
| (...skipping 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3621 for (int i = 0; i < 4; i++) { | 3621 for (int i = 0; i < 4; i++) { |
| 3622 heap->CollectAllGarbage(false); | 3622 heap->CollectAllGarbage(false); |
| 3623 } | 3623 } |
| 3624 | 3624 |
| 3625 // The site still exists because of our global handle, but the code is no | 3625 // The site still exists because of our global handle, but the code is no |
| 3626 // longer referred to by dependent_code(). | 3626 // longer referred to by dependent_code(). |
| 3627 DependentCode::GroupStartIndexes starts(site->dependent_code()); | 3627 DependentCode::GroupStartIndexes starts(site->dependent_code()); |
| 3628 int index = starts.at(DependentCode::kAllocationSiteTransitionChangedGroup); | 3628 int index = starts.at(DependentCode::kAllocationSiteTransitionChangedGroup); |
| 3629 CHECK(!(site->dependent_code()->is_code_at(index))); | 3629 CHECK(!(site->dependent_code()->is_code_at(index))); |
| 3630 } | 3630 } |
| OLD | NEW |