OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 } | 202 } |
203 } | 203 } |
204 | 204 |
205 return result; | 205 return result; |
206 } | 206 } |
207 | 207 |
208 | 208 |
209 Handle<JSFunction> Compiler::CompileEval(Handle<String> source, | 209 Handle<JSFunction> Compiler::CompileEval(Handle<String> source, |
210 int line_offset, | 210 int line_offset, |
211 bool is_global) { | 211 bool is_global) { |
212 StringShape source_shape(*source); | 212 int source_length = source->length(); |
213 int source_length = source->length(source_shape); | |
214 Counters::total_eval_size.Increment(source_length); | 213 Counters::total_eval_size.Increment(source_length); |
215 Counters::total_compile_size.Increment(source_length); | 214 Counters::total_compile_size.Increment(source_length); |
216 | 215 |
217 // The VM is in the COMPILER state until exiting this function. | 216 // The VM is in the COMPILER state until exiting this function. |
218 VMState state(COMPILER); | 217 VMState state(COMPILER); |
219 CompilationCache::Entry entry = is_global | 218 CompilationCache::Entry entry = is_global |
220 ? CompilationCache::EVAL_GLOBAL | 219 ? CompilationCache::EVAL_GLOBAL |
221 : CompilationCache::EVAL_CONTEXTUAL; | 220 : CompilationCache::EVAL_CONTEXTUAL; |
222 | 221 |
223 // Do a lookup in the compilation cache; if the entry is not there, | 222 // Do a lookup in the compilation cache; if the entry is not there, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 // Set the expected number of properties for instances. | 290 // Set the expected number of properties for instances. |
292 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count()); | 291 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count()); |
293 | 292 |
294 // Check the function has compiled code. | 293 // Check the function has compiled code. |
295 ASSERT(shared->is_compiled()); | 294 ASSERT(shared->is_compiled()); |
296 return true; | 295 return true; |
297 } | 296 } |
298 | 297 |
299 | 298 |
300 } } // namespace v8::internal | 299 } } // namespace v8::internal |
OLD | NEW |