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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 | 8 |
9 #include "src/ast-numbering.h" | 9 #include "src/ast-numbering.h" |
10 #include "src/ast-this-access-visitor.h" | 10 #include "src/ast-this-access-visitor.h" |
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 return isolate->factory()->NewFunctionFromSharedFunctionInfo( | 1254 return isolate->factory()->NewFunctionFromSharedFunctionInfo( |
1255 shared_info, context, NOT_TENURED); | 1255 shared_info, context, NOT_TENURED); |
1256 } | 1256 } |
1257 | 1257 |
1258 | 1258 |
1259 Handle<SharedFunctionInfo> Compiler::CompileScript( | 1259 Handle<SharedFunctionInfo> Compiler::CompileScript( |
1260 Handle<String> source, Handle<Object> script_name, int line_offset, | 1260 Handle<String> source, Handle<Object> script_name, int line_offset, |
1261 int column_offset, bool is_shared_cross_origin, Handle<Context> context, | 1261 int column_offset, bool is_shared_cross_origin, Handle<Context> context, |
1262 v8::Extension* extension, ScriptData** cached_data, | 1262 v8::Extension* extension, ScriptData** cached_data, |
1263 ScriptCompiler::CompileOptions compile_options, NativesFlag natives) { | 1263 ScriptCompiler::CompileOptions compile_options, NativesFlag natives) { |
| 1264 Isolate* isolate = source->GetIsolate(); |
1264 if (compile_options == ScriptCompiler::kNoCompileOptions) { | 1265 if (compile_options == ScriptCompiler::kNoCompileOptions) { |
1265 cached_data = NULL; | 1266 cached_data = NULL; |
1266 } else if (compile_options == ScriptCompiler::kProduceParserCache || | 1267 } else if (compile_options == ScriptCompiler::kProduceParserCache || |
1267 compile_options == ScriptCompiler::kProduceCodeCache) { | 1268 compile_options == ScriptCompiler::kProduceCodeCache) { |
1268 DCHECK(cached_data && !*cached_data); | 1269 DCHECK(cached_data && !*cached_data); |
1269 DCHECK(extension == NULL); | 1270 DCHECK(extension == NULL); |
| 1271 DCHECK(!isolate->debug()->is_loaded()); |
1270 } else { | 1272 } else { |
1271 DCHECK(compile_options == ScriptCompiler::kConsumeParserCache || | 1273 DCHECK(compile_options == ScriptCompiler::kConsumeParserCache || |
1272 compile_options == ScriptCompiler::kConsumeCodeCache); | 1274 compile_options == ScriptCompiler::kConsumeCodeCache); |
1273 DCHECK(cached_data && *cached_data); | 1275 DCHECK(cached_data && *cached_data); |
1274 DCHECK(extension == NULL); | 1276 DCHECK(extension == NULL); |
1275 } | 1277 } |
1276 Isolate* isolate = source->GetIsolate(); | |
1277 int source_length = source->length(); | 1278 int source_length = source->length(); |
1278 isolate->counters()->total_load_size()->Increment(source_length); | 1279 isolate->counters()->total_load_size()->Increment(source_length); |
1279 isolate->counters()->total_compile_size()->Increment(source_length); | 1280 isolate->counters()->total_compile_size()->Increment(source_length); |
1280 | 1281 |
1281 CompilationCache* compilation_cache = isolate->compilation_cache(); | 1282 CompilationCache* compilation_cache = isolate->compilation_cache(); |
1282 | 1283 |
1283 // Do a lookup in the compilation cache but not for extensions. | 1284 // Do a lookup in the compilation cache but not for extensions. |
1284 MaybeHandle<SharedFunctionInfo> maybe_result; | 1285 MaybeHandle<SharedFunctionInfo> maybe_result; |
1285 Handle<SharedFunctionInfo> result; | 1286 Handle<SharedFunctionInfo> result; |
1286 if (extension == NULL) { | 1287 if (extension == NULL) { |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1575 AllowHandleDereference allow_deref; | 1576 AllowHandleDereference allow_deref; |
1576 bool tracing_on = info()->IsStub() | 1577 bool tracing_on = info()->IsStub() |
1577 ? FLAG_trace_hydrogen_stubs | 1578 ? FLAG_trace_hydrogen_stubs |
1578 : (FLAG_trace_hydrogen && | 1579 : (FLAG_trace_hydrogen && |
1579 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1580 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1580 return (tracing_on && | 1581 return (tracing_on && |
1581 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1582 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1582 } | 1583 } |
1583 | 1584 |
1584 } } // namespace v8::internal | 1585 } } // namespace v8::internal |
OLD | NEW |