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 8354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8365 } | 8365 } |
8366 } else if (types != NULL && types->length() > 1) { | 8366 } else if (types != NULL && types->length() > 1) { |
8367 return HandlePolymorphicLoadNamedField(expr, Pop(), types, name); | 8367 return HandlePolymorphicLoadNamedField(expr, Pop(), types, name); |
8368 } else { | 8368 } else { |
8369 instr = BuildLoadNamedGeneric(Pop(), name, expr); | 8369 instr = BuildLoadNamedGeneric(Pop(), name, expr); |
8370 } | 8370 } |
8371 | 8371 |
8372 } else { | 8372 } else { |
8373 CHECK_ALIVE(VisitForValue(expr->key())); | 8373 CHECK_ALIVE(VisitForValue(expr->key())); |
8374 | 8374 |
8375 HValue* key = Pop(); | 8375 HValue* key = environment()->ExpressionStackAt(0); |
ulan
2013/05/08 14:01:47
This doesn't trigger the verification check. Chang
| |
8376 HValue* obj = Pop(); | 8376 HValue* obj = environment()->ExpressionStackAt(1); |
8377 | 8377 |
8378 bool has_side_effects = false; | 8378 bool has_side_effects = false; |
8379 HValue* load = HandleKeyedElementAccess( | 8379 HValue* load = HandleKeyedElementAccess( |
8380 obj, key, NULL, expr, expr->id(), expr->position(), | 8380 obj, key, NULL, expr, expr->id(), expr->position(), |
8381 false, // is_store | 8381 false, // is_store |
8382 &has_side_effects); | 8382 &has_side_effects); |
8383 Drop(2); | |
8383 if (has_side_effects) { | 8384 if (has_side_effects) { |
8384 if (ast_context()->IsEffect()) { | 8385 if (ast_context()->IsEffect()) { |
8385 AddSimulate(expr->id(), REMOVABLE_SIMULATE); | 8386 AddSimulate(expr->id(), REMOVABLE_SIMULATE); |
8386 } else { | 8387 } else { |
8387 Push(load); | 8388 Push(load); |
8388 AddSimulate(expr->id(), REMOVABLE_SIMULATE); | 8389 AddSimulate(expr->id(), REMOVABLE_SIMULATE); |
8389 Drop(1); | 8390 Drop(1); |
8390 } | 8391 } |
8391 } | 8392 } |
8392 return ast_context()->ReturnValue(load); | 8393 return ast_context()->ReturnValue(load); |
(...skipping 1696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10089 | 10090 |
10090 bool has_side_effects = false; | 10091 bool has_side_effects = false; |
10091 HValue* load = HandleKeyedElementAccess( | 10092 HValue* load = HandleKeyedElementAccess( |
10092 obj, key, NULL, prop, prop->LoadId(), RelocInfo::kNoPosition, | 10093 obj, key, NULL, prop, prop->LoadId(), RelocInfo::kNoPosition, |
10093 false, // is_store | 10094 false, // is_store |
10094 &has_side_effects); | 10095 &has_side_effects); |
10095 Push(load); | 10096 Push(load); |
10096 if (has_side_effects) AddSimulate(prop->LoadId(), REMOVABLE_SIMULATE); | 10097 if (has_side_effects) AddSimulate(prop->LoadId(), REMOVABLE_SIMULATE); |
10097 | 10098 |
10098 after = BuildIncrement(returns_original_input, expr); | 10099 after = BuildIncrement(returns_original_input, expr); |
10099 input = Pop(); | 10100 input = environment()->ExpressionStackAt(0); |
10100 | 10101 |
10101 expr->RecordTypeFeedback(oracle(), zone()); | 10102 expr->RecordTypeFeedback(oracle(), zone()); |
10102 HandleKeyedElementAccess(obj, key, after, expr, expr->AssignmentId(), | 10103 HandleKeyedElementAccess(obj, key, after, expr, expr->AssignmentId(), |
10103 RelocInfo::kNoPosition, | 10104 RelocInfo::kNoPosition, |
10104 true, // is_store | 10105 true, // is_store |
10105 &has_side_effects); | 10106 &has_side_effects); |
10106 | 10107 |
10107 // Drop the key from the bailout environment. Overwrite the receiver | 10108 // Drop the key and the original value from the bailout environment. |
10108 // with the result of the operation, and the placeholder with the | 10109 // Overwrite the receiver with the result of the operation, and the |
10109 // original value if necessary. | 10110 // placeholder with the original value if necessary. |
10110 Drop(1); | 10111 Drop(2); |
10111 environment()->SetExpressionStackAt(0, after); | 10112 environment()->SetExpressionStackAt(0, after); |
10112 if (returns_original_input) environment()->SetExpressionStackAt(1, input); | 10113 if (returns_original_input) environment()->SetExpressionStackAt(1, input); |
10113 ASSERT(has_side_effects); // Stores always have side effects. | 10114 ASSERT(has_side_effects); // Stores always have side effects. |
10114 AddSimulate(expr->AssignmentId(), REMOVABLE_SIMULATE); | 10115 AddSimulate(expr->AssignmentId(), REMOVABLE_SIMULATE); |
10115 } | 10116 } |
10116 } | 10117 } |
10117 | 10118 |
10118 Drop(returns_original_input ? 2 : 1); | 10119 Drop(returns_original_input ? 2 : 1); |
10119 return ast_context()->ReturnValue(expr->is_postfix() ? input : after); | 10120 return ast_context()->ReturnValue(expr->is_postfix() ? input : after); |
10120 } | 10121 } |
(...skipping 2183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
12304 } | 12305 } |
12305 } | 12306 } |
12306 | 12307 |
12307 #ifdef DEBUG | 12308 #ifdef DEBUG |
12308 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 12309 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
12309 if (allocator_ != NULL) allocator_->Verify(); | 12310 if (allocator_ != NULL) allocator_->Verify(); |
12310 #endif | 12311 #endif |
12311 } | 12312 } |
12312 | 12313 |
12313 } } // namespace v8::internal | 12314 } } // namespace v8::internal |
OLD | NEW |