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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 PostponeInterruptsScope postpone(isolate); | 551 PostponeInterruptsScope postpone(isolate); |
552 | 552 |
553 ASSERT(!isolate->native_context().is_null()); | 553 ASSERT(!isolate->native_context().is_null()); |
554 Handle<Script> script = info->script(); | 554 Handle<Script> script = info->script(); |
555 // TODO(svenpanne) Obscure place for this, perhaps move to OnBeforeCompile? | 555 // TODO(svenpanne) Obscure place for this, perhaps move to OnBeforeCompile? |
556 FixedArray* array = isolate->native_context()->embedder_data(); | 556 FixedArray* array = isolate->native_context()->embedder_data(); |
557 script->set_context_data(array->get(0)); | 557 script->set_context_data(array->get(0)); |
558 | 558 |
559 #ifdef ENABLE_DEBUGGER_SUPPORT | 559 #ifdef ENABLE_DEBUGGER_SUPPORT |
560 if (info->is_eval()) { | 560 if (info->is_eval()) { |
561 script->set_compilation_type(Script::COMPILATION_TYPE_EVAL); | 561 Script::CompilationType compilation_type = Script::COMPILATION_TYPE_EVAL; |
| 562 script->set_compilation_type(Smi::FromInt(compilation_type)); |
562 // For eval scripts add information on the function from which eval was | 563 // For eval scripts add information on the function from which eval was |
563 // called. | 564 // called. |
564 if (info->is_eval()) { | 565 if (info->is_eval()) { |
565 StackTraceFrameIterator it(isolate); | 566 StackTraceFrameIterator it(isolate); |
566 if (!it.done()) { | 567 if (!it.done()) { |
567 script->set_eval_from_shared(it.frame()->function()->shared()); | 568 script->set_eval_from_shared(it.frame()->function()->shared()); |
568 Code* code = it.frame()->LookupCode(); | 569 Code* code = it.frame()->LookupCode(); |
569 int offset = static_cast<int>( | 570 int offset = static_cast<int>( |
570 it.frame()->pc() - code->instruction_start()); | 571 it.frame()->pc() - code->instruction_start()); |
571 script->set_eval_from_instructions_offset(Smi::FromInt(offset)); | 572 script->set_eval_from_instructions_offset(Smi::FromInt(offset)); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 info, | 643 info, |
643 isolate->heap()->empty_string())); | 644 isolate->heap()->empty_string())); |
644 GDBJIT(AddCode(Handle<String>(), script, info->code(), info)); | 645 GDBJIT(AddCode(Handle<String>(), script, info->code(), info)); |
645 } | 646 } |
646 | 647 |
647 // Hint to the runtime system used when allocating space for initial | 648 // Hint to the runtime system used when allocating space for initial |
648 // property space by setting the expected number of properties for | 649 // property space by setting the expected number of properties for |
649 // the instances of the function. | 650 // the instances of the function. |
650 SetExpectedNofPropertiesFromEstimate(result, lit->expected_property_count()); | 651 SetExpectedNofPropertiesFromEstimate(result, lit->expected_property_count()); |
651 | 652 |
652 script->set_compilation_state(Script::COMPILATION_STATE_COMPILED); | 653 script->set_compilation_state( |
| 654 Smi::FromInt(Script::COMPILATION_STATE_COMPILED)); |
653 | 655 |
654 #ifdef ENABLE_DEBUGGER_SUPPORT | 656 #ifdef ENABLE_DEBUGGER_SUPPORT |
655 // Notify debugger | 657 // Notify debugger |
656 isolate->debugger()->OnAfterCompile( | 658 isolate->debugger()->OnAfterCompile( |
657 script, Debugger::NO_AFTER_COMPILE_FLAGS); | 659 script, Debugger::NO_AFTER_COMPILE_FLAGS); |
658 #endif | 660 #endif |
659 | 661 |
660 live_edit_tracker.RecordFunctionInfo(result, lit, info->zone()); | 662 live_edit_tracker.RecordFunctionInfo(result, lit, info->zone()); |
661 | 663 |
662 return result; | 664 return result; |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1248 // Trace if the appropriate trace flag is set and the phase name's first | 1250 // Trace if the appropriate trace flag is set and the phase name's first |
1249 // character is in the FLAG_trace_phase command line parameter. | 1251 // character is in the FLAG_trace_phase command line parameter. |
1250 bool tracing_on = info()->IsStub() ? | 1252 bool tracing_on = info()->IsStub() ? |
1251 FLAG_trace_hydrogen_stubs : | 1253 FLAG_trace_hydrogen_stubs : |
1252 FLAG_trace_hydrogen; | 1254 FLAG_trace_hydrogen; |
1253 return (tracing_on && | 1255 return (tracing_on && |
1254 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1256 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1255 } | 1257 } |
1256 | 1258 |
1257 } } // namespace v8::internal | 1259 } } // namespace v8::internal |
OLD | NEW |