OLD | NEW |
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 4292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4303 } | 4303 } |
4304 } | 4304 } |
4305 return true; | 4305 return true; |
4306 } | 4306 } |
4307 | 4307 |
4308 | 4308 |
4309 void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { | 4309 void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { |
4310 ASSERT(!HasStackOverflow()); | 4310 ASSERT(!HasStackOverflow()); |
4311 ASSERT(current_block() != NULL); | 4311 ASSERT(current_block() != NULL); |
4312 ASSERT(current_block()->HasPredecessor()); | 4312 ASSERT(current_block()->HasPredecessor()); |
| 4313 expr->BuildConstantProperties(isolate()); |
4313 Handle<JSFunction> closure = function_state()->compilation_info()->closure(); | 4314 Handle<JSFunction> closure = function_state()->compilation_info()->closure(); |
4314 HInstruction* literal; | 4315 HInstruction* literal; |
4315 | 4316 |
4316 // Check whether to use fast or slow deep-copying for boilerplate. | 4317 // Check whether to use fast or slow deep-copying for boilerplate. |
4317 int max_properties = kMaxFastLiteralProperties; | 4318 int max_properties = kMaxFastLiteralProperties; |
4318 Handle<Object> literals_cell(closure->literals()->get(expr->literal_index()), | 4319 Handle<Object> literals_cell(closure->literals()->get(expr->literal_index()), |
4319 isolate()); | 4320 isolate()); |
4320 Handle<AllocationSite> site; | 4321 Handle<AllocationSite> site; |
4321 Handle<JSObject> boilerplate; | 4322 Handle<JSObject> boilerplate; |
4322 if (!literals_cell->IsUndefined()) { | 4323 if (!literals_cell->IsUndefined()) { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4424 } else { | 4425 } else { |
4425 return ast_context()->ReturnValue(Pop()); | 4426 return ast_context()->ReturnValue(Pop()); |
4426 } | 4427 } |
4427 } | 4428 } |
4428 | 4429 |
4429 | 4430 |
4430 void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { | 4431 void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { |
4431 ASSERT(!HasStackOverflow()); | 4432 ASSERT(!HasStackOverflow()); |
4432 ASSERT(current_block() != NULL); | 4433 ASSERT(current_block() != NULL); |
4433 ASSERT(current_block()->HasPredecessor()); | 4434 ASSERT(current_block()->HasPredecessor()); |
| 4435 expr->BuildConstantElements(isolate()); |
4434 ZoneList<Expression*>* subexprs = expr->values(); | 4436 ZoneList<Expression*>* subexprs = expr->values(); |
4435 int length = subexprs->length(); | 4437 int length = subexprs->length(); |
4436 HInstruction* literal; | 4438 HInstruction* literal; |
4437 | 4439 |
4438 Handle<AllocationSite> site; | 4440 Handle<AllocationSite> site; |
4439 Handle<FixedArray> literals(environment()->closure()->literals(), isolate()); | 4441 Handle<FixedArray> literals(environment()->closure()->literals(), isolate()); |
4440 bool uninitialized = false; | 4442 bool uninitialized = false; |
4441 Handle<Object> literals_cell(literals->get(expr->literal_index()), | 4443 Handle<Object> literals_cell(literals->get(expr->literal_index()), |
4442 isolate()); | 4444 isolate()); |
4443 Handle<JSObject> boilerplate_object; | 4445 Handle<JSObject> boilerplate_object; |
(...skipping 5379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9823 if (ShouldProduceTraceOutput()) { | 9825 if (ShouldProduceTraceOutput()) { |
9824 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 9826 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
9825 } | 9827 } |
9826 | 9828 |
9827 #ifdef DEBUG | 9829 #ifdef DEBUG |
9828 graph_->Verify(false); // No full verify. | 9830 graph_->Verify(false); // No full verify. |
9829 #endif | 9831 #endif |
9830 } | 9832 } |
9831 | 9833 |
9832 } } // namespace v8::internal | 9834 } } // namespace v8::internal |
OLD | NEW |