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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 CompileForCachedData(source, name, compile_options); | 242 CompileForCachedData(source, name, compile_options); |
243 ScriptCompiler::Source cached_source(source, origin, data); | 243 ScriptCompiler::Source cached_source(source, origin, data); |
244 if (compile_options == ScriptCompiler::kProduceCodeCache) { | 244 if (compile_options == ScriptCompiler::kProduceCodeCache) { |
245 compile_options = ScriptCompiler::kConsumeCodeCache; | 245 compile_options = ScriptCompiler::kConsumeCodeCache; |
246 } else if (compile_options == ScriptCompiler::kProduceParserCache) { | 246 } else if (compile_options == ScriptCompiler::kProduceParserCache) { |
247 compile_options = ScriptCompiler::kConsumeParserCache; | 247 compile_options = ScriptCompiler::kConsumeParserCache; |
248 } else { | 248 } else { |
249 DCHECK(false); // A new compile option? | 249 DCHECK(false); // A new compile option? |
250 } | 250 } |
251 if (data == NULL) compile_options = ScriptCompiler::kNoCompileOptions; | 251 if (data == NULL) compile_options = ScriptCompiler::kNoCompileOptions; |
252 return source_type == SCRIPT | 252 Local<Script> result = |
253 ? ScriptCompiler::Compile(isolate, &cached_source, compile_options) | 253 source_type == SCRIPT |
254 : ScriptCompiler::CompileModule(isolate, &cached_source, | 254 ? ScriptCompiler::Compile(isolate, &cached_source, compile_options) |
255 compile_options); | 255 : ScriptCompiler::CompileModule(isolate, &cached_source, |
| 256 compile_options); |
| 257 CHECK(data == NULL || !data->rejected); |
| 258 return result; |
256 } | 259 } |
257 | 260 |
258 | 261 |
259 // Executes a string within the current v8 context. | 262 // Executes a string within the current v8 context. |
260 bool Shell::ExecuteString(Isolate* isolate, Handle<String> source, | 263 bool Shell::ExecuteString(Isolate* isolate, Handle<String> source, |
261 Handle<Value> name, bool print_result, | 264 Handle<Value> name, bool print_result, |
262 bool report_exceptions, SourceType source_type) { | 265 bool report_exceptions, SourceType source_type) { |
263 #ifndef V8_SHARED | 266 #ifndef V8_SHARED |
264 bool FLAG_debugger = i::FLAG_debugger; | 267 bool FLAG_debugger = i::FLAG_debugger; |
265 #else | 268 #else |
(...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1690 } | 1693 } |
1691 | 1694 |
1692 } // namespace v8 | 1695 } // namespace v8 |
1693 | 1696 |
1694 | 1697 |
1695 #ifndef GOOGLE3 | 1698 #ifndef GOOGLE3 |
1696 int main(int argc, char* argv[]) { | 1699 int main(int argc, char* argv[]) { |
1697 return v8::Shell::Main(argc, argv); | 1700 return v8::Shell::Main(argc, argv); |
1698 } | 1701 } |
1699 #endif | 1702 #endif |
OLD | NEW |