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

Side by Side Diff: src/hydrogen.cc

Issue 26827002: Allow FastCloneShallowObjectStub to use AllocationMementos. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 4317 matching lines...) Expand 10 before | Expand all | Expand 10 after
4328 4328
4329 void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { 4329 void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
4330 ASSERT(!HasStackOverflow()); 4330 ASSERT(!HasStackOverflow());
4331 ASSERT(current_block() != NULL); 4331 ASSERT(current_block() != NULL);
4332 ASSERT(current_block()->HasPredecessor()); 4332 ASSERT(current_block()->HasPredecessor());
4333 Handle<JSFunction> closure = function_state()->compilation_info()->closure(); 4333 Handle<JSFunction> closure = function_state()->compilation_info()->closure();
4334 HInstruction* literal; 4334 HInstruction* literal;
4335 4335
4336 // Check whether to use fast or slow deep-copying for boilerplate. 4336 // Check whether to use fast or slow deep-copying for boilerplate.
4337 int max_properties = kMaxFastLiteralProperties; 4337 int max_properties = kMaxFastLiteralProperties;
4338 Handle<Object> boilerplate(closure->literals()->get( 4338 Handle<Object> literals_cell(closure->literals()->get(expr->literal_index()),
4339 expr->literal_index()), isolate()); 4339 isolate());
4340 if (boilerplate->IsJSObject() && 4340 Handle<AllocationSite> site;
4341 Handle<Object> boilerplate;
Michael Starzinger 2013/10/10 13:27:39 nit: The type of "boilerplate" should be Handle<JS
mvstanton 2013/10/10 14:09:04 Done.
4342 if (!literals_cell->IsUndefined()) {
4343 // Retrieve the boilerplate
4344 ASSERT(literals_cell->IsAllocationSite());
4345 site = Handle<AllocationSite>::cast(literals_cell);
4346 boilerplate = Handle<Object>(site->transition_info(), isolate());
4347 }
4348
4349 if (!boilerplate.is_null() &&
4341 IsFastLiteral(Handle<JSObject>::cast(boilerplate), 4350 IsFastLiteral(Handle<JSObject>::cast(boilerplate),
4342 kMaxFastLiteralDepth, 4351 kMaxFastLiteralDepth,
4343 &max_properties)) { 4352 &max_properties)) {
4344 Handle<JSObject> boilerplate_object = Handle<JSObject>::cast(boilerplate); 4353 Handle<JSObject> boilerplate_object = Handle<JSObject>::cast(boilerplate);
4345 4354
4346 literal = BuildFastLiteral(boilerplate_object); 4355 literal = BuildFastLiteral(boilerplate_object);
4347 } else { 4356 } else {
4348 NoObservableSideEffectsScope no_effects(this); 4357 NoObservableSideEffectsScope no_effects(this);
4349 Handle<FixedArray> closure_literals(closure->literals(), isolate()); 4358 Handle<FixedArray> closure_literals(closure->literals(), isolate());
4350 Handle<FixedArray> constant_properties = expr->constant_properties(); 4359 Handle<FixedArray> constant_properties = expr->constant_properties();
(...skipping 5524 matching lines...) Expand 10 before | Expand all | Expand 10 after
9875 if (ShouldProduceTraceOutput()) { 9884 if (ShouldProduceTraceOutput()) {
9876 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 9885 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
9877 } 9886 }
9878 9887
9879 #ifdef DEBUG 9888 #ifdef DEBUG
9880 graph_->Verify(false); // No full verify. 9889 graph_->Verify(false); // No full verify.
9881 #endif 9890 #endif
9882 } 9891 }
9883 9892
9884 } } // namespace v8::internal 9893 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698