| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3363 // superclass of Assignment and CountOperation, we cannot just pass the | 3363 // superclass of Assignment and CountOperation, we cannot just pass the |
| 3364 // owning expression instead of position and ast_id separately. | 3364 // owning expression instead of position and ast_id separately. |
| 3365 void HGraphBuilder::HandleGlobalVariableAssignment(Variable* var, | 3365 void HGraphBuilder::HandleGlobalVariableAssignment(Variable* var, |
| 3366 HValue* value, | 3366 HValue* value, |
| 3367 int position, | 3367 int position, |
| 3368 int ast_id) { | 3368 int ast_id) { |
| 3369 LookupResult lookup; | 3369 LookupResult lookup; |
| 3370 LookupGlobalPropertyCell(var, &lookup, true); | 3370 LookupGlobalPropertyCell(var, &lookup, true); |
| 3371 CHECK_BAILOUT; | 3371 CHECK_BAILOUT; |
| 3372 | 3372 |
| 3373 bool check_hole = !lookup.IsDontDelete() || lookup.IsReadOnly(); |
| 3373 Handle<GlobalObject> global(graph()->info()->global_object()); | 3374 Handle<GlobalObject> global(graph()->info()->global_object()); |
| 3374 Handle<JSGlobalPropertyCell> cell(global->GetPropertyCell(&lookup)); | 3375 Handle<JSGlobalPropertyCell> cell(global->GetPropertyCell(&lookup)); |
| 3375 HInstruction* instr = new HStoreGlobal(value, cell); | 3376 HInstruction* instr = new HStoreGlobal(value, cell, check_hole); |
| 3376 instr->set_position(position); | 3377 instr->set_position(position); |
| 3377 AddInstruction(instr); | 3378 AddInstruction(instr); |
| 3378 if (instr->HasSideEffects()) AddSimulate(ast_id); | 3379 if (instr->HasSideEffects()) AddSimulate(ast_id); |
| 3379 } | 3380 } |
| 3380 | 3381 |
| 3381 | 3382 |
| 3382 void HGraphBuilder::HandleCompoundAssignment(Assignment* expr) { | 3383 void HGraphBuilder::HandleCompoundAssignment(Assignment* expr) { |
| 3383 Expression* target = expr->target(); | 3384 Expression* target = expr->target(); |
| 3384 VariableProxy* proxy = target->AsVariableProxy(); | 3385 VariableProxy* proxy = target->AsVariableProxy(); |
| 3385 Variable* var = proxy->AsVariable(); | 3386 Variable* var = proxy->AsVariable(); |
| (...skipping 2492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5878 } | 5879 } |
| 5879 } | 5880 } |
| 5880 | 5881 |
| 5881 #ifdef DEBUG | 5882 #ifdef DEBUG |
| 5882 if (graph_ != NULL) graph_->Verify(); | 5883 if (graph_ != NULL) graph_->Verify(); |
| 5883 if (allocator_ != NULL) allocator_->Verify(); | 5884 if (allocator_ != NULL) allocator_->Verify(); |
| 5884 #endif | 5885 #endif |
| 5885 } | 5886 } |
| 5886 | 5887 |
| 5887 } } // namespace v8::internal | 5888 } } // namespace v8::internal |
| OLD | NEW |