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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 bool is_json = (validate == Compiler::VALIDATE_JSON); | 170 bool is_json = (validate == Compiler::VALIDATE_JSON); |
171 if (is_eval || is_json) { | 171 if (is_eval || is_json) { |
172 script->set_compilation_type( | 172 script->set_compilation_type( |
173 is_json ? Smi::FromInt(Script::COMPILATION_TYPE_JSON) : | 173 is_json ? Smi::FromInt(Script::COMPILATION_TYPE_JSON) : |
174 Smi::FromInt(Script::COMPILATION_TYPE_EVAL)); | 174 Smi::FromInt(Script::COMPILATION_TYPE_EVAL)); |
175 // For eval scripts add information on the function from which eval was | 175 // For eval scripts add information on the function from which eval was |
176 // called. | 176 // called. |
177 if (is_eval) { | 177 if (is_eval) { |
178 JavaScriptFrameIterator it; | 178 JavaScriptFrameIterator it; |
179 script->set_eval_from_function(it.frame()->function()); | 179 script->set_eval_from_function(it.frame()->function()); |
180 int offset = it.frame()->pc() - it.frame()->code()->instruction_start(); | 180 int offset = static_cast<int>( |
| 181 it.frame()->pc() - it.frame()->code()->instruction_start()); |
181 script->set_eval_from_instructions_offset(Smi::FromInt(offset)); | 182 script->set_eval_from_instructions_offset(Smi::FromInt(offset)); |
182 } | 183 } |
183 } | 184 } |
184 | 185 |
185 // Notify debugger | 186 // Notify debugger |
186 Debugger::OnBeforeCompile(script); | 187 Debugger::OnBeforeCompile(script); |
187 #endif | 188 #endif |
188 | 189 |
189 // Only allow non-global compiles for eval. | 190 // Only allow non-global compiles for eval. |
190 ASSERT(is_eval || is_global); | 191 ASSERT(is_eval || is_global); |
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 | 1109 |
1109 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) { | 1110 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) { |
1110 BAILOUT("ThisFunction"); | 1111 BAILOUT("ThisFunction"); |
1111 } | 1112 } |
1112 | 1113 |
1113 #undef BAILOUT | 1114 #undef BAILOUT |
1114 #undef CHECK_BAILOUT | 1115 #undef CHECK_BAILOUT |
1115 | 1116 |
1116 | 1117 |
1117 } } // namespace v8::internal | 1118 } } // namespace v8::internal |
OLD | NEW |