| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 | 5 |
| 6 // Defined when linking against shared lib on Windows. | 6 // Defined when linking against shared lib on Windows. |
| 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) | 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) |
| 8 #define V8_SHARED | 8 #define V8_SHARED |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 if (script_source.GetCachedData()) { | 212 if (script_source.GetCachedData()) { |
| 213 int length = script_source.GetCachedData()->length; | 213 int length = script_source.GetCachedData()->length; |
| 214 uint8_t* cache = new uint8_t[length]; | 214 uint8_t* cache = new uint8_t[length]; |
| 215 memcpy(cache, script_source.GetCachedData()->data, length); | 215 memcpy(cache, script_source.GetCachedData()->data, length); |
| 216 result = new ScriptCompiler::CachedData( | 216 result = new ScriptCompiler::CachedData( |
| 217 cache, length, ScriptCompiler::CachedData::BufferOwned); | 217 cache, length, ScriptCompiler::CachedData::BufferOwned); |
| 218 } | 218 } |
| 219 } | 219 } |
| 220 temp_isolate->Dispose(); | 220 temp_isolate->Dispose(); |
| 221 delete[] source_buffer; | 221 delete[] source_buffer; |
| 222 delete[] name_buffer; |
| 222 return result; | 223 return result; |
| 223 } | 224 } |
| 224 | 225 |
| 225 | 226 |
| 226 // Compile a string within the current v8 context. | 227 // Compile a string within the current v8 context. |
| 227 Local<UnboundScript> Shell::CompileString( | 228 Local<UnboundScript> Shell::CompileString( |
| 228 Isolate* isolate, Local<String> source, Local<Value> name, | 229 Isolate* isolate, Local<String> source, Local<Value> name, |
| 229 ScriptCompiler::CompileOptions compile_options) { | 230 ScriptCompiler::CompileOptions compile_options) { |
| 230 ScriptOrigin origin(name); | 231 ScriptOrigin origin(name); |
| 231 if (compile_options == ScriptCompiler::kNoCompileOptions) { | 232 if (compile_options == ScriptCompiler::kNoCompileOptions) { |
| (...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1764 } | 1765 } |
| 1765 | 1766 |
| 1766 } // namespace v8 | 1767 } // namespace v8 |
| 1767 | 1768 |
| 1768 | 1769 |
| 1769 #ifndef GOOGLE3 | 1770 #ifndef GOOGLE3 |
| 1770 int main(int argc, char* argv[]) { | 1771 int main(int argc, char* argv[]) { |
| 1771 return v8::Shell::Main(argc, argv); | 1772 return v8::Shell::Main(argc, argv); |
| 1772 } | 1773 } |
| 1773 #endif | 1774 #endif |
| OLD | NEW |