| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 isolate->factory()->NewSharedFunctionInfo( | 427 isolate->factory()->NewSharedFunctionInfo( |
| 428 lit->name(), | 428 lit->name(), |
| 429 lit->materialized_literal_count(), | 429 lit->materialized_literal_count(), |
| 430 info->code(), | 430 info->code(), |
| 431 SerializedScopeInfo::Create(info->scope())); | 431 SerializedScopeInfo::Create(info->scope())); |
| 432 | 432 |
| 433 ASSERT_EQ(RelocInfo::kNoPosition, lit->function_token_position()); | 433 ASSERT_EQ(RelocInfo::kNoPosition, lit->function_token_position()); |
| 434 Compiler::SetFunctionInfo(result, lit, true, script); | 434 Compiler::SetFunctionInfo(result, lit, true, script); |
| 435 | 435 |
| 436 if (script->name()->IsString()) { | 436 if (script->name()->IsString()) { |
| 437 PROFILE(CodeCreateEvent( | 437 PROFILE(isolate, CodeCreateEvent( |
| 438 info->is_eval() | 438 info->is_eval() |
| 439 ? Logger::EVAL_TAG | 439 ? Logger::EVAL_TAG |
| 440 : Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script), | 440 : Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script), |
| 441 *info->code(), | 441 *info->code(), |
| 442 *result, | 442 *result, |
| 443 String::cast(script->name()))); | 443 String::cast(script->name()))); |
| 444 GDBJIT(AddCode(Handle<String>(String::cast(script->name())), | 444 GDBJIT(AddCode(Handle<String>(String::cast(script->name())), |
| 445 script, | 445 script, |
| 446 info->code())); | 446 info->code())); |
| 447 } else { | 447 } else { |
| 448 PROFILE(CodeCreateEvent( | 448 PROFILE(isolate, CodeCreateEvent( |
| 449 info->is_eval() | 449 info->is_eval() |
| 450 ? Logger::EVAL_TAG | 450 ? Logger::EVAL_TAG |
| 451 : Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script), | 451 : Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script), |
| 452 *info->code(), | 452 *info->code(), |
| 453 *result, | 453 *result, |
| 454 isolate->heap()->empty_string())); | 454 isolate->heap()->empty_string())); |
| 455 GDBJIT(AddCode(Handle<String>(), script, info->code())); | 455 GDBJIT(AddCode(Handle<String>(), script, info->code())); |
| 456 } | 456 } |
| 457 | 457 |
| 458 // Hint to the runtime system used when allocating space for initial | 458 // Hint to the runtime system used when allocating space for initial |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 // script name and line number. Check explicitly whether logging is | 799 // script name and line number. Check explicitly whether logging is |
| 800 // enabled as finding the line number is not free. | 800 // enabled as finding the line number is not free. |
| 801 if (info->isolate()->logger()->is_logging() || CpuProfiler::is_profiling()) { | 801 if (info->isolate()->logger()->is_logging() || CpuProfiler::is_profiling()) { |
| 802 Handle<Script> script = info->script(); | 802 Handle<Script> script = info->script(); |
| 803 Handle<Code> code = info->code(); | 803 Handle<Code> code = info->code(); |
| 804 if (*code == info->isolate()->builtins()->builtin(Builtins::LazyCompile)) | 804 if (*code == info->isolate()->builtins()->builtin(Builtins::LazyCompile)) |
| 805 return; | 805 return; |
| 806 if (script->name()->IsString()) { | 806 if (script->name()->IsString()) { |
| 807 int line_num = GetScriptLineNumber(script, shared->start_position()) + 1; | 807 int line_num = GetScriptLineNumber(script, shared->start_position()) + 1; |
| 808 USE(line_num); | 808 USE(line_num); |
| 809 PROFILE(CodeCreateEvent(Logger::ToNativeByScript(tag, *script), | 809 PROFILE(info->isolate(), |
| 810 CodeCreateEvent(Logger::ToNativeByScript(tag, *script), |
| 810 *code, | 811 *code, |
| 811 *shared, | 812 *shared, |
| 812 String::cast(script->name()), | 813 String::cast(script->name()), |
| 813 line_num)); | 814 line_num)); |
| 814 } else { | 815 } else { |
| 815 PROFILE(CodeCreateEvent(Logger::ToNativeByScript(tag, *script), | 816 PROFILE(info->isolate(), |
| 817 CodeCreateEvent(Logger::ToNativeByScript(tag, *script), |
| 816 *code, | 818 *code, |
| 817 *shared, | 819 *shared, |
| 818 shared->DebugName())); | 820 shared->DebugName())); |
| 819 } | 821 } |
| 820 } | 822 } |
| 821 | 823 |
| 822 GDBJIT(AddCode(name, | 824 GDBJIT(AddCode(name, |
| 823 Handle<Script>(info->script()), | 825 Handle<Script>(info->script()), |
| 824 Handle<Code>(info->code()))); | 826 Handle<Code>(info->code()))); |
| 825 } | 827 } |
| 826 | 828 |
| 827 } } // namespace v8::internal | 829 } } // namespace v8::internal |
| OLD | NEW |