| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // non-optimizable information for the code. When the code is | 169 // non-optimizable information for the code. When the code is |
| 170 // regenerated and set on the shared function info it is marked as | 170 // regenerated and set on the shared function info it is marked as |
| 171 // non-optimizable if optimization is disabled for the shared | 171 // non-optimizable if optimization is disabled for the shared |
| 172 // function info. | 172 // function info. |
| 173 Handle<SharedFunctionInfo> shared = info->shared_info(); | 173 Handle<SharedFunctionInfo> shared = info->shared_info(); |
| 174 shared->set_optimization_disabled(true); | 174 shared->set_optimization_disabled(true); |
| 175 Handle<Code> code = Handle<Code>(shared->code()); | 175 Handle<Code> code = Handle<Code>(shared->code()); |
| 176 ASSERT(code->kind() == Code::FUNCTION); | 176 ASSERT(code->kind() == Code::FUNCTION); |
| 177 code->set_optimizable(false); | 177 code->set_optimizable(false); |
| 178 info->SetCode(code); | 178 info->SetCode(code); |
| 179 Isolate* isolate = code->GetIsolate(); |
| 180 isolate->compilation_cache()->MarkForLazyOptimizing(info->closure()); |
| 179 if (FLAG_trace_opt) { | 181 if (FLAG_trace_opt) { |
| 180 PrintF("[disabled optimization for: "); | 182 PrintF("[disabled optimization for: "); |
| 181 info->closure()->PrintName(); | 183 info->closure()->PrintName(); |
| 182 PrintF(" / %" V8PRIxPTR "]\n", | 184 PrintF(" / %" V8PRIxPTR "]\n", |
| 183 reinterpret_cast<intptr_t>(*info->closure())); | 185 reinterpret_cast<intptr_t>(*info->closure())); |
| 184 } | 186 } |
| 185 } | 187 } |
| 186 | 188 |
| 187 | 189 |
| 188 static bool MakeCrankshaftCode(CompilationInfo* info) { | 190 static bool MakeCrankshaftCode(CompilationInfo* info) { |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 } | 533 } |
| 532 | 534 |
| 533 script->set_data(script_data.is_null() ? HEAP->undefined_value() | 535 script->set_data(script_data.is_null() ? HEAP->undefined_value() |
| 534 : *script_data); | 536 : *script_data); |
| 535 | 537 |
| 536 // Compile the function and add it to the cache. | 538 // Compile the function and add it to the cache. |
| 537 CompilationInfo info(script); | 539 CompilationInfo info(script); |
| 538 info.MarkAsGlobal(); | 540 info.MarkAsGlobal(); |
| 539 info.SetExtension(extension); | 541 info.SetExtension(extension); |
| 540 info.SetPreParseData(pre_data); | 542 info.SetPreParseData(pre_data); |
| 543 if (natives == NATIVES_CODE) info.MarkAsAllowingNativesSyntax(); |
| 541 result = MakeFunctionInfo(&info); | 544 result = MakeFunctionInfo(&info); |
| 542 if (extension == NULL && !result.is_null()) { | 545 if (extension == NULL && !result.is_null()) { |
| 543 compilation_cache->PutScript(source, result); | 546 compilation_cache->PutScript(source, result); |
| 544 } | 547 } |
| 545 | 548 |
| 546 // Get rid of the pre-parsing data (if necessary). | 549 // Get rid of the pre-parsing data (if necessary). |
| 547 if (input_pre_data == NULL && pre_data != NULL) { | 550 if (input_pre_data == NULL && pre_data != NULL) { |
| 548 delete pre_data; | 551 delete pre_data; |
| 549 } | 552 } |
| 550 } | 553 } |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 shared->DebugName())); | 818 shared->DebugName())); |
| 816 } | 819 } |
| 817 } | 820 } |
| 818 | 821 |
| 819 GDBJIT(AddCode(name, | 822 GDBJIT(AddCode(name, |
| 820 Handle<Script>(info->script()), | 823 Handle<Script>(info->script()), |
| 821 Handle<Code>(info->code()))); | 824 Handle<Code>(info->code()))); |
| 822 } | 825 } |
| 823 | 826 |
| 824 } } // namespace v8::internal | 827 } } // namespace v8::internal |
| OLD | NEW |