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 13550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13561 Local<Script> script = v8_compile("(function () {" | 13561 Local<Script> script = v8_compile("(function () {" |
13562 " unlock_for_a_moment();" | 13562 " unlock_for_a_moment();" |
13563 " return 42;" | 13563 " return 42;" |
13564 "})();"); | 13564 "})();"); |
13565 CHECK_EQ(42, script->Run()->Int32Value()); | 13565 CHECK_EQ(42, script->Run()->Int32Value()); |
13566 } | 13566 } |
13567 } | 13567 } |
13568 | 13568 |
13569 | 13569 |
13570 static int GetGlobalObjectsCount() { | 13570 static int GetGlobalObjectsCount() { |
13571 CcTest::heap()->EnsureHeapIsIterable(); | |
13572 int count = 0; | 13571 int count = 0; |
13573 i::HeapIterator it(CcTest::heap()); | 13572 i::HeapIterator it(CcTest::heap()); |
13574 for (i::HeapObject* object = it.next(); object != NULL; object = it.next()) | 13573 for (i::HeapObject* object = it.next(); object != NULL; object = it.next()) |
13575 if (object->IsJSGlobalObject()) count++; | 13574 if (object->IsJSGlobalObject()) count++; |
13576 return count; | 13575 return count; |
13577 } | 13576 } |
13578 | 13577 |
13579 | 13578 |
13580 static void CheckSurvivingGlobalObjectsCount(int expected) { | 13579 static void CheckSurvivingGlobalObjectsCount(int expected) { |
13581 // We need to collect all garbage twice to be sure that everything | 13580 // We need to collect all garbage twice to be sure that everything |
(...skipping 9098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22680 Local<Script> script = v8::ScriptCompiler::Compile( | 22679 Local<Script> script = v8::ScriptCompiler::Compile( |
22681 isolate, &script_source); | 22680 isolate, &script_source); |
22682 Local<Value> script_name = script->GetUnboundScript()->GetScriptName(); | 22681 Local<Value> script_name = script->GetUnboundScript()->GetScriptName(); |
22683 CHECK(!script_name.IsEmpty()); | 22682 CHECK(!script_name.IsEmpty()); |
22684 CHECK(script_name->IsString()); | 22683 CHECK(script_name->IsString()); |
22685 String::Utf8Value utf8_name(script_name); | 22684 String::Utf8Value utf8_name(script_name); |
22686 CHECK_EQ(url, *utf8_name); | 22685 CHECK_EQ(url, *utf8_name); |
22687 int line_number = script->GetUnboundScript()->GetLineNumber(0); | 22686 int line_number = script->GetUnboundScript()->GetLineNumber(0); |
22688 CHECK_EQ(13, line_number); | 22687 CHECK_EQ(13, line_number); |
22689 } | 22688 } |
OLD | NEW |