OLD | NEW |
---|---|
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
172 #ifdef ENABLE_DEBUGGER_SUPPORT | 172 #ifdef ENABLE_DEBUGGER_SUPPORT |
173 bool is_json = (validate == Compiler::VALIDATE_JSON); | 173 bool is_json = (validate == Compiler::VALIDATE_JSON); |
174 if (is_eval || is_json) { | 174 if (is_eval || is_json) { |
175 script->set_compilation_type( | 175 script->set_compilation_type( |
176 is_json ? Smi::FromInt(Script::COMPILATION_TYPE_JSON) : | 176 is_json ? Smi::FromInt(Script::COMPILATION_TYPE_JSON) : |
177 Smi::FromInt(Script::COMPILATION_TYPE_EVAL)); | 177 Smi::FromInt(Script::COMPILATION_TYPE_EVAL)); |
178 // For eval scripts add information on the function from which eval was | 178 // For eval scripts add information on the function from which eval was |
179 // called. | 179 // called. |
180 if (is_eval) { | 180 if (is_eval) { |
181 JavaScriptFrameIterator it; | 181 JavaScriptFrameIterator it; |
182 script->set_eval_from_function(it.frame()->function()); | 182 if (it.frame()->function()->IsJSFunction()) |
Mads Ager (chromium)
2009/12/01 14:43:12
Is this conditional needed? If it is indentation
| |
183 script->set_eval_from_shared( | |
184 JSFunction::cast(it.frame()->function())->shared()); | |
183 int offset = static_cast<int>( | 185 int offset = static_cast<int>( |
184 it.frame()->pc() - it.frame()->code()->instruction_start()); | 186 it.frame()->pc() - it.frame()->code()->instruction_start()); |
185 script->set_eval_from_instructions_offset(Smi::FromInt(offset)); | 187 script->set_eval_from_instructions_offset(Smi::FromInt(offset)); |
186 } | 188 } |
187 } | 189 } |
188 | 190 |
189 // Notify debugger | 191 // Notify debugger |
190 Debugger::OnBeforeCompile(script); | 192 Debugger::OnBeforeCompile(script); |
191 #endif | 193 #endif |
192 | 194 |
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1118 | 1120 |
1119 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) { | 1121 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) { |
1120 BAILOUT("ThisFunction"); | 1122 BAILOUT("ThisFunction"); |
1121 } | 1123 } |
1122 | 1124 |
1123 #undef BAILOUT | 1125 #undef BAILOUT |
1124 #undef CHECK_BAILOUT | 1126 #undef CHECK_BAILOUT |
1125 | 1127 |
1126 | 1128 |
1127 } } // namespace v8::internal | 1129 } } // namespace v8::internal |
OLD | NEW |