| 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 2963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2974 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 2974 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
| 2975 ASSERT(!CompileTimeValue::IsCompileTimeValue(value)); | 2975 ASSERT(!CompileTimeValue::IsCompileTimeValue(value)); |
| 2976 // Fall through. | 2976 // Fall through. |
| 2977 case ObjectLiteral::Property::COMPUTED: | 2977 case ObjectLiteral::Property::COMPUTED: |
| 2978 if (key->handle()->IsSymbol()) { | 2978 if (key->handle()->IsSymbol()) { |
| 2979 if (property->emit_store()) { | 2979 if (property->emit_store()) { |
| 2980 VISIT_FOR_VALUE(value); | 2980 VISIT_FOR_VALUE(value); |
| 2981 HValue* value = Pop(); | 2981 HValue* value = Pop(); |
| 2982 Handle<String> name = Handle<String>::cast(key->handle()); | 2982 Handle<String> name = Handle<String>::cast(key->handle()); |
| 2983 HStoreNamedGeneric* store = | 2983 HStoreNamedGeneric* store = |
| 2984 new(zone()) HStoreNamedGeneric(context, literal, name, value); | 2984 new(zone()) HStoreNamedGeneric( |
| 2985 context, |
| 2986 literal, |
| 2987 name, |
| 2988 value, |
| 2989 function_strict_mode()); |
| 2985 AddInstruction(store); | 2990 AddInstruction(store); |
| 2986 AddSimulate(key->id()); | 2991 AddSimulate(key->id()); |
| 2987 } else { | 2992 } else { |
| 2988 VISIT_FOR_EFFECT(value); | 2993 VISIT_FOR_EFFECT(value); |
| 2989 } | 2994 } |
| 2990 break; | 2995 break; |
| 2991 } | 2996 } |
| 2992 // Fall through. | 2997 // Fall through. |
| 2993 case ObjectLiteral::Property::PROTOTYPE: | 2998 case ObjectLiteral::Property::PROTOTYPE: |
| 2994 case ObjectLiteral::Property::SETTER: | 2999 case ObjectLiteral::Property::SETTER: |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3115 } | 3120 } |
| 3116 return instr; | 3121 return instr; |
| 3117 } | 3122 } |
| 3118 | 3123 |
| 3119 | 3124 |
| 3120 HInstruction* HGraphBuilder::BuildStoreNamedGeneric(HValue* object, | 3125 HInstruction* HGraphBuilder::BuildStoreNamedGeneric(HValue* object, |
| 3121 Handle<String> name, | 3126 Handle<String> name, |
| 3122 HValue* value) { | 3127 HValue* value) { |
| 3123 HContext* context = new(zone()) HContext; | 3128 HContext* context = new(zone()) HContext; |
| 3124 AddInstruction(context); | 3129 AddInstruction(context); |
| 3125 return new(zone()) HStoreNamedGeneric(context, object, name, value); | 3130 return new(zone()) HStoreNamedGeneric( |
| 3131 context, |
| 3132 object, |
| 3133 name, |
| 3134 value, |
| 3135 function_strict_mode()); |
| 3126 } | 3136 } |
| 3127 | 3137 |
| 3128 | 3138 |
| 3129 HInstruction* HGraphBuilder::BuildStoreNamed(HValue* object, | 3139 HInstruction* HGraphBuilder::BuildStoreNamed(HValue* object, |
| 3130 HValue* value, | 3140 HValue* value, |
| 3131 Expression* expr) { | 3141 Expression* expr) { |
| 3132 Property* prop = (expr->AsProperty() != NULL) | 3142 Property* prop = (expr->AsProperty() != NULL) |
| 3133 ? expr->AsProperty() | 3143 ? expr->AsProperty() |
| 3134 : expr->AsAssignment()->target()->AsProperty(); | 3144 : expr->AsAssignment()->target()->AsProperty(); |
| 3135 Literal* key = prop->key()->AsLiteral(); | 3145 Literal* key = prop->key()->AsLiteral(); |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3311 if (instr->HasSideEffects()) AddSimulate(ast_id); | 3321 if (instr->HasSideEffects()) AddSimulate(ast_id); |
| 3312 } else { | 3322 } else { |
| 3313 HContext* context = new(zone()) HContext; | 3323 HContext* context = new(zone()) HContext; |
| 3314 AddInstruction(context); | 3324 AddInstruction(context); |
| 3315 HGlobalObject* global_object = new(zone()) HGlobalObject(context); | 3325 HGlobalObject* global_object = new(zone()) HGlobalObject(context); |
| 3316 AddInstruction(global_object); | 3326 AddInstruction(global_object); |
| 3317 HStoreGlobalGeneric* instr = | 3327 HStoreGlobalGeneric* instr = |
| 3318 new(zone()) HStoreGlobalGeneric(context, | 3328 new(zone()) HStoreGlobalGeneric(context, |
| 3319 global_object, | 3329 global_object, |
| 3320 var->name(), | 3330 var->name(), |
| 3321 value); | 3331 value, |
| 3332 function_strict_mode()); |
| 3322 instr->set_position(position); | 3333 instr->set_position(position); |
| 3323 AddInstruction(instr); | 3334 AddInstruction(instr); |
| 3324 ASSERT(instr->HasSideEffects()); | 3335 ASSERT(instr->HasSideEffects()); |
| 3325 if (instr->HasSideEffects()) AddSimulate(ast_id); | 3336 if (instr->HasSideEffects()) AddSimulate(ast_id); |
| 3326 } | 3337 } |
| 3327 } | 3338 } |
| 3328 | 3339 |
| 3329 | 3340 |
| 3330 void HGraphBuilder::HandleCompoundAssignment(Assignment* expr) { | 3341 void HGraphBuilder::HandleCompoundAssignment(Assignment* expr) { |
| 3331 Expression* target = expr->target(); | 3342 Expression* target = expr->target(); |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3626 external_elements, key, expr->GetExternalArrayType()); | 3637 external_elements, key, expr->GetExternalArrayType()); |
| 3627 return pixel_array_value; | 3638 return pixel_array_value; |
| 3628 } | 3639 } |
| 3629 | 3640 |
| 3630 | 3641 |
| 3631 HInstruction* HGraphBuilder::BuildStoreKeyedGeneric(HValue* object, | 3642 HInstruction* HGraphBuilder::BuildStoreKeyedGeneric(HValue* object, |
| 3632 HValue* key, | 3643 HValue* key, |
| 3633 HValue* value) { | 3644 HValue* value) { |
| 3634 HContext* context = new(zone()) HContext; | 3645 HContext* context = new(zone()) HContext; |
| 3635 AddInstruction(context); | 3646 AddInstruction(context); |
| 3636 return new(zone()) HStoreKeyedGeneric(context, object, key, value); | 3647 return new(zone()) HStoreKeyedGeneric( |
| 3648 context, |
| 3649 object, |
| 3650 key, |
| 3651 value, |
| 3652 function_strict_mode()); |
| 3637 } | 3653 } |
| 3638 | 3654 |
| 3639 | 3655 |
| 3640 HInstruction* HGraphBuilder::BuildStoreKeyedFastElement(HValue* object, | 3656 HInstruction* HGraphBuilder::BuildStoreKeyedFastElement(HValue* object, |
| 3641 HValue* key, | 3657 HValue* key, |
| 3642 HValue* val, | 3658 HValue* val, |
| 3643 Expression* expr) { | 3659 Expression* expr) { |
| 3644 ASSERT(expr->IsMonomorphic()); | 3660 ASSERT(expr->IsMonomorphic()); |
| 3645 AddInstruction(new(zone()) HCheckNonSmi(object)); | 3661 AddInstruction(new(zone()) HCheckNonSmi(object)); |
| 3646 Handle<Map> map = expr->GetMonomorphicReceiverType(); | 3662 Handle<Map> map = expr->GetMonomorphicReceiverType(); |
| (...skipping 2347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5994 } | 6010 } |
| 5995 } | 6011 } |
| 5996 | 6012 |
| 5997 #ifdef DEBUG | 6013 #ifdef DEBUG |
| 5998 if (graph_ != NULL) graph_->Verify(); | 6014 if (graph_ != NULL) graph_->Verify(); |
| 5999 if (allocator_ != NULL) allocator_->Verify(); | 6015 if (allocator_ != NULL) allocator_->Verify(); |
| 6000 #endif | 6016 #endif |
| 6001 } | 6017 } |
| 6002 | 6018 |
| 6003 } } // namespace v8::internal | 6019 } } // namespace v8::internal |
| OLD | NEW |