Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(403)

Side by Side Diff: test/cctest/test-heap.cc

Issue 1024823002: Fix OOM bug 3976. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add test from bug Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 4511 matching lines...) Expand 10 before | Expand all | Expand 10 after
4522 4522
4523 static void RequestInterrupt(const v8::FunctionCallbackInfo<v8::Value>& args) { 4523 static void RequestInterrupt(const v8::FunctionCallbackInfo<v8::Value>& args) {
4524 CcTest::isolate()->RequestInterrupt(&InterruptCallback357137, NULL); 4524 CcTest::isolate()->RequestInterrupt(&InterruptCallback357137, NULL);
4525 } 4525 }
4526 4526
4527 4527
4528 TEST(Regress357137) { 4528 TEST(Regress357137) {
4529 CcTest::InitializeVM(); 4529 CcTest::InitializeVM();
4530 v8::Isolate* isolate = CcTest::isolate(); 4530 v8::Isolate* isolate = CcTest::isolate();
4531 v8::HandleScope hscope(isolate); 4531 v8::HandleScope hscope(isolate);
4532 v8::Handle<v8::ObjectTemplate> global =v8::ObjectTemplate::New(isolate); 4532 v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate);
4533 global->Set(v8::String::NewFromUtf8(isolate, "interrupt"), 4533 global->Set(v8::String::NewFromUtf8(isolate, "interrupt"),
4534 v8::FunctionTemplate::New(isolate, RequestInterrupt)); 4534 v8::FunctionTemplate::New(isolate, RequestInterrupt));
4535 v8::Local<v8::Context> context = v8::Context::New(isolate, NULL, global); 4535 v8::Local<v8::Context> context = v8::Context::New(isolate, NULL, global);
4536 DCHECK(!context.IsEmpty()); 4536 DCHECK(!context.IsEmpty());
4537 v8::Context::Scope cscope(context); 4537 v8::Context::Scope cscope(context);
4538 4538
4539 v8::Local<v8::Value> result = CompileRun( 4539 v8::Local<v8::Value> result = CompileRun(
4540 "var locals = '';" 4540 "var locals = '';"
4541 "for (var i = 0; i < 512; i++) locals += 'var v' + i + '= 42;';" 4541 "for (var i = 0; i < 512; i++) locals += 'var v' + i + '= 42;';"
4542 "eval('function f() {' + locals + 'return function() { return v0; }; }');" 4542 "eval('function f() {' + locals + 'return function() { return v0; }; }');"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
4754 #ifdef DEBUG 4754 #ifdef DEBUG
4755 TEST(PathTracer) { 4755 TEST(PathTracer) {
4756 CcTest::InitializeVM(); 4756 CcTest::InitializeVM();
4757 v8::HandleScope scope(CcTest::isolate()); 4757 v8::HandleScope scope(CcTest::isolate());
4758 4758
4759 v8::Local<v8::Value> result = CompileRun("'abc'"); 4759 v8::Local<v8::Value> result = CompileRun("'abc'");
4760 Handle<Object> o = v8::Utils::OpenHandle(*result); 4760 Handle<Object> o = v8::Utils::OpenHandle(*result);
4761 CcTest::i_isolate()->heap()->TracePathToObject(*o); 4761 CcTest::i_isolate()->heap()->TracePathToObject(*o);
4762 } 4762 }
4763 #endif // DEBUG 4763 #endif // DEBUG
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698