| 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 5618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5629 GlobalPropertyAccess type = | 5629 GlobalPropertyAccess type = |
| 5630 LookupGlobalProperty(variable, &lookup, false); | 5630 LookupGlobalProperty(variable, &lookup, false); |
| 5631 | 5631 |
| 5632 if (type == kUseCell && | 5632 if (type == kUseCell && |
| 5633 current_info()->global_object()->IsAccessCheckNeeded()) { | 5633 current_info()->global_object()->IsAccessCheckNeeded()) { |
| 5634 type = kUseGeneric; | 5634 type = kUseGeneric; |
| 5635 } | 5635 } |
| 5636 | 5636 |
| 5637 if (type == kUseCell) { | 5637 if (type == kUseCell) { |
| 5638 Handle<GlobalObject> global(current_info()->global_object()); | 5638 Handle<GlobalObject> global(current_info()->global_object()); |
| 5639 Handle<JSGlobalPropertyCell> cell(global->GetPropertyCell(&lookup)); | 5639 Handle<PropertyCell> cell(global->GetPropertyCell(&lookup)); |
| 5640 HLoadGlobalCell* instr = | 5640 HLoadGlobalCell* instr = |
| 5641 new(zone()) HLoadGlobalCell(cell, lookup.GetPropertyDetails()); | 5641 new(zone()) HLoadGlobalCell(cell, lookup.GetPropertyDetails()); |
| 5642 return ast_context()->ReturnInstruction(instr, expr->id()); | 5642 return ast_context()->ReturnInstruction(instr, expr->id()); |
| 5643 } else { | 5643 } else { |
| 5644 HValue* context = environment()->LookupContext(); | 5644 HValue* context = environment()->LookupContext(); |
| 5645 HGlobalObject* global_object = new(zone()) HGlobalObject(context); | 5645 HGlobalObject* global_object = new(zone()) HGlobalObject(context); |
| 5646 AddInstruction(global_object); | 5646 AddInstruction(global_object); |
| 5647 HLoadGlobalGeneric* instr = | 5647 HLoadGlobalGeneric* instr = |
| 5648 new(zone()) HLoadGlobalGeneric(context, | 5648 new(zone()) HLoadGlobalGeneric(context, |
| 5649 global_object, | 5649 global_object, |
| (...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6560 // owning expression instead of position and ast_id separately. | 6560 // owning expression instead of position and ast_id separately. |
| 6561 void HOptimizedGraphBuilder::HandleGlobalVariableAssignment( | 6561 void HOptimizedGraphBuilder::HandleGlobalVariableAssignment( |
| 6562 Variable* var, | 6562 Variable* var, |
| 6563 HValue* value, | 6563 HValue* value, |
| 6564 int position, | 6564 int position, |
| 6565 BailoutId ast_id) { | 6565 BailoutId ast_id) { |
| 6566 LookupResult lookup(isolate()); | 6566 LookupResult lookup(isolate()); |
| 6567 GlobalPropertyAccess type = LookupGlobalProperty(var, &lookup, true); | 6567 GlobalPropertyAccess type = LookupGlobalProperty(var, &lookup, true); |
| 6568 if (type == kUseCell) { | 6568 if (type == kUseCell) { |
| 6569 Handle<GlobalObject> global(current_info()->global_object()); | 6569 Handle<GlobalObject> global(current_info()->global_object()); |
| 6570 Handle<JSGlobalPropertyCell> cell(global->GetPropertyCell(&lookup)); | 6570 Handle<PropertyCell> cell(global->GetPropertyCell(&lookup)); |
| 6571 HInstruction* instr = | 6571 HInstruction* instr = |
| 6572 new(zone()) HStoreGlobalCell(value, cell, lookup.GetPropertyDetails()); | 6572 new(zone()) HStoreGlobalCell(value, cell, lookup.GetPropertyDetails()); |
| 6573 instr->set_position(position); | 6573 instr->set_position(position); |
| 6574 AddInstruction(instr); | 6574 AddInstruction(instr); |
| 6575 if (instr->HasObservableSideEffects()) { | 6575 if (instr->HasObservableSideEffects()) { |
| 6576 AddSimulate(ast_id, REMOVABLE_SIMULATE); | 6576 AddSimulate(ast_id, REMOVABLE_SIMULATE); |
| 6577 } | 6577 } |
| 6578 } else { | 6578 } else { |
| 6579 HValue* context = environment()->LookupContext(); | 6579 HValue* context = environment()->LookupContext(); |
| 6580 HGlobalObject* global_object = new(zone()) HGlobalObject(context); | 6580 HGlobalObject* global_object = new(zone()) HGlobalObject(context); |
| (...skipping 5033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11614 } | 11614 } |
| 11615 } | 11615 } |
| 11616 | 11616 |
| 11617 #ifdef DEBUG | 11617 #ifdef DEBUG |
| 11618 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 11618 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
| 11619 if (allocator_ != NULL) allocator_->Verify(); | 11619 if (allocator_ != NULL) allocator_->Verify(); |
| 11620 #endif | 11620 #endif |
| 11621 } | 11621 } |
| 11622 | 11622 |
| 11623 } } // namespace v8::internal | 11623 } } // namespace v8::internal |
| OLD | NEW |