OLD | NEW |
---|---|
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 4907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4918 | 4918 |
4919 if (type == kUseCell && | 4919 if (type == kUseCell && |
4920 current_info()->global_object()->IsAccessCheckNeeded()) { | 4920 current_info()->global_object()->IsAccessCheckNeeded()) { |
4921 type = kUseGeneric; | 4921 type = kUseGeneric; |
4922 } | 4922 } |
4923 | 4923 |
4924 if (type == kUseCell) { | 4924 if (type == kUseCell) { |
4925 Handle<GlobalObject> global(current_info()->global_object()); | 4925 Handle<GlobalObject> global(current_info()->global_object()); |
4926 Handle<PropertyCell> cell(global->GetPropertyCell(&lookup)); | 4926 Handle<PropertyCell> cell(global->GetPropertyCell(&lookup)); |
4927 if (cell->type()->IsConstant()) { | 4927 if (cell->type()->IsConstant()) { |
4928 cell->AddDependentCompilationInfo(top_info()); | 4928 PropertyCell::AddDependentCompilationInfo(cell, top_info()); |
4929 Handle<Object> constant_object = cell->type()->AsConstant(); | 4929 Handle<Object> constant_object = cell->type()->AsConstant(); |
4930 if (constant_object->IsConsString()) { | 4930 if (constant_object->IsConsString()) { |
4931 constant_object = | 4931 constant_object = |
4932 String::Flatten(Handle<String>::cast(constant_object)); | 4932 String::Flatten(Handle<String>::cast(constant_object)); |
4933 } | 4933 } |
4934 HConstant* constant = New<HConstant>(constant_object); | 4934 HConstant* constant = New<HConstant>(constant_object); |
4935 return ast_context()->ReturnInstruction(constant, expr->id()); | 4935 return ast_context()->ReturnInstruction(constant, expr->id()); |
4936 } else { | 4936 } else { |
4937 HLoadGlobalCell* instr = | 4937 HLoadGlobalCell* instr = |
4938 New<HLoadGlobalCell>(cell, lookup.GetPropertyDetails()); | 4938 New<HLoadGlobalCell>(cell, lookup.GetPropertyDetails()); |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5545 } | 5545 } |
5546 | 5546 |
5547 | 5547 |
5548 void HOptimizedGraphBuilder::PropertyAccessInfo::LoadFieldMap(Handle<Map> map) { | 5548 void HOptimizedGraphBuilder::PropertyAccessInfo::LoadFieldMap(Handle<Map> map) { |
5549 // Figure out the field type from the accessor map. | 5549 // Figure out the field type from the accessor map. |
5550 HeapType* field_type = lookup_.GetFieldTypeFromMap(*map); | 5550 HeapType* field_type = lookup_.GetFieldTypeFromMap(*map); |
5551 if (field_type->IsClass()) { | 5551 if (field_type->IsClass()) { |
5552 Handle<Map> field_map = field_type->AsClass(); | 5552 Handle<Map> field_map = field_type->AsClass(); |
5553 if (field_map->is_stable()) { | 5553 if (field_map->is_stable()) { |
5554 field_map_ = field_map; | 5554 field_map_ = field_map; |
5555 field_map_->AddDependentCompilationInfo( | 5555 Map::AddDependentCompilationInfo( |
5556 DependentCode::kPrototypeCheckGroup, top_info()); | 5556 field_map_, DependentCode::kPrototypeCheckGroup, top_info()); |
5557 | 5557 |
5558 // Add dependency on the map that introduced the field. | 5558 // Add dependency on the map that introduced the field. |
5559 lookup_.GetFieldOwnerFromMap(*map)->AddDependentCompilationInfo( | 5559 Map::AddDependentCompilationInfo( |
5560 handle(lookup_.GetFieldOwnerFromMap(*map), isolate()), | |
5560 DependentCode::kFieldTypeGroup, top_info()); | 5561 DependentCode::kFieldTypeGroup, top_info()); |
5561 } | 5562 } |
5562 } | 5563 } |
5563 } | 5564 } |
5564 | 5565 |
5565 | 5566 |
5566 bool HOptimizedGraphBuilder::PropertyAccessInfo::LookupInPrototypes() { | 5567 bool HOptimizedGraphBuilder::PropertyAccessInfo::LookupInPrototypes() { |
5567 Handle<Map> map = this->map(); | 5568 Handle<Map> map = this->map(); |
5568 | 5569 |
5569 while (map->prototype()->IsJSObject()) { | 5570 while (map->prototype()->IsJSObject()) { |
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6821 | 6822 |
6822 BuildLoad(expr, expr->id()); | 6823 BuildLoad(expr, expr->id()); |
6823 } | 6824 } |
6824 | 6825 |
6825 | 6826 |
6826 HInstruction* HGraphBuilder::BuildConstantMapCheck(Handle<JSObject> constant, | 6827 HInstruction* HGraphBuilder::BuildConstantMapCheck(Handle<JSObject> constant, |
6827 CompilationInfo* info) { | 6828 CompilationInfo* info) { |
6828 HConstant* constant_value = New<HConstant>(constant); | 6829 HConstant* constant_value = New<HConstant>(constant); |
6829 | 6830 |
6830 if (constant->map()->CanOmitMapChecks()) { | 6831 if (constant->map()->CanOmitMapChecks()) { |
6831 constant->map()->AddDependentCompilationInfo( | 6832 Map::AddDependentCompilationInfo( |
6833 handle(constant->map(), info->isolate()), | |
Igor Sheludko
2014/04/15 08:58:35
Suggestion: below we are also wrapping the map to
Benedikt Meurer
2014/04/15 10:15:02
Done.
| |
6832 DependentCode::kPrototypeCheckGroup, info); | 6834 DependentCode::kPrototypeCheckGroup, info); |
6833 return constant_value; | 6835 return constant_value; |
6834 } | 6836 } |
6835 | 6837 |
6836 AddInstruction(constant_value); | 6838 AddInstruction(constant_value); |
6837 HCheckMaps* check = | 6839 HCheckMaps* check = |
6838 Add<HCheckMaps>(constant_value, handle(constant->map()), info); | 6840 Add<HCheckMaps>(constant_value, handle(constant->map()), info); |
6839 check->ClearDependsOnFlag(kElementsKind); | 6841 check->ClearDependsOnFlag(kElementsKind); |
6840 return check; | 6842 return check; |
6841 } | 6843 } |
(...skipping 4758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11600 if (ShouldProduceTraceOutput()) { | 11602 if (ShouldProduceTraceOutput()) { |
11601 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11603 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
11602 } | 11604 } |
11603 | 11605 |
11604 #ifdef DEBUG | 11606 #ifdef DEBUG |
11605 graph_->Verify(false); // No full verify. | 11607 graph_->Verify(false); // No full verify. |
11606 #endif | 11608 #endif |
11607 } | 11609 } |
11608 | 11610 |
11609 } } // namespace v8::internal | 11611 } } // namespace v8::internal |
OLD | NEW |