OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 if (extension == NULL) { | 949 if (extension == NULL) { |
950 result = compilation_cache->LookupScript(source, | 950 result = compilation_cache->LookupScript(source, |
951 script_name, | 951 script_name, |
952 line_offset, | 952 line_offset, |
953 column_offset, | 953 column_offset, |
954 is_shared_cross_origin, | 954 is_shared_cross_origin, |
955 context); | 955 context); |
956 } | 956 } |
957 | 957 |
958 if (result.is_null()) { | 958 if (result.is_null()) { |
959 // No cache entry found. Do pre-parsing, if it makes sense, and compile | 959 // No cache entry found. Compile the script. |
960 // the script. | |
961 // Building preparse data that is only used immediately after is only a | |
962 // saving if we might skip building the AST for lazily compiled functions. | |
963 // I.e., preparse data isn't relevant when the lazy flag is off, and | |
964 // for small sources, odds are that there aren't many functions | |
965 // that would be compiled lazily anyway, so we skip the preparse step | |
966 // in that case too. | |
967 | 960 |
968 // Create a script object describing the script to be compiled. | 961 // Create a script object describing the script to be compiled. |
969 Handle<Script> script = isolate->factory()->NewScript(source); | 962 Handle<Script> script = isolate->factory()->NewScript(source); |
970 if (natives == NATIVES_CODE) { | 963 if (natives == NATIVES_CODE) { |
971 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); | 964 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); |
972 } | 965 } |
973 if (!script_name.is_null()) { | 966 if (!script_name.is_null()) { |
974 script->set_name(*script_name); | 967 script->set_name(*script_name); |
975 script->set_line_offset(Smi::FromInt(line_offset)); | 968 script->set_line_offset(Smi::FromInt(line_offset)); |
976 script->set_column_offset(Smi::FromInt(column_offset)); | 969 script->set_column_offset(Smi::FromInt(column_offset)); |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 AllowHandleDereference allow_deref; | 1303 AllowHandleDereference allow_deref; |
1311 bool tracing_on = info()->IsStub() | 1304 bool tracing_on = info()->IsStub() |
1312 ? FLAG_trace_hydrogen_stubs | 1305 ? FLAG_trace_hydrogen_stubs |
1313 : (FLAG_trace_hydrogen && | 1306 : (FLAG_trace_hydrogen && |
1314 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1307 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1315 return (tracing_on && | 1308 return (tracing_on && |
1316 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1309 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1317 } | 1310 } |
1318 | 1311 |
1319 } } // namespace v8::internal | 1312 } } // namespace v8::internal |
OLD | NEW |