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

Side by Side Diff: src/hydrogen.cc

Issue 586673002: Use the initial map of the Object function for empty object literals (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Make unused properties of Object be inobject Created 6 years, 3 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
« no previous file with comments | « src/factory.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/hydrogen.h" 5 #include "src/hydrogen.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 10983 matching lines...) Expand 10 before | Expand all | Expand 10 after
10994 } 10994 }
10995 BuildInitElementsInObjectHeader(boilerplate_object, object, object_elements); 10995 BuildInitElementsInObjectHeader(boilerplate_object, object, object_elements);
10996 10996
10997 // Copy object elements if non-COW. 10997 // Copy object elements if non-COW.
10998 if (object_elements != NULL) { 10998 if (object_elements != NULL) {
10999 BuildEmitElements(boilerplate_object, elements, object_elements, 10999 BuildEmitElements(boilerplate_object, elements, object_elements,
11000 site_context); 11000 site_context);
11001 } 11001 }
11002 11002
11003 // Copy in-object properties. 11003 // Copy in-object properties.
11004 if (boilerplate_object->map()->NumberOfFields() != 0) { 11004 if (boilerplate_object->map()->NumberOfFields() != 0 ||
11005 boilerplate_object->map()->unused_property_fields() > 0) {
11005 BuildEmitInObjectProperties(boilerplate_object, object, site_context, 11006 BuildEmitInObjectProperties(boilerplate_object, object, site_context,
11006 pretenure_flag); 11007 pretenure_flag);
11007 } 11008 }
11008 return object; 11009 return object;
11009 } 11010 }
11010 11011
11011 11012
11012 void HOptimizedGraphBuilder::BuildEmitObjectHeader( 11013 void HOptimizedGraphBuilder::BuildEmitObjectHeader(
11013 Handle<JSObject> boilerplate_object, 11014 Handle<JSObject> boilerplate_object,
11014 HInstruction* object) { 11015 HInstruction* object) {
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
11208 void HOptimizedGraphBuilder::VisitThisFunction(ThisFunction* expr) { 11209 void HOptimizedGraphBuilder::VisitThisFunction(ThisFunction* expr) {
11209 DCHECK(!HasStackOverflow()); 11210 DCHECK(!HasStackOverflow());
11210 DCHECK(current_block() != NULL); 11211 DCHECK(current_block() != NULL);
11211 DCHECK(current_block()->HasPredecessor()); 11212 DCHECK(current_block()->HasPredecessor());
11212 HInstruction* instr = BuildThisFunction(); 11213 HInstruction* instr = BuildThisFunction();
11213 return ast_context()->ReturnInstruction(instr, expr->id()); 11214 return ast_context()->ReturnInstruction(instr, expr->id());
11214 } 11215 }
11215 11216
11216 11217
11217 void HOptimizedGraphBuilder::VisitSuperReference(SuperReference* expr) { 11218 void HOptimizedGraphBuilder::VisitSuperReference(SuperReference* expr) {
11218 DCHECK(!HasStackOverflow()); 11219 DCHECK(!HasStackOverflow());
Toon Verwaest 2014/09/19 12:27:57 Unrelated to this CL, just rebased.
11219 DCHECK(current_block() != NULL); 11220 DCHECK(current_block() != NULL);
11220 DCHECK(current_block()->HasPredecessor()); 11221 DCHECK(current_block()->HasPredecessor());
11221 return Bailout(kSuperReference); 11222 return Bailout(kSuperReference);
11222 } 11223 }
11223 11224
11224 11225
11225 void HOptimizedGraphBuilder::VisitDeclarations( 11226 void HOptimizedGraphBuilder::VisitDeclarations(
11226 ZoneList<Declaration*>* declarations) { 11227 ZoneList<Declaration*>* declarations) {
11227 DCHECK(globals_.is_empty()); 11228 DCHECK(globals_.is_empty());
11228 AstVisitor::VisitDeclarations(declarations); 11229 AstVisitor::VisitDeclarations(declarations);
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after
12518 if (ShouldProduceTraceOutput()) { 12519 if (ShouldProduceTraceOutput()) {
12519 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 12520 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
12520 } 12521 }
12521 12522
12522 #ifdef DEBUG 12523 #ifdef DEBUG
12523 graph_->Verify(false); // No full verify. 12524 graph_->Verify(false); // No full verify.
12524 #endif 12525 #endif
12525 } 12526 }
12526 12527
12527 } } // namespace v8::internal 12528 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698