Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/compiler.cc

Issue 9181: Push string shape fixes to trunk (version 0.4.3.1). (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/api.cc ('k') | src/conversions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/conversions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698