| 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 7451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7462 ASSERT(function->shared()->allows_lazy_compilation()); | 7462 ASSERT(function->shared()->allows_lazy_compilation()); |
| 7463 CompilationInfoWithZone info(function); | 7463 CompilationInfoWithZone info(function); |
| 7464 result = CompileLazyHelper(&info, flag); | 7464 result = CompileLazyHelper(&info, flag); |
| 7465 ASSERT(!result || function->is_compiled()); | 7465 ASSERT(!result || function->is_compiled()); |
| 7466 } | 7466 } |
| 7467 return result; | 7467 return result; |
| 7468 } | 7468 } |
| 7469 | 7469 |
| 7470 | 7470 |
| 7471 bool JSFunction::CompileOptimized(Handle<JSFunction> function, | 7471 bool JSFunction::CompileOptimized(Handle<JSFunction> function, |
| 7472 int osr_ast_id, | 7472 BailoutId osr_ast_id, |
| 7473 ClearExceptionFlag flag) { | 7473 ClearExceptionFlag flag) { |
| 7474 CompilationInfoWithZone info(function); | 7474 CompilationInfoWithZone info(function); |
| 7475 info.SetOptimizing(osr_ast_id); | 7475 info.SetOptimizing(osr_ast_id); |
| 7476 return CompileLazyHelper(&info, flag); | 7476 return CompileLazyHelper(&info, flag); |
| 7477 } | 7477 } |
| 7478 | 7478 |
| 7479 | 7479 |
| 7480 bool JSFunction::EnsureCompiled(Handle<JSFunction> function, | 7480 bool JSFunction::EnsureCompiled(Handle<JSFunction> function, |
| 7481 ClearExceptionFlag flag) { | 7481 ClearExceptionFlag flag) { |
| 7482 return function->is_compiled() || CompileLazy(function, flag); | 7482 return function->is_compiled() || CompileLazy(function, flag); |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7863 ASSERT(code()->kind() == Code::FUNCTION || code()->kind() == Code::BUILTIN); | 7863 ASSERT(code()->kind() == Code::FUNCTION || code()->kind() == Code::BUILTIN); |
| 7864 if (code()->kind() == Code::FUNCTION) { | 7864 if (code()->kind() == Code::FUNCTION) { |
| 7865 code()->set_optimizable(false); | 7865 code()->set_optimizable(false); |
| 7866 } | 7866 } |
| 7867 if (FLAG_trace_opt) { | 7867 if (FLAG_trace_opt) { |
| 7868 PrintF("[disabled optimization for %s]\n", *DebugName()->ToCString()); | 7868 PrintF("[disabled optimization for %s]\n", *DebugName()->ToCString()); |
| 7869 } | 7869 } |
| 7870 } | 7870 } |
| 7871 | 7871 |
| 7872 | 7872 |
| 7873 bool SharedFunctionInfo::VerifyBailoutId(int id) { | 7873 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) { |
| 7874 ASSERT(id != AstNode::kNoNumber); | 7874 ASSERT(!id.IsNone()); |
| 7875 Code* unoptimized = code(); | 7875 Code* unoptimized = code(); |
| 7876 DeoptimizationOutputData* data = | 7876 DeoptimizationOutputData* data = |
| 7877 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); | 7877 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); |
| 7878 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this); | 7878 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this); |
| 7879 USE(ignore); | 7879 USE(ignore); |
| 7880 return true; // Return true if there was no ASSERT. | 7880 return true; // Return true if there was no ASSERT. |
| 7881 } | 7881 } |
| 7882 | 7882 |
| 7883 | 7883 |
| 7884 void SharedFunctionInfo::StartInobjectSlackTracking(Map* map) { | 7884 void SharedFunctionInfo::StartInobjectSlackTracking(Map* map) { |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8242 } | 8242 } |
| 8243 } | 8243 } |
| 8244 | 8244 |
| 8245 | 8245 |
| 8246 void Code::ClearTypeFeedbackCells(Heap* heap) { | 8246 void Code::ClearTypeFeedbackCells(Heap* heap) { |
| 8247 Object* raw_info = type_feedback_info(); | 8247 Object* raw_info = type_feedback_info(); |
| 8248 if (raw_info->IsTypeFeedbackInfo()) { | 8248 if (raw_info->IsTypeFeedbackInfo()) { |
| 8249 TypeFeedbackCells* type_feedback_cells = | 8249 TypeFeedbackCells* type_feedback_cells = |
| 8250 TypeFeedbackInfo::cast(raw_info)->type_feedback_cells(); | 8250 TypeFeedbackInfo::cast(raw_info)->type_feedback_cells(); |
| 8251 for (int i = 0; i < type_feedback_cells->CellCount(); i++) { | 8251 for (int i = 0; i < type_feedback_cells->CellCount(); i++) { |
| 8252 ASSERT(type_feedback_cells->AstId(i)->IsSmi()); | |
| 8253 JSGlobalPropertyCell* cell = type_feedback_cells->Cell(i); | 8252 JSGlobalPropertyCell* cell = type_feedback_cells->Cell(i); |
| 8254 cell->set_value(TypeFeedbackCells::RawUninitializedSentinel(heap)); | 8253 cell->set_value(TypeFeedbackCells::RawUninitializedSentinel(heap)); |
| 8255 } | 8254 } |
| 8256 } | 8255 } |
| 8257 } | 8256 } |
| 8258 | 8257 |
| 8259 | 8258 |
| 8260 bool Code::allowed_in_shared_map_code_cache() { | 8259 bool Code::allowed_in_shared_map_code_cache() { |
| 8261 return is_keyed_load_stub() || is_keyed_store_stub() || | 8260 return is_keyed_load_stub() || is_keyed_store_stub() || |
| 8262 (is_compare_ic_stub() && compare_state() == CompareIC::KNOWN_OBJECTS); | 8261 (is_compare_ic_stub() && compare_state() == CompareIC::KNOWN_OBJECTS); |
| 8263 } | 8262 } |
| 8264 | 8263 |
| 8265 | 8264 |
| 8266 #ifdef ENABLE_DISASSEMBLER | 8265 #ifdef ENABLE_DISASSEMBLER |
| 8267 | 8266 |
| 8268 void DeoptimizationInputData::DeoptimizationInputDataPrint(FILE* out) { | 8267 void DeoptimizationInputData::DeoptimizationInputDataPrint(FILE* out) { |
| 8269 disasm::NameConverter converter; | 8268 disasm::NameConverter converter; |
| 8270 int deopt_count = DeoptCount(); | 8269 int deopt_count = DeoptCount(); |
| 8271 PrintF(out, "Deoptimization Input Data (deopt points = %d)\n", deopt_count); | 8270 PrintF(out, "Deoptimization Input Data (deopt points = %d)\n", deopt_count); |
| 8272 if (0 == deopt_count) return; | 8271 if (0 == deopt_count) return; |
| 8273 | 8272 |
| 8274 PrintF(out, "%6s %6s %6s %6s %12s\n", "index", "ast id", "argc", "pc", | 8273 PrintF(out, "%6s %6s %6s %6s %12s\n", "index", "ast id", "argc", "pc", |
| 8275 FLAG_print_code_verbose ? "commands" : ""); | 8274 FLAG_print_code_verbose ? "commands" : ""); |
| 8276 for (int i = 0; i < deopt_count; i++) { | 8275 for (int i = 0; i < deopt_count; i++) { |
| 8277 PrintF(out, "%6d %6d %6d %6d", | 8276 PrintF(out, "%6d %6d %6d %6d", |
| 8278 i, | 8277 i, |
| 8279 AstId(i)->value(), | 8278 AstId(i).ToInt(), |
| 8280 ArgumentsStackHeight(i)->value(), | 8279 ArgumentsStackHeight(i)->value(), |
| 8281 Pc(i)->value()); | 8280 Pc(i)->value()); |
| 8282 | 8281 |
| 8283 if (!FLAG_print_code_verbose) { | 8282 if (!FLAG_print_code_verbose) { |
| 8284 PrintF(out, "\n"); | 8283 PrintF(out, "\n"); |
| 8285 continue; | 8284 continue; |
| 8286 } | 8285 } |
| 8287 // Print details of the frame translation. | 8286 // Print details of the frame translation. |
| 8288 int translation_index = TranslationIndex(i)->value(); | 8287 int translation_index = TranslationIndex(i)->value(); |
| 8289 TranslationIterator iterator(TranslationByteArray(), translation_index); | 8288 TranslationIterator iterator(TranslationByteArray(), translation_index); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8391 | 8390 |
| 8392 void DeoptimizationOutputData::DeoptimizationOutputDataPrint(FILE* out) { | 8391 void DeoptimizationOutputData::DeoptimizationOutputDataPrint(FILE* out) { |
| 8393 PrintF(out, "Deoptimization Output Data (deopt points = %d)\n", | 8392 PrintF(out, "Deoptimization Output Data (deopt points = %d)\n", |
| 8394 this->DeoptPoints()); | 8393 this->DeoptPoints()); |
| 8395 if (this->DeoptPoints() == 0) return; | 8394 if (this->DeoptPoints() == 0) return; |
| 8396 | 8395 |
| 8397 PrintF("%6s %8s %s\n", "ast id", "pc", "state"); | 8396 PrintF("%6s %8s %s\n", "ast id", "pc", "state"); |
| 8398 for (int i = 0; i < this->DeoptPoints(); i++) { | 8397 for (int i = 0; i < this->DeoptPoints(); i++) { |
| 8399 int pc_and_state = this->PcAndState(i)->value(); | 8398 int pc_and_state = this->PcAndState(i)->value(); |
| 8400 PrintF("%6d %8d %s\n", | 8399 PrintF("%6d %8d %s\n", |
| 8401 this->AstId(i)->value(), | 8400 this->AstId(i).ToInt(), |
| 8402 FullCodeGenerator::PcField::decode(pc_and_state), | 8401 FullCodeGenerator::PcField::decode(pc_and_state), |
| 8403 FullCodeGenerator::State2String( | 8402 FullCodeGenerator::State2String( |
| 8404 FullCodeGenerator::StateField::decode(pc_and_state))); | 8403 FullCodeGenerator::StateField::decode(pc_and_state))); |
| 8405 } | 8404 } |
| 8406 } | 8405 } |
| 8407 | 8406 |
| 8408 | 8407 |
| 8409 // Identify kind of code. | 8408 // Identify kind of code. |
| 8410 const char* Code::Kind2String(Kind kind) { | 8409 const char* Code::Kind2String(Kind kind) { |
| 8411 switch (kind) { | 8410 switch (kind) { |
| (...skipping 4762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13174 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 13173 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
| 13175 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 13174 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
| 13176 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 13175 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
| 13177 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 13176 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
| 13178 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 13177 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
| 13179 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 13178 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
| 13180 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 13179 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
| 13181 } | 13180 } |
| 13182 | 13181 |
| 13183 } } // namespace v8::internal | 13182 } } // namespace v8::internal |
| OLD | NEW |