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 3278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3289 void HGraphBuilder::HandleGlobalVariableAssignment(Variable* var, | 3289 void HGraphBuilder::HandleGlobalVariableAssignment(Variable* var, |
3290 HValue* value, | 3290 HValue* value, |
3291 int position, | 3291 int position, |
3292 int ast_id) { | 3292 int ast_id) { |
3293 LookupResult lookup; | 3293 LookupResult lookup; |
3294 GlobalPropertyAccess type = LookupGlobalProperty(var, &lookup, true); | 3294 GlobalPropertyAccess type = LookupGlobalProperty(var, &lookup, true); |
3295 if (type == kUseCell) { | 3295 if (type == kUseCell) { |
3296 bool check_hole = !lookup.IsDontDelete() || lookup.IsReadOnly(); | 3296 bool check_hole = !lookup.IsDontDelete() || lookup.IsReadOnly(); |
3297 Handle<GlobalObject> global(info()->global_object()); | 3297 Handle<GlobalObject> global(info()->global_object()); |
3298 Handle<JSGlobalPropertyCell> cell(global->GetPropertyCell(&lookup)); | 3298 Handle<JSGlobalPropertyCell> cell(global->GetPropertyCell(&lookup)); |
3299 HInstruction* instr = new HStoreGlobal(value, cell, check_hole); | 3299 HInstruction* instr = new HStoreGlobalCell(value, cell, check_hole); |
3300 instr->set_position(position); | 3300 instr->set_position(position); |
3301 AddInstruction(instr); | 3301 AddInstruction(instr); |
3302 if (instr->HasSideEffects()) AddSimulate(ast_id); | 3302 if (instr->HasSideEffects()) AddSimulate(ast_id); |
3303 } else { | 3303 } else { |
3304 BAILOUT("global store only supported for cells"); | 3304 HContext* context = new HContext; |
3305 AddInstruction(context); | |
3306 HGlobalObject* global_object = new HGlobalObject(context); | |
3307 AddInstruction(global_object); | |
3308 HStoreGlobalGeneric* instr = | |
3309 new HStoreGlobalGeneric(context, | |
3310 global_object, | |
3311 var->name(), | |
3312 value); | |
3313 instr->set_position(position); | |
3314 AddInstruction(instr); | |
3315 ASSERT(instr->HasSideEffects()); | |
3316 if (instr->HasSideEffects()) AddSimulate(ast_id); | |
3317 //ast_context()->ReturnInstruction(instr, expr->id()); | |
fschneider
2011/04/04 13:47:50
Remove commented code.
Søren Thygesen Gjesse
2011/04/04 14:16:34
Done.
| |
3305 } | 3318 } |
3306 } | 3319 } |
3307 | 3320 |
3308 | 3321 |
3309 void HGraphBuilder::HandleCompoundAssignment(Assignment* expr) { | 3322 void HGraphBuilder::HandleCompoundAssignment(Assignment* expr) { |
3310 Expression* target = expr->target(); | 3323 Expression* target = expr->target(); |
3311 VariableProxy* proxy = target->AsVariableProxy(); | 3324 VariableProxy* proxy = target->AsVariableProxy(); |
3312 Variable* var = proxy->AsVariable(); | 3325 Variable* var = proxy->AsVariable(); |
3313 Property* prop = target->AsProperty(); | 3326 Property* prop = target->AsProperty(); |
3314 ASSERT(var == NULL || prop == NULL); | 3327 ASSERT(var == NULL || prop == NULL); |
(...skipping 2636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5951 } | 5964 } |
5952 } | 5965 } |
5953 | 5966 |
5954 #ifdef DEBUG | 5967 #ifdef DEBUG |
5955 if (graph_ != NULL) graph_->Verify(); | 5968 if (graph_ != NULL) graph_->Verify(); |
5956 if (allocator_ != NULL) allocator_->Verify(); | 5969 if (allocator_ != NULL) allocator_->Verify(); |
5957 #endif | 5970 #endif |
5958 } | 5971 } |
5959 | 5972 |
5960 } } // namespace v8::internal | 5973 } } // namespace v8::internal |
OLD | NEW |