Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: src/hydrogen.cc

Issue 6240012: Optimize calls to object literal properties that are initialized with a funct... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 3000 matching lines...) Expand 10 before | Expand all | Expand 10 after
3011 expr->flags(), 3011 expr->flags(),
3012 expr->literal_index()); 3012 expr->literal_index());
3013 ast_context()->ReturnInstruction(instr, expr->id()); 3013 ast_context()->ReturnInstruction(instr, expr->id());
3014 } 3014 }
3015 3015
3016 3016
3017 void HGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { 3017 void HGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
3018 HObjectLiteral* literal = (new HObjectLiteral(expr->constant_properties(), 3018 HObjectLiteral* literal = (new HObjectLiteral(expr->constant_properties(),
3019 expr->fast_elements(), 3019 expr->fast_elements(),
3020 expr->literal_index(), 3020 expr->literal_index(),
3021 expr->depth())); 3021 expr->depth(),
3022 expr->has_function()));
3022 // The object is expected in the bailout environment during computation 3023 // The object is expected in the bailout environment during computation
3023 // of the property values and is the value of the entire expression. 3024 // of the property values and is the value of the entire expression.
3024 PushAndAdd(literal); 3025 PushAndAdd(literal);
3025 3026
3026 expr->CalculateEmitStore(); 3027 expr->CalculateEmitStore();
3027 3028
3028 for (int i = 0; i < expr->properties()->length(); i++) { 3029 for (int i = 0; i < expr->properties()->length(); i++) {
3029 ObjectLiteral::Property* property = expr->properties()->at(i); 3030 ObjectLiteral::Property* property = expr->properties()->at(i);
3030 if (property->IsCompileTimeValue()) continue; 3031 if (property->IsCompileTimeValue()) continue;
3031 3032
(...skipping 2862 matching lines...) Expand 10 before | Expand all | Expand 10 after
5894 } 5895 }
5895 } 5896 }
5896 5897
5897 #ifdef DEBUG 5898 #ifdef DEBUG
5898 if (graph_ != NULL) graph_->Verify(); 5899 if (graph_ != NULL) graph_->Verify();
5899 if (allocator_ != NULL) allocator_->Verify(); 5900 if (allocator_ != NULL) allocator_->Verify();
5900 #endif 5901 #endif
5901 } 5902 }
5902 5903
5903 } } // namespace v8::internal 5904 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698