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

Side by Side Diff: src/compiler.cc

Issue 115024: Changelist for a readability review. Not for direct commit. (Closed)
Patch Set: Second round of changes Created 11 years, 7 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
« no previous file with comments | « src/codegen.cc ('k') | src/func-name-inferrer.h » ('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 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 // Check for stack-overflow exceptions. 121 // Check for stack-overflow exceptions.
122 if (code.is_null()) { 122 if (code.is_null()) {
123 Top::StackOverflow(); 123 Top::StackOverflow();
124 return Handle<JSFunction>::null(); 124 return Handle<JSFunction>::null();
125 } 125 }
126 126
127 #if defined ENABLE_LOGGING_AND_PROFILING || defined ENABLE_OPROFILE_AGENT 127 #if defined ENABLE_LOGGING_AND_PROFILING || defined ENABLE_OPROFILE_AGENT
128 // Log the code generation for the script. Check explicit whether logging is 128 // Log the code generation for the script. Check explicit whether logging is
129 // to avoid allocating when not required. 129 // to avoid allocating when not required.
130 if (Logger::is_enabled() || OProfileAgent::is_enabled()) { 130 if (Logger::IsEnabled() || OProfileAgent::is_enabled()) {
131 if (script->name()->IsString()) { 131 if (script->name()->IsString()) {
132 SmartPointer<char> data = 132 SmartPointer<char> data =
133 String::cast(script->name())->ToCString(DISALLOW_NULLS); 133 String::cast(script->name())->ToCString(DISALLOW_NULLS);
134 LOG(CodeCreateEvent(is_eval ? "Eval" : "Script", *code, *data)); 134 LOG(CodeCreateEvent(is_eval ? "Eval" : "Script", *code, *data));
135 OProfileAgent::CreateNativeCodeRegion(*data, code->address(), 135 OProfileAgent::CreateNativeCodeRegion(*data, code->address(),
136 code->ExecutableSize()); 136 code->ExecutableSize());
137 } else { 137 } else {
138 LOG(CodeCreateEvent(is_eval ? "Eval" : "Script", *code, "")); 138 LOG(CodeCreateEvent(is_eval ? "Eval" : "Script", *code, ""));
139 OProfileAgent::CreateNativeCodeRegion(is_eval ? "Eval" : "Script", 139 OProfileAgent::CreateNativeCodeRegion(is_eval ? "Eval" : "Script",
140 code->address(), code->ExecutableSize()); 140 code->address(), code->ExecutableSize());
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 // Check for stack-overflow exception. 308 // Check for stack-overflow exception.
309 if (code.is_null()) { 309 if (code.is_null()) {
310 Top::StackOverflow(); 310 Top::StackOverflow();
311 return false; 311 return false;
312 } 312 }
313 313
314 #if defined ENABLE_LOGGING_AND_PROFILING || defined ENABLE_OPROFILE_AGENT 314 #if defined ENABLE_LOGGING_AND_PROFILING || defined ENABLE_OPROFILE_AGENT
315 // Log the code generation. If source information is available include script 315 // Log the code generation. If source information is available include script
316 // name and line number. Check explicit whether logging is enabled as finding 316 // name and line number. Check explicit whether logging is enabled as finding
317 // the line number is not for free. 317 // the line number is not for free.
318 if (Logger::is_enabled() || OProfileAgent::is_enabled()) { 318 if (Logger::IsEnabled() || OProfileAgent::is_enabled()) {
319 if (script->name()->IsString()) { 319 if (script->name()->IsString()) {
320 int line_num = GetScriptLineNumber(script, start_position); 320 int line_num = GetScriptLineNumber(script, start_position);
321 if (line_num > 0) { 321 if (line_num > 0) {
322 line_num += script->line_offset()->value() + 1; 322 line_num += script->line_offset()->value() + 1;
323 } 323 }
324 LOG(CodeCreateEvent("LazyCompile", *code, *lit->name(), 324 LOG(CodeCreateEvent("LazyCompile", *code, *lit->name(),
325 String::cast(script->name()), line_num)); 325 String::cast(script->name()), line_num));
326 OProfileAgent::CreateNativeCodeRegion(*lit->name(), 326 OProfileAgent::CreateNativeCodeRegion(*lit->name(),
327 String::cast(script->name()), 327 String::cast(script->name()),
328 line_num, code->address(), 328 line_num, code->address(),
(...skipping 12 matching lines...) Expand all
341 // Set the expected number of properties for instances. 341 // Set the expected number of properties for instances.
342 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count()); 342 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count());
343 343
344 // Check the function has compiled code. 344 // Check the function has compiled code.
345 ASSERT(shared->is_compiled()); 345 ASSERT(shared->is_compiled());
346 return true; 346 return true;
347 } 347 }
348 348
349 349
350 } } // namespace v8::internal 350 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/codegen.cc ('k') | src/func-name-inferrer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698