OLD | NEW |
1 // Copyright 2007-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2010 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 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { | 801 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { |
802 if (obj->IsCode() && Code::cast(obj)->kind() == Code::BUILTIN) counter++; | 802 if (obj->IsCode() && Code::cast(obj)->kind() == Code::BUILTIN) counter++; |
803 } | 803 } |
804 return counter; | 804 return counter; |
805 } | 805 } |
806 | 806 |
807 | 807 |
808 static Handle<SharedFunctionInfo> CompileScript( | 808 static Handle<SharedFunctionInfo> CompileScript( |
809 Isolate* isolate, Handle<String> source, Handle<String> name, | 809 Isolate* isolate, Handle<String> source, Handle<String> name, |
810 ScriptData** cached_data, v8::ScriptCompiler::CompileOptions options) { | 810 ScriptData** cached_data, v8::ScriptCompiler::CompileOptions options) { |
811 return Compiler::CompileScript(source, name, 0, 0, false, false, | 811 return Compiler::CompileScript( |
812 Handle<Context>(isolate->native_context()), | 812 source, name, 0, 0, false, false, Handle<Object>(), |
813 NULL, cached_data, options, NOT_NATIVES_CODE, | 813 Handle<Context>(isolate->native_context()), NULL, cached_data, options, |
814 false); | 814 NOT_NATIVES_CODE, false); |
815 } | 815 } |
816 | 816 |
817 | 817 |
818 TEST(SerializeToplevelOnePlusOne) { | 818 TEST(SerializeToplevelOnePlusOne) { |
819 FLAG_serialize_toplevel = true; | 819 FLAG_serialize_toplevel = true; |
820 LocalContext context; | 820 LocalContext context; |
821 Isolate* isolate = CcTest::i_isolate(); | 821 Isolate* isolate = CcTest::i_isolate(); |
822 isolate->compilation_cache()->Disable(); // Disable same-isolate code cache. | 822 isolate->compilation_cache()->Disable(); // Disable same-isolate code cache. |
823 | 823 |
824 v8::HandleScope scope(CcTest::isolate()); | 824 v8::HandleScope scope(CcTest::isolate()); |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1489 { | 1489 { |
1490 DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate2)); | 1490 DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate2)); |
1491 script = v8::ScriptCompiler::CompileUnbound( | 1491 script = v8::ScriptCompiler::CompileUnbound( |
1492 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache); | 1492 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache); |
1493 } | 1493 } |
1494 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); | 1494 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); |
1495 CHECK(result->ToString(isolate2)->Equals(v8_str("XY"))); | 1495 CHECK(result->ToString(isolate2)->Equals(v8_str("XY"))); |
1496 } | 1496 } |
1497 isolate2->Dispose(); | 1497 isolate2->Dispose(); |
1498 } | 1498 } |
OLD | NEW |