| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 if (!isolate->has_pending_exception()) isolate->StackOverflow(); | 546 if (!isolate->has_pending_exception()) isolate->StackOverflow(); |
| 547 return Handle<SharedFunctionInfo>::null(); | 547 return Handle<SharedFunctionInfo>::null(); |
| 548 } | 548 } |
| 549 | 549 |
| 550 // Allocate function. | 550 // Allocate function. |
| 551 ASSERT(!info->code().is_null()); | 551 ASSERT(!info->code().is_null()); |
| 552 Handle<SharedFunctionInfo> result = | 552 Handle<SharedFunctionInfo> result = |
| 553 isolate->factory()->NewSharedFunctionInfo( | 553 isolate->factory()->NewSharedFunctionInfo( |
| 554 lit->name(), | 554 lit->name(), |
| 555 lit->materialized_literal_count(), | 555 lit->materialized_literal_count(), |
| 556 lit->is_generator(), |
| 556 info->code(), | 557 info->code(), |
| 557 ScopeInfo::Create(info->scope(), info->zone())); | 558 ScopeInfo::Create(info->scope(), info->zone())); |
| 558 | 559 |
| 559 ASSERT_EQ(RelocInfo::kNoPosition, lit->function_token_position()); | 560 ASSERT_EQ(RelocInfo::kNoPosition, lit->function_token_position()); |
| 560 Compiler::SetFunctionInfo(result, lit, true, script); | 561 Compiler::SetFunctionInfo(result, lit, true, script); |
| 561 | 562 |
| 562 if (script->name()->IsString()) { | 563 if (script->name()->IsString()) { |
| 563 PROFILE(isolate, CodeCreateEvent( | 564 PROFILE(isolate, CodeCreateEvent( |
| 564 info->is_eval() | 565 info->is_eval() |
| 565 ? Logger::EVAL_TAG | 566 ? Logger::EVAL_TAG |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 ASSERT(!info.code().is_null()); | 1068 ASSERT(!info.code().is_null()); |
| 1068 scope_info = ScopeInfo::Create(info.scope(), info.zone()); | 1069 scope_info = ScopeInfo::Create(info.scope(), info.zone()); |
| 1069 } else { | 1070 } else { |
| 1070 return Handle<SharedFunctionInfo>::null(); | 1071 return Handle<SharedFunctionInfo>::null(); |
| 1071 } | 1072 } |
| 1072 | 1073 |
| 1073 // Create a shared function info object. | 1074 // Create a shared function info object. |
| 1074 Handle<SharedFunctionInfo> result = | 1075 Handle<SharedFunctionInfo> result = |
| 1075 FACTORY->NewSharedFunctionInfo(literal->name(), | 1076 FACTORY->NewSharedFunctionInfo(literal->name(), |
| 1076 literal->materialized_literal_count(), | 1077 literal->materialized_literal_count(), |
| 1078 literal->is_generator(), |
| 1077 info.code(), | 1079 info.code(), |
| 1078 scope_info); | 1080 scope_info); |
| 1079 SetFunctionInfo(result, literal, false, script); | 1081 SetFunctionInfo(result, literal, false, script); |
| 1080 RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, result); | 1082 RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, result); |
| 1081 result->set_allows_lazy_compilation(allow_lazy); | 1083 result->set_allows_lazy_compilation(allow_lazy); |
| 1082 result->set_allows_lazy_compilation_without_context(allow_lazy_without_ctx); | 1084 result->set_allows_lazy_compilation_without_context(allow_lazy_without_ctx); |
| 1083 | 1085 |
| 1084 // Set the expected number of properties for instances and return | 1086 // Set the expected number of properties for instances and return |
| 1085 // the resulting function. | 1087 // the resulting function. |
| 1086 SetExpectedNofPropertiesFromEstimate(result, | 1088 SetExpectedNofPropertiesFromEstimate(result, |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1159 } | 1161 } |
| 1160 } | 1162 } |
| 1161 | 1163 |
| 1162 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 1164 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
| 1163 Handle<Script>(info->script()), | 1165 Handle<Script>(info->script()), |
| 1164 Handle<Code>(info->code()), | 1166 Handle<Code>(info->code()), |
| 1165 info)); | 1167 info)); |
| 1166 } | 1168 } |
| 1167 | 1169 |
| 1168 } } // namespace v8::internal | 1170 } } // namespace v8::internal |
| OLD | NEW |