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

Side by Side Diff: src/hydrogen.cc

Issue 8914006: Create missing boilerplate for array literals instead of deoptimizing (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years 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 | « no previous file | src/hydrogen-instructions.h » ('j') | src/runtime.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3449 matching lines...) Expand 10 before | Expand all | Expand 10 after
3460 ASSERT(!HasStackOverflow()); 3460 ASSERT(!HasStackOverflow());
3461 ASSERT(current_block() != NULL); 3461 ASSERT(current_block() != NULL);
3462 ASSERT(current_block()->HasPredecessor()); 3462 ASSERT(current_block()->HasPredecessor());
3463 ZoneList<Expression*>* subexprs = expr->values(); 3463 ZoneList<Expression*>* subexprs = expr->values();
3464 int length = subexprs->length(); 3464 int length = subexprs->length();
3465 HValue* context = environment()->LookupContext(); 3465 HValue* context = environment()->LookupContext();
3466 3466
3467 Handle<FixedArray> literals(environment()->closure()->literals()); 3467 Handle<FixedArray> literals(environment()->closure()->literals());
3468 Handle<Object> raw_boilerplate(literals->get(expr->literal_index())); 3468 Handle<Object> raw_boilerplate(literals->get(expr->literal_index()));
3469 3469
3470 // For now, no boilerplate causes a deopt.
3471 if (raw_boilerplate->IsUndefined()) { 3470 if (raw_boilerplate->IsUndefined()) {
3472 AddInstruction(new(zone()) HSoftDeoptimize); 3471 raw_boilerplate = Runtime::CreateArrayLiteralBoilerplate(
ricow1 2011/12/14 12:53:09 Check return value from runtime call, could be nul
Jakob Kummerow 2011/12/14 13:00:20 Done.
3473 return ast_context()->ReturnValue(graph()->GetConstantUndefined()); 3472 isolate(), literals, expr->constant_elements());
3473 literals->set(expr->literal_index(), *raw_boilerplate);
3474 if (JSObject::cast(*raw_boilerplate)->elements()->map() ==
3475 isolate()->heap()->fixed_cow_array_map()) {
3476 isolate()->counters()->cow_arrays_created_runtime()->Increment();
3477 }
3474 } 3478 }
3475 3479
3476 Handle<JSObject> boilerplate(Handle<JSObject>::cast(raw_boilerplate)); 3480 Handle<JSObject> boilerplate = Handle<JSObject>::cast(raw_boilerplate);
3477 ElementsKind boilerplate_elements_kind = boilerplate->GetElementsKind(); 3481 ElementsKind boilerplate_elements_kind =
3482 Handle<JSObject>::cast(boilerplate)->GetElementsKind();
3478 3483
3479 HArrayLiteral* literal = new(zone()) HArrayLiteral( 3484 HArrayLiteral* literal = new(zone()) HArrayLiteral(
3480 context, 3485 context,
3481 boilerplate, 3486 boilerplate,
3482 length, 3487 length,
3483 expr->literal_index(), 3488 expr->literal_index(),
3484 expr->depth()); 3489 expr->depth());
3485 3490
3486 // The array is expected in the bailout environment during computation 3491 // The array is expected in the bailout environment during computation
3487 // of the property values and is the value of the entire expression. 3492 // of the property values and is the value of the entire expression.
(...skipping 3778 matching lines...) Expand 10 before | Expand all | Expand 10 after
7266 } 7271 }
7267 } 7272 }
7268 7273
7269 #ifdef DEBUG 7274 #ifdef DEBUG
7270 if (graph_ != NULL) graph_->Verify(false); // No full verify. 7275 if (graph_ != NULL) graph_->Verify(false); // No full verify.
7271 if (allocator_ != NULL) allocator_->Verify(); 7276 if (allocator_ != NULL) allocator_->Verify();
7272 #endif 7277 #endif
7273 } 7278 }
7274 7279
7275 } } // namespace v8::internal 7280 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | src/runtime.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698