| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 ? Script::COMPILATION_TYPE_JSON | 162 ? Script::COMPILATION_TYPE_JSON |
| 163 : Script::COMPILATION_TYPE_EVAL; | 163 : Script::COMPILATION_TYPE_EVAL; |
| 164 script->set_compilation_type(Smi::FromInt(compilation_type)); | 164 script->set_compilation_type(Smi::FromInt(compilation_type)); |
| 165 // For eval scripts add information on the function from which eval was | 165 // For eval scripts add information on the function from which eval was |
| 166 // called. | 166 // called. |
| 167 if (info->is_eval()) { | 167 if (info->is_eval()) { |
| 168 StackTraceFrameIterator it; | 168 StackTraceFrameIterator it; |
| 169 if (!it.done()) { | 169 if (!it.done()) { |
| 170 script->set_eval_from_shared( | 170 script->set_eval_from_shared( |
| 171 JSFunction::cast(it.frame()->function())->shared()); | 171 JSFunction::cast(it.frame()->function())->shared()); |
| 172 Code* code = it.frame()->LookupCode(isolate); |
| 172 int offset = static_cast<int>( | 173 int offset = static_cast<int>( |
| 173 it.frame()->pc() - it.frame()->code()->instruction_start()); | 174 it.frame()->pc() - code->instruction_start()); |
| 174 script->set_eval_from_instructions_offset(Smi::FromInt(offset)); | 175 script->set_eval_from_instructions_offset(Smi::FromInt(offset)); |
| 175 } | 176 } |
| 176 } | 177 } |
| 177 } | 178 } |
| 178 | 179 |
| 179 // Notify debugger | 180 // Notify debugger |
| 180 isolate->debugger()->OnBeforeCompile(script); | 181 isolate->debugger()->OnBeforeCompile(script); |
| 181 #endif | 182 #endif |
| 182 | 183 |
| 183 // Only allow non-global compiles for eval. | 184 // Only allow non-global compiles for eval. |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 *code, | 580 *code, |
| 580 *name)); | 581 *name)); |
| 581 OPROFILE(CreateNativeCodeRegion(*name, | 582 OPROFILE(CreateNativeCodeRegion(*name, |
| 582 code->instruction_start(), | 583 code->instruction_start(), |
| 583 code->instruction_size())); | 584 code->instruction_size())); |
| 584 } | 585 } |
| 585 } | 586 } |
| 586 } | 587 } |
| 587 | 588 |
| 588 } } // namespace v8::internal | 589 } } // namespace v8::internal |
| OLD | NEW |