| 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 cgen.Generate(); | 295 cgen.Generate(); |
| 296 if (cgen.HasStackOverflow()) { | 296 if (cgen.HasStackOverflow()) { |
| 297 ASSERT(!isolate->has_pending_exception()); | 297 ASSERT(!isolate->has_pending_exception()); |
| 298 return false; | 298 return false; |
| 299 } | 299 } |
| 300 unsigned table_offset = cgen.EmitStackCheckTable(); | 300 unsigned table_offset = cgen.EmitStackCheckTable(); |
| 301 | 301 |
| 302 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION); | 302 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION); |
| 303 Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&masm, flags, info); | 303 Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&masm, flags, info); |
| 304 code->set_optimizable(info->IsOptimizable()); | 304 code->set_optimizable(info->IsOptimizable()); |
| 305 code->set_self_optimization_header(cgen.has_self_optimization_header_); |
| 305 cgen.PopulateDeoptimizationData(code); | 306 cgen.PopulateDeoptimizationData(code); |
| 306 cgen.PopulateTypeFeedbackInfo(code); | 307 cgen.PopulateTypeFeedbackInfo(code); |
| 307 cgen.PopulateTypeFeedbackCells(code); | 308 cgen.PopulateTypeFeedbackCells(code); |
| 308 code->set_has_deoptimization_support(info->HasDeoptimizationSupport()); | 309 code->set_has_deoptimization_support(info->HasDeoptimizationSupport()); |
| 309 code->set_handler_table(*cgen.handler_table()); | 310 code->set_handler_table(*cgen.handler_table()); |
| 310 #ifdef ENABLE_DEBUGGER_SUPPORT | 311 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 311 code->set_has_debug_break_slots( | 312 code->set_has_debug_break_slots( |
| 312 info->isolate()->debugger()->IsDebuggerActive()); | 313 info->isolate()->debugger()->IsDebuggerActive()); |
| 313 code->set_compiled_optimizable(info->IsOptimizable()); | 314 code->set_compiled_optimizable(info->IsOptimizable()); |
| 314 #endif // ENABLE_DEBUGGER_SUPPORT | 315 #endif // ENABLE_DEBUGGER_SUPPORT |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 data->SetAstId(i, Smi::FromInt(bailout_entries_[i].id)); | 359 data->SetAstId(i, Smi::FromInt(bailout_entries_[i].id)); |
| 359 data->SetPcAndState(i, Smi::FromInt(bailout_entries_[i].pc_and_state)); | 360 data->SetPcAndState(i, Smi::FromInt(bailout_entries_[i].pc_and_state)); |
| 360 } | 361 } |
| 361 code->set_deoptimization_data(*data); | 362 code->set_deoptimization_data(*data); |
| 362 } | 363 } |
| 363 | 364 |
| 364 | 365 |
| 365 void FullCodeGenerator::PopulateTypeFeedbackInfo(Handle<Code> code) { | 366 void FullCodeGenerator::PopulateTypeFeedbackInfo(Handle<Code> code) { |
| 366 Handle<TypeFeedbackInfo> info = isolate()->factory()->NewTypeFeedbackInfo(); | 367 Handle<TypeFeedbackInfo> info = isolate()->factory()->NewTypeFeedbackInfo(); |
| 367 info->set_ic_total_count(ic_total_count_); | 368 info->set_ic_total_count(ic_total_count_); |
| 369 ASSERT(!isolate()->heap()->InNewSpace(*info)); |
| 368 code->set_type_feedback_info(*info); | 370 code->set_type_feedback_info(*info); |
| 369 } | 371 } |
| 370 | 372 |
| 371 | 373 |
| 372 void FullCodeGenerator::PopulateTypeFeedbackCells(Handle<Code> code) { | 374 void FullCodeGenerator::PopulateTypeFeedbackCells(Handle<Code> code) { |
| 373 if (type_feedback_cells_.is_empty()) return; | 375 if (type_feedback_cells_.is_empty()) return; |
| 374 int length = type_feedback_cells_.length(); | 376 int length = type_feedback_cells_.length(); |
| 375 int array_size = TypeFeedbackCells::LengthOfFixedArray(length); | 377 int array_size = TypeFeedbackCells::LengthOfFixedArray(length); |
| 376 Handle<TypeFeedbackCells> cache = Handle<TypeFeedbackCells>::cast( | 378 Handle<TypeFeedbackCells> cache = Handle<TypeFeedbackCells>::cast( |
| 377 isolate()->factory()->NewFixedArray(array_size, TENURED)); | 379 isolate()->factory()->NewFixedArray(array_size, TENURED)); |
| (...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1390 } | 1392 } |
| 1391 | 1393 |
| 1392 return false; | 1394 return false; |
| 1393 } | 1395 } |
| 1394 | 1396 |
| 1395 | 1397 |
| 1396 #undef __ | 1398 #undef __ |
| 1397 | 1399 |
| 1398 | 1400 |
| 1399 } } // namespace v8::internal | 1401 } } // namespace v8::internal |
| OLD | NEW |