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 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 live_edit_tracker.RecordFunctionInfo(result, lit, info->zone()); | 660 live_edit_tracker.RecordFunctionInfo(result, lit, info->zone()); |
661 | 661 |
662 return result; | 662 return result; |
663 } | 663 } |
664 | 664 |
665 | 665 |
666 Handle<SharedFunctionInfo> Compiler::Compile(Handle<String> source, | 666 Handle<SharedFunctionInfo> Compiler::Compile(Handle<String> source, |
667 Handle<Object> script_name, | 667 Handle<Object> script_name, |
668 int line_offset, | 668 int line_offset, |
669 int column_offset, | 669 int column_offset, |
| 670 bool passed_access_check, |
670 Handle<Context> context, | 671 Handle<Context> context, |
671 v8::Extension* extension, | 672 v8::Extension* extension, |
672 ScriptDataImpl* pre_data, | 673 ScriptDataImpl* pre_data, |
673 Handle<Object> script_data, | 674 Handle<Object> script_data, |
674 NativesFlag natives) { | 675 NativesFlag natives) { |
675 Isolate* isolate = source->GetIsolate(); | 676 Isolate* isolate = source->GetIsolate(); |
676 int source_length = source->length(); | 677 int source_length = source->length(); |
677 isolate->counters()->total_load_size()->Increment(source_length); | 678 isolate->counters()->total_load_size()->Increment(source_length); |
678 isolate->counters()->total_compile_size()->Increment(source_length); | 679 isolate->counters()->total_compile_size()->Increment(source_length); |
679 | 680 |
(...skipping 25 matching lines...) Expand all Loading... |
705 // Create a script object describing the script to be compiled. | 706 // Create a script object describing the script to be compiled. |
706 Handle<Script> script = isolate->factory()->NewScript(source); | 707 Handle<Script> script = isolate->factory()->NewScript(source); |
707 if (natives == NATIVES_CODE) { | 708 if (natives == NATIVES_CODE) { |
708 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); | 709 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); |
709 } | 710 } |
710 if (!script_name.is_null()) { | 711 if (!script_name.is_null()) { |
711 script->set_name(*script_name); | 712 script->set_name(*script_name); |
712 script->set_line_offset(Smi::FromInt(line_offset)); | 713 script->set_line_offset(Smi::FromInt(line_offset)); |
713 script->set_column_offset(Smi::FromInt(column_offset)); | 714 script->set_column_offset(Smi::FromInt(column_offset)); |
714 } | 715 } |
| 716 script->set_passed_access_check(passed_access_check); |
715 | 717 |
716 script->set_data(script_data.is_null() ? HEAP->undefined_value() | 718 script->set_data(script_data.is_null() ? HEAP->undefined_value() |
717 : *script_data); | 719 : *script_data); |
718 | 720 |
719 // Compile the function and add it to the cache. | 721 // Compile the function and add it to the cache. |
720 CompilationInfoWithZone info(script); | 722 CompilationInfoWithZone info(script); |
721 info.MarkAsGlobal(); | 723 info.MarkAsGlobal(); |
722 info.SetExtension(extension); | 724 info.SetExtension(extension); |
723 info.SetPreParseData(pre_data); | 725 info.SetPreParseData(pre_data); |
724 info.SetContext(context); | 726 info.SetContext(context); |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 // Trace if the appropriate trace flag is set and the phase name's first | 1252 // Trace if the appropriate trace flag is set and the phase name's first |
1251 // character is in the FLAG_trace_phase command line parameter. | 1253 // character is in the FLAG_trace_phase command line parameter. |
1252 bool tracing_on = info()->IsStub() ? | 1254 bool tracing_on = info()->IsStub() ? |
1253 FLAG_trace_hydrogen_stubs : | 1255 FLAG_trace_hydrogen_stubs : |
1254 FLAG_trace_hydrogen; | 1256 FLAG_trace_hydrogen; |
1255 return (tracing_on && | 1257 return (tracing_on && |
1256 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1258 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1257 } | 1259 } |
1258 | 1260 |
1259 } } // namespace v8::internal | 1261 } } // namespace v8::internal |
OLD | NEW |