| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 if (IsStub()) { | 137 if (IsStub()) { |
| 138 return 0; | 138 return 0; |
| 139 } else { | 139 } else { |
| 140 return scope()->num_heap_slots(); | 140 return scope()->num_heap_slots(); |
| 141 } | 141 } |
| 142 } | 142 } |
| 143 | 143 |
| 144 | 144 |
| 145 Code::Flags CompilationInfo::flags() const { | 145 Code::Flags CompilationInfo::flags() const { |
| 146 if (IsStub()) { | 146 if (IsStub()) { |
| 147 return Code::ComputeFlags(Code::COMPILED_STUB); | 147 return Code::ComputeFlags(code_stub()->GetCodeKind(), |
| 148 code_stub()->GetICState(), |
| 149 code_stub()->GetExtraICState(), |
| 150 Code::NORMAL, |
| 151 0); |
| 148 } else { | 152 } else { |
| 149 return Code::ComputeFlags(Code::OPTIMIZED_FUNCTION); | 153 return Code::ComputeFlags(Code::OPTIMIZED_FUNCTION); |
| 150 } | 154 } |
| 151 } | 155 } |
| 152 | 156 |
| 153 | 157 |
| 154 // Disable optimization for the rest of the compilation pipeline. | 158 // Disable optimization for the rest of the compilation pipeline. |
| 155 void CompilationInfo::DisableOptimization() { | 159 void CompilationInfo::DisableOptimization() { |
| 156 bool is_optimizable_closure = | 160 bool is_optimizable_closure = |
| 157 FLAG_optimize_closures && | 161 FLAG_optimize_closures && |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 return SetLastStatus(SUCCEEDED); | 418 return SetLastStatus(SUCCEEDED); |
| 415 } | 419 } |
| 416 | 420 |
| 417 | 421 |
| 418 OptimizingCompiler::Status OptimizingCompiler::GenerateAndInstallCode() { | 422 OptimizingCompiler::Status OptimizingCompiler::GenerateAndInstallCode() { |
| 419 ASSERT(last_status() == SUCCEEDED); | 423 ASSERT(last_status() == SUCCEEDED); |
| 420 { // Scope for timer. | 424 { // Scope for timer. |
| 421 Timer timer(this, &time_taken_to_codegen_); | 425 Timer timer(this, &time_taken_to_codegen_); |
| 422 ASSERT(chunk_ != NULL); | 426 ASSERT(chunk_ != NULL); |
| 423 ASSERT(graph_ != NULL); | 427 ASSERT(graph_ != NULL); |
| 424 Handle<Code> optimized_code = chunk_->Codegen(Code::OPTIMIZED_FUNCTION); | 428 Handle<Code> optimized_code = chunk_->Codegen(); |
| 425 if (optimized_code.is_null()) { | 429 if (optimized_code.is_null()) { |
| 426 info()->set_bailout_reason("code generation failed"); | 430 info()->set_bailout_reason("code generation failed"); |
| 427 return AbortOptimization(); | 431 return AbortOptimization(); |
| 428 } | 432 } |
| 429 info()->SetCode(optimized_code); | 433 info()->SetCode(optimized_code); |
| 430 } | 434 } |
| 431 RecordOptimizationStats(); | 435 RecordOptimizationStats(); |
| 432 return SetLastStatus(SUCCEEDED); | 436 return SetLastStatus(SUCCEEDED); |
| 433 } | 437 } |
| 434 | 438 |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1161 } | 1165 } |
| 1162 } | 1166 } |
| 1163 | 1167 |
| 1164 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 1168 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
| 1165 Handle<Script>(info->script()), | 1169 Handle<Script>(info->script()), |
| 1166 Handle<Code>(info->code()), | 1170 Handle<Code>(info->code()), |
| 1167 info)); | 1171 info)); |
| 1168 } | 1172 } |
| 1169 | 1173 |
| 1170 } } // namespace v8::internal | 1174 } } // namespace v8::internal |
| OLD | NEW |