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

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

Issue 299813002: Revert "Fix Heap::IsHeapIterable." (again) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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
« no previous file with comments | « src/runtime.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 13496 matching lines...) Expand 10 before | Expand all | Expand 10 after
13507 Local<Script> script = v8_compile("(function () {" 13507 Local<Script> script = v8_compile("(function () {"
13508 " unlock_for_a_moment();" 13508 " unlock_for_a_moment();"
13509 " return 42;" 13509 " return 42;"
13510 "})();"); 13510 "})();");
13511 CHECK_EQ(42, script->Run()->Int32Value()); 13511 CHECK_EQ(42, script->Run()->Int32Value());
13512 } 13512 }
13513 } 13513 }
13514 13514
13515 13515
13516 static int GetGlobalObjectsCount() { 13516 static int GetGlobalObjectsCount() {
13517 CcTest::heap()->EnsureHeapIsIterable();
13517 int count = 0; 13518 int count = 0;
13518 i::HeapIterator it(CcTest::heap()); 13519 i::HeapIterator it(CcTest::heap());
13519 for (i::HeapObject* object = it.next(); object != NULL; object = it.next()) 13520 for (i::HeapObject* object = it.next(); object != NULL; object = it.next())
13520 if (object->IsJSGlobalObject()) count++; 13521 if (object->IsJSGlobalObject()) count++;
13521 return count; 13522 return count;
13522 } 13523 }
13523 13524
13524 13525
13525 static void CheckSurvivingGlobalObjectsCount(int expected) { 13526 static void CheckSurvivingGlobalObjectsCount(int expected) {
13526 // We need to collect all garbage twice to be sure that everything 13527 // We need to collect all garbage twice to be sure that everything
(...skipping 9098 matching lines...) Expand 10 before | Expand all | Expand 10 after
22625 Local<Script> script = v8::ScriptCompiler::Compile( 22626 Local<Script> script = v8::ScriptCompiler::Compile(
22626 isolate, &script_source); 22627 isolate, &script_source);
22627 Local<Value> script_name = script->GetUnboundScript()->GetScriptName(); 22628 Local<Value> script_name = script->GetUnboundScript()->GetScriptName();
22628 CHECK(!script_name.IsEmpty()); 22629 CHECK(!script_name.IsEmpty());
22629 CHECK(script_name->IsString()); 22630 CHECK(script_name->IsString());
22630 String::Utf8Value utf8_name(script_name); 22631 String::Utf8Value utf8_name(script_name);
22631 CHECK_EQ(url, *utf8_name); 22632 CHECK_EQ(url, *utf8_name);
22632 int line_number = script->GetUnboundScript()->GetLineNumber(0); 22633 int line_number = script->GetUnboundScript()->GetLineNumber(0);
22633 CHECK_EQ(13, line_number); 22634 CHECK_EQ(13, line_number);
22634 } 22635 }
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698