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

Side by Side Diff: src/compiler.cc

Issue 21041: Refactor code for determining line position in a source file.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 10 months 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/bootstrapper.cc ('k') | src/messages.js » ('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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 Top::StackOverflow(); 297 Top::StackOverflow();
298 return false; 298 return false;
299 } 299 }
300 300
301 #ifdef ENABLE_LOGGING_AND_PROFILING 301 #ifdef ENABLE_LOGGING_AND_PROFILING
302 // Log the code generation. If source information is available include script 302 // Log the code generation. If source information is available include script
303 // name and line number. Check explicit whether logging is enabled as finding 303 // name and line number. Check explicit whether logging is enabled as finding
304 // the line number is not for free. 304 // the line number is not for free.
305 if (Logger::is_enabled()) { 305 if (Logger::is_enabled()) {
306 if (script->name()->IsString()) { 306 if (script->name()->IsString()) {
307 int lineNum = script->GetLineNumber(start_position); 307 int line_num = script->GetLineNumber(start_position);
308 if (lineNum > 0) { 308 if (line_num > 0) {
309 lineNum += script->line_offset()->value() + 1; 309 line_num += script->line_offset()->value() + 1;
310 } 310 }
311 LOG(CodeCreateEvent("LazyCompile", *code, *lit->name(), 311 LOG(CodeCreateEvent("LazyCompile", *code, *lit->name(),
312 String::cast(script->name()), lineNum)); 312 String::cast(script->name()), line_num));
313 } else { 313 } else {
314 LOG(CodeCreateEvent("LazyCompile", *code, *lit->name())); 314 LOG(CodeCreateEvent("LazyCompile", *code, *lit->name()));
315 } 315 }
316 } 316 }
317 #endif 317 #endif
318 318
319 // Update the shared function info with the compiled code. 319 // Update the shared function info with the compiled code.
320 shared->set_code(*code); 320 shared->set_code(*code);
321 321
322 // Set the expected number of properties for instances. 322 // Set the expected number of properties for instances.
323 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count()); 323 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count());
324 324
325 // Check the function has compiled code. 325 // Check the function has compiled code.
326 ASSERT(shared->is_compiled()); 326 ASSERT(shared->is_compiled());
327 return true; 327 return true;
328 } 328 }
329 329
330 330
331 } } // namespace v8::internal 331 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698