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

Unified Diff: src/compiler.cc

Issue 9038: Create an abstraction for the string type flags so that they can be cached.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/codegen.cc ('k') | src/conversions.cc » ('j') | src/conversions.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
===================================================================
--- src/compiler.cc (revision 654)
+++ src/compiler.cc (working copy)
@@ -157,8 +157,9 @@
int line_offset, int column_offset,
v8::Extension* extension,
ScriptDataImpl* input_pre_data) {
- Counters::total_load_size.Increment(source->length());
- Counters::total_compile_size.Increment(source->length());
+ StringShape source_shape(*source);
Mads Ager (chromium) 2008/11/03 08:45:49 Pull out source_length in a variable here as you d
+ Counters::total_load_size.Increment(source->length(source_shape));
+ Counters::total_compile_size.Increment(source->length(source_shape));
// The VM is in the COMPILER state until exiting this function.
VMState state(COMPILER);
@@ -175,7 +176,8 @@
if (result.is_null()) {
// No cache entry found. Do pre-parsing and compile the script.
ScriptDataImpl* pre_data = input_pre_data;
- if (pre_data == NULL && source->length() >= FLAG_min_preparse_length) {
+ if (pre_data == NULL &&
+ source->length(source_shape) >= FLAG_min_preparse_length) {
Access<SafeStringInputBuffer> buf(&safe_string_input_buffer);
buf->Reset(source.location());
pre_data = PreParse(buf.value(), extension);
@@ -208,8 +210,10 @@
Handle<JSFunction> Compiler::CompileEval(Handle<String> source,
int line_offset,
bool is_global) {
- Counters::total_eval_size.Increment(source->length());
- Counters::total_compile_size.Increment(source->length());
+ StringShape source_shape(*source);
+ int source_length = source->length(source_shape);
+ Counters::total_eval_size.Increment(source_length);
+ Counters::total_compile_size.Increment(source_length);
// The VM is in the COMPILER state until exiting this function.
VMState state(COMPILER);
« no previous file with comments | « src/codegen.cc ('k') | src/conversions.cc » ('j') | src/conversions.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698