| 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::CompilationType compilation_type = Script::COMPILATION_TYPE_EVAL; | 561     script->set_compilation_type(Script::COMPILATION_TYPE_EVAL); | 
| 562     script->set_compilation_type(Smi::FromInt(compilation_type)); |  | 
| 563     // For eval scripts add information on the function from which eval was | 562     // For eval scripts add information on the function from which eval was | 
| 564     // called. | 563     // called. | 
| 565     if (info->is_eval()) { | 564     if (info->is_eval()) { | 
| 566       StackTraceFrameIterator it(isolate); | 565       StackTraceFrameIterator it(isolate); | 
| 567       if (!it.done()) { | 566       if (!it.done()) { | 
| 568         script->set_eval_from_shared(it.frame()->function()->shared()); | 567         script->set_eval_from_shared(it.frame()->function()->shared()); | 
| 569         Code* code = it.frame()->LookupCode(); | 568         Code* code = it.frame()->LookupCode(); | 
| 570         int offset = static_cast<int>( | 569         int offset = static_cast<int>( | 
| 571             it.frame()->pc() - code->instruction_start()); | 570             it.frame()->pc() - code->instruction_start()); | 
| 572         script->set_eval_from_instructions_offset(Smi::FromInt(offset)); | 571         script->set_eval_from_instructions_offset(Smi::FromInt(offset)); | 
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 643         info, | 642         info, | 
| 644         isolate->heap()->empty_string())); | 643         isolate->heap()->empty_string())); | 
| 645     GDBJIT(AddCode(Handle<String>(), script, info->code(), info)); | 644     GDBJIT(AddCode(Handle<String>(), script, info->code(), info)); | 
| 646   } | 645   } | 
| 647 | 646 | 
| 648   // Hint to the runtime system used when allocating space for initial | 647   // Hint to the runtime system used when allocating space for initial | 
| 649   // property space by setting the expected number of properties for | 648   // property space by setting the expected number of properties for | 
| 650   // the instances of the function. | 649   // the instances of the function. | 
| 651   SetExpectedNofPropertiesFromEstimate(result, lit->expected_property_count()); | 650   SetExpectedNofPropertiesFromEstimate(result, lit->expected_property_count()); | 
| 652 | 651 | 
| 653   script->set_compilation_state( | 652   script->set_compilation_state(Script::COMPILATION_STATE_COMPILED); | 
| 654       Smi::FromInt(Script::COMPILATION_STATE_COMPILED)); |  | 
| 655 | 653 | 
| 656 #ifdef ENABLE_DEBUGGER_SUPPORT | 654 #ifdef ENABLE_DEBUGGER_SUPPORT | 
| 657   // Notify debugger | 655   // Notify debugger | 
| 658   isolate->debugger()->OnAfterCompile( | 656   isolate->debugger()->OnAfterCompile( | 
| 659       script, Debugger::NO_AFTER_COMPILE_FLAGS); | 657       script, Debugger::NO_AFTER_COMPILE_FLAGS); | 
| 660 #endif | 658 #endif | 
| 661 | 659 | 
| 662   live_edit_tracker.RecordFunctionInfo(result, lit, info->zone()); | 660   live_edit_tracker.RecordFunctionInfo(result, lit, info->zone()); | 
| 663 | 661 | 
| 664   return result; | 662   return result; | 
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1252   // 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 | 
| 1253   // character is in the FLAG_trace_phase command line parameter. | 1251   // character is in the FLAG_trace_phase command line parameter. | 
| 1254   bool tracing_on = info()->IsStub() ? | 1252   bool tracing_on = info()->IsStub() ? | 
| 1255       FLAG_trace_hydrogen_stubs : | 1253       FLAG_trace_hydrogen_stubs : | 
| 1256       FLAG_trace_hydrogen; | 1254       FLAG_trace_hydrogen; | 
| 1257   return (tracing_on && | 1255   return (tracing_on && | 
| 1258       OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1256       OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 
| 1259 } | 1257 } | 
| 1260 | 1258 | 
| 1261 } }  // namespace v8::internal | 1259 } }  // namespace v8::internal | 
| OLD | NEW | 
|---|