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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 TEST(Tagging) { | 233 TEST(Tagging) { |
234 CcTest::InitializeVM(); | 234 CcTest::InitializeVM(); |
235 int request = 24; | 235 int request = 24; |
236 CHECK_EQ(request, static_cast<int>(OBJECT_POINTER_ALIGN(request))); | 236 CHECK_EQ(request, static_cast<int>(OBJECT_POINTER_ALIGN(request))); |
237 CHECK(Smi::FromInt(42)->IsSmi()); | 237 CHECK(Smi::FromInt(42)->IsSmi()); |
238 CHECK(Failure::RetryAfterGC(NEW_SPACE)->IsFailure()); | 238 CHECK(Failure::RetryAfterGC(NEW_SPACE)->IsFailure()); |
239 CHECK_EQ(NEW_SPACE, | 239 CHECK_EQ(NEW_SPACE, |
240 Failure::RetryAfterGC(NEW_SPACE)->allocation_space()); | 240 Failure::RetryAfterGC(NEW_SPACE)->allocation_space()); |
241 CHECK_EQ(OLD_POINTER_SPACE, | 241 CHECK_EQ(OLD_POINTER_SPACE, |
242 Failure::RetryAfterGC(OLD_POINTER_SPACE)->allocation_space()); | 242 Failure::RetryAfterGC(OLD_POINTER_SPACE)->allocation_space()); |
243 CHECK(Failure::Exception()->IsFailure()); | |
244 CHECK(Smi::FromInt(Smi::kMinValue)->IsSmi()); | 243 CHECK(Smi::FromInt(Smi::kMinValue)->IsSmi()); |
245 CHECK(Smi::FromInt(Smi::kMaxValue)->IsSmi()); | 244 CHECK(Smi::FromInt(Smi::kMaxValue)->IsSmi()); |
246 } | 245 } |
247 | 246 |
248 | 247 |
249 TEST(GarbageCollection) { | 248 TEST(GarbageCollection) { |
250 CcTest::InitializeVM(); | 249 CcTest::InitializeVM(); |
251 Isolate* isolate = CcTest::i_isolate(); | 250 Isolate* isolate = CcTest::i_isolate(); |
252 Heap* heap = isolate->heap(); | 251 Heap* heap = isolate->heap(); |
253 Factory* factory = isolate->factory(); | 252 Factory* factory = isolate->factory(); |
(...skipping 3940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4194 v8::Context::Scope cscope(context); | 4193 v8::Context::Scope cscope(context); |
4195 | 4194 |
4196 v8::Local<v8::Value> result = CompileRun( | 4195 v8::Local<v8::Value> result = CompileRun( |
4197 "var locals = '';" | 4196 "var locals = '';" |
4198 "for (var i = 0; i < 512; i++) locals += 'var v' + i + '= 42;';" | 4197 "for (var i = 0; i < 512; i++) locals += 'var v' + i + '= 42;';" |
4199 "eval('function f() {' + locals + 'return function() { return v0; }; }');" | 4198 "eval('function f() {' + locals + 'return function() { return v0; }; }');" |
4200 "interrupt();" // This triggers a fake stack overflow in f. | 4199 "interrupt();" // This triggers a fake stack overflow in f. |
4201 "f()()"); | 4200 "f()()"); |
4202 CHECK_EQ(42.0, result->ToNumber()->Value()); | 4201 CHECK_EQ(42.0, result->ToNumber()->Value()); |
4203 } | 4202 } |
OLD | NEW |