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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 AlwaysAllocateScope scope(CcTest::i_isolate()); | 95 AlwaysAllocateScope scope(CcTest::i_isolate()); |
96 return handle(AllocateAfterFailures().ToObjectChecked(), CcTest::i_isolate()); | 96 return handle(AllocateAfterFailures().ToObjectChecked(), CcTest::i_isolate()); |
97 } | 97 } |
98 | 98 |
99 | 99 |
100 HEAP_TEST(StressHandles) { | 100 HEAP_TEST(StressHandles) { |
101 v8::HandleScope scope(CcTest::isolate()); | 101 v8::HandleScope scope(CcTest::isolate()); |
102 v8::Local<v8::Context> env = v8::Context::New(CcTest::isolate()); | 102 v8::Local<v8::Context> env = v8::Context::New(CcTest::isolate()); |
103 env->Enter(); | 103 env->Enter(); |
104 Handle<Object> o = TestAllocateAfterFailures(); | 104 Handle<Object> o = TestAllocateAfterFailures(); |
105 CHECK(o->IsTrue(CcTest::i_isolate())); | 105 CHECK(o->IsTrue()); |
106 env->Exit(); | 106 env->Exit(); |
107 } | 107 } |
108 | 108 |
109 | 109 |
110 void TestGetter( | 110 void TestGetter( |
111 v8::Local<v8::Name> name, | 111 v8::Local<v8::Name> name, |
112 const v8::PropertyCallbackInfo<v8::Value>& info) { | 112 const v8::PropertyCallbackInfo<v8::Value>& info) { |
113 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); | 113 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); |
114 HandleScope scope(isolate); | 114 HandleScope scope(isolate); |
115 info.GetReturnValue().Set(v8::Utils::ToLocal( | 115 info.GetReturnValue().Set(v8::Utils::ToLocal( |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 code_range.FreeRawMemory(blocks[index].base, blocks[index].size); | 243 code_range.FreeRawMemory(blocks[index].base, blocks[index].size); |
244 current_allocated -= blocks[index].size; | 244 current_allocated -= blocks[index].size; |
245 if (index < blocks.length() - 1) { | 245 if (index < blocks.length() - 1) { |
246 blocks[index] = blocks.RemoveLast(); | 246 blocks[index] = blocks.RemoveLast(); |
247 } else { | 247 } else { |
248 blocks.RemoveLast(); | 248 blocks.RemoveLast(); |
249 } | 249 } |
250 } | 250 } |
251 } | 251 } |
252 } | 252 } |
OLD | NEW |