| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/allocation-site-scopes.h" | 9 #include "src/allocation-site-scopes.h" |
| 10 #include "src/ast/ast-numbering.h" | 10 #include "src/ast/ast-numbering.h" |
| (...skipping 5972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5983 } | 5983 } |
| 5984 // Fall through. | 5984 // Fall through. |
| 5985 case ObjectLiteral::Property::PROTOTYPE: | 5985 case ObjectLiteral::Property::PROTOTYPE: |
| 5986 case ObjectLiteral::Property::SETTER: | 5986 case ObjectLiteral::Property::SETTER: |
| 5987 case ObjectLiteral::Property::GETTER: | 5987 case ObjectLiteral::Property::GETTER: |
| 5988 return Bailout(kObjectLiteralWithComplexProperty); | 5988 return Bailout(kObjectLiteralWithComplexProperty); |
| 5989 default: UNREACHABLE(); | 5989 default: UNREACHABLE(); |
| 5990 } | 5990 } |
| 5991 } | 5991 } |
| 5992 | 5992 |
| 5993 if (expr->has_function()) { | 5993 return ast_context()->ReturnValue(Pop()); |
| 5994 // Return the result of the transformation to fast properties | |
| 5995 // instead of the original since this operation changes the map | |
| 5996 // of the object. This makes sure that the original object won't | |
| 5997 // be used by other optimized code before it is transformed | |
| 5998 // (e.g. because of code motion). | |
| 5999 HToFastProperties* result = Add<HToFastProperties>(Pop()); | |
| 6000 return ast_context()->ReturnValue(result); | |
| 6001 } else { | |
| 6002 return ast_context()->ReturnValue(Pop()); | |
| 6003 } | |
| 6004 } | 5994 } |
| 6005 | 5995 |
| 6006 | 5996 |
| 6007 void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { | 5997 void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { |
| 6008 DCHECK(!HasStackOverflow()); | 5998 DCHECK(!HasStackOverflow()); |
| 6009 DCHECK(current_block() != NULL); | 5999 DCHECK(current_block() != NULL); |
| 6010 DCHECK(current_block()->HasPredecessor()); | 6000 DCHECK(current_block()->HasPredecessor()); |
| 6011 ZoneList<Expression*>* subexprs = expr->values(); | 6001 ZoneList<Expression*>* subexprs = expr->values(); |
| 6012 int length = subexprs->length(); | 6002 int length = subexprs->length(); |
| 6013 HInstruction* literal; | 6003 HInstruction* literal; |
| (...skipping 7503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13517 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13507 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13518 } | 13508 } |
| 13519 | 13509 |
| 13520 #ifdef DEBUG | 13510 #ifdef DEBUG |
| 13521 graph_->Verify(false); // No full verify. | 13511 graph_->Verify(false); // No full verify. |
| 13522 #endif | 13512 #endif |
| 13523 } | 13513 } |
| 13524 | 13514 |
| 13525 } // namespace internal | 13515 } // namespace internal |
| 13526 } // namespace v8 | 13516 } // namespace v8 |
| OLD | NEW |