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

Side by Side Diff: src/hydrogen.cc

Issue 16950004: Reduce the amount of full code generated to fill out array literals. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 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 6082 matching lines...) Expand 10 before | Expand all | Expand 10 after
6093 literal = AddInstruction( 6093 literal = AddInstruction(
6094 new(zone()) HCallRuntime(context, 6094 new(zone()) HCallRuntime(context,
6095 isolate()->factory()->empty_string(), 6095 isolate()->factory()->empty_string(),
6096 Runtime::FunctionForId(function_id), 6096 Runtime::FunctionForId(function_id),
6097 3)); 6097 3));
6098 } 6098 }
6099 6099
6100 // The array is expected in the bailout environment during computation 6100 // The array is expected in the bailout environment during computation
6101 // of the property values and is the value of the entire expression. 6101 // of the property values and is the value of the entire expression.
6102 Push(literal); 6102 Push(literal);
6103 // The literal index is on the stack, too.
6104 Push(AddInstruction(
6105 new(zone()) HConstant(expr->literal_index(), Representation::Smi())));
Michael Starzinger 2013/06/13 13:57:27 I would just not specify a particular representati
Sven Panne 2013/06/14 06:04:32 Done.
6103 6106
6104 HInstruction* elements = NULL; 6107 HInstruction* elements = NULL;
6105 6108
6106 for (int i = 0; i < length; i++) { 6109 for (int i = 0; i < length; i++) {
6107 Expression* subexpr = subexprs->at(i); 6110 Expression* subexpr = subexprs->at(i);
6108 // If the subexpression is a literal or a simple materialized literal it 6111 // If the subexpression is a literal or a simple materialized literal it
6109 // is already set in the cloned array. 6112 // is already set in the cloned array.
6110 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; 6113 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue;
6111 6114
6112 CHECK_ALIVE(VisitForValue(subexpr)); 6115 CHECK_ALIVE(VisitForValue(subexpr));
(...skipping 17 matching lines...) Expand all
6130 value, 6133 value,
6131 boilerplate_elements_kind)); 6134 boilerplate_elements_kind));
6132 break; 6135 break;
6133 default: 6136 default:
6134 UNREACHABLE(); 6137 UNREACHABLE();
6135 break; 6138 break;
6136 } 6139 }
6137 6140
6138 AddSimulate(expr->GetIdForElement(i)); 6141 AddSimulate(expr->GetIdForElement(i));
6139 } 6142 }
6143
6144 Drop(1); // array literal index
6140 return ast_context()->ReturnValue(Pop()); 6145 return ast_context()->ReturnValue(Pop());
6141 } 6146 }
6142 6147
6143 6148
6144 // Sets the lookup result and returns true if the load/store can be inlined. 6149 // Sets the lookup result and returns true if the load/store can be inlined.
6145 static bool ComputeLoadStoreField(Handle<Map> type, 6150 static bool ComputeLoadStoreField(Handle<Map> type,
6146 Handle<String> name, 6151 Handle<String> name,
6147 LookupResult* lookup, 6152 LookupResult* lookup,
6148 bool is_store) { 6153 bool is_store) {
6149 if (type->has_named_interceptor()) { 6154 if (type->has_named_interceptor()) {
(...skipping 5464 matching lines...) Expand 10 before | Expand all | Expand 10 after
11614 } 11619 }
11615 } 11620 }
11616 11621
11617 #ifdef DEBUG 11622 #ifdef DEBUG
11618 if (graph_ != NULL) graph_->Verify(false); // No full verify. 11623 if (graph_ != NULL) graph_->Verify(false); // No full verify.
11619 if (allocator_ != NULL) allocator_->Verify(); 11624 if (allocator_ != NULL) allocator_->Verify();
11620 #endif 11625 #endif
11621 } 11626 }
11622 11627
11623 } } // namespace v8::internal 11628 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698