OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |