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 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 CHECK(heap->InSpace(*v8::Utils::OpenHandle(*CompileRun("a")->ToString()), | 941 CHECK(heap->InSpace(*v8::Utils::OpenHandle(*CompileRun("a")->ToString()), |
942 OLD_DATA_SPACE)); | 942 OLD_DATA_SPACE)); |
943 CHECK(heap->InSpace(*v8::Utils::OpenHandle(*CompileRun("b")->ToString()), | 943 CHECK(heap->InSpace(*v8::Utils::OpenHandle(*CompileRun("b")->ToString()), |
944 OLD_DATA_SPACE)); | 944 OLD_DATA_SPACE)); |
945 CHECK(heap->InSpace(*v8::Utils::OpenHandle(*CompileRun("c")->ToString()), | 945 CHECK(heap->InSpace(*v8::Utils::OpenHandle(*CompileRun("c")->ToString()), |
946 OLD_DATA_SPACE)); | 946 OLD_DATA_SPACE)); |
947 | 947 |
948 delete cache; | 948 delete cache; |
949 source_a.Dispose(); | 949 source_a.Dispose(); |
950 source_b.Dispose(); | 950 source_b.Dispose(); |
| 951 source_c.Dispose(); |
951 } | 952 } |
952 | 953 |
953 | 954 |
954 class SerializerOneByteResource | 955 class SerializerOneByteResource |
955 : public v8::String::ExternalOneByteStringResource { | 956 : public v8::String::ExternalOneByteStringResource { |
956 public: | 957 public: |
957 SerializerOneByteResource(const char* data, size_t length) | 958 SerializerOneByteResource(const char* data, size_t length) |
958 : data_(data), length_(length) {} | 959 : data_(data), length_(length) {} |
959 virtual const char* data() const { return data_; } | 960 virtual const char* data() const { return data_; } |
960 virtual size_t length() const { return length_; } | 961 virtual size_t length() const { return length_; } |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 { | 1206 { |
1206 DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate2)); | 1207 DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate2)); |
1207 script = v8::ScriptCompiler::CompileUnbound( | 1208 script = v8::ScriptCompiler::CompileUnbound( |
1208 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache); | 1209 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache); |
1209 } | 1210 } |
1210 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); | 1211 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); |
1211 CHECK(result->ToString()->Equals(v8_str("abcdef"))); | 1212 CHECK(result->ToString()->Equals(v8_str("abcdef"))); |
1212 } | 1213 } |
1213 isolate2->Dispose(); | 1214 isolate2->Dispose(); |
1214 } | 1215 } |
OLD | NEW |