OLD | NEW |
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 6066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6077 AddInstruction(new(zone()) HPushArgument(AddInstruction( | 6077 AddInstruction(new(zone()) HPushArgument(AddInstruction( |
6078 new(zone()) HConstant(constants)))); | 6078 new(zone()) HConstant(constants)))); |
6079 | 6079 |
6080 Runtime::FunctionId function_id = (expr->depth() > 1) | 6080 Runtime::FunctionId function_id = (expr->depth() > 1) |
6081 ? Runtime::kCreateArrayLiteral : Runtime::kCreateArrayLiteralShallow; | 6081 ? Runtime::kCreateArrayLiteral : Runtime::kCreateArrayLiteralShallow; |
6082 literal = AddInstruction( | 6082 literal = AddInstruction( |
6083 new(zone()) HCallRuntime(context, | 6083 new(zone()) HCallRuntime(context, |
6084 isolate()->factory()->empty_string(), | 6084 isolate()->factory()->empty_string(), |
6085 Runtime::FunctionForId(function_id), | 6085 Runtime::FunctionForId(function_id), |
6086 3)); | 6086 3)); |
| 6087 |
| 6088 // De-opt if elements kind changed from boilerplate_elements_kind. |
| 6089 Handle<Map> map = Handle<Map>(original_boilerplate_object->map(), |
| 6090 isolate()); |
| 6091 AddInstruction(HCheckMaps::New(literal, map, zone())); |
6087 } | 6092 } |
6088 | 6093 |
6089 // The array is expected in the bailout environment during computation | 6094 // The array is expected in the bailout environment during computation |
6090 // of the property values and is the value of the entire expression. | 6095 // of the property values and is the value of the entire expression. |
6091 Push(literal); | 6096 Push(literal); |
6092 // The literal index is on the stack, too. | 6097 // The literal index is on the stack, too. |
6093 Push(AddInstruction(new(zone()) HConstant(expr->literal_index()))); | 6098 Push(AddInstruction(new(zone()) HConstant(expr->literal_index()))); |
6094 | 6099 |
6095 HInstruction* elements = NULL; | 6100 HInstruction* elements = NULL; |
6096 | 6101 |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6416 } | 6421 } |
6417 } | 6422 } |
6418 | 6423 |
6419 if (count != types->length()) return false; | 6424 if (count != types->length()) return false; |
6420 | 6425 |
6421 // Everything matched; can use monomorphic store. | 6426 // Everything matched; can use monomorphic store. |
6422 BuildCheckNonSmi(object); | 6427 BuildCheckNonSmi(object); |
6423 AddInstruction(HCheckMaps::New(object, types, zone())); | 6428 AddInstruction(HCheckMaps::New(object, types, zone())); |
6424 HInstruction* store; | 6429 HInstruction* store; |
6425 CHECK_ALIVE_OR_RETURN( | 6430 CHECK_ALIVE_OR_RETURN( |
6426 store = BuildStoreNamedField(object, name, value, types->at(0), &lookup), | 6431 store = BuildStoreNamedField( |
| 6432 object, name, value, types->at(count - 1), &lookup), |
6427 true); | 6433 true); |
6428 Push(value); | 6434 Push(value); |
6429 store->set_position(expr->position()); | 6435 store->set_position(expr->position()); |
6430 AddInstruction(store); | 6436 AddInstruction(store); |
6431 AddSimulate(expr->AssignmentId()); | 6437 AddSimulate(expr->AssignmentId()); |
6432 ast_context()->ReturnValue(Pop()); | 6438 ast_context()->ReturnValue(Pop()); |
6433 return true; | 6439 return true; |
6434 } | 6440 } |
6435 | 6441 |
6436 | 6442 |
(...skipping 5220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11657 } | 11663 } |
11658 } | 11664 } |
11659 | 11665 |
11660 #ifdef DEBUG | 11666 #ifdef DEBUG |
11661 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 11667 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
11662 if (allocator_ != NULL) allocator_->Verify(); | 11668 if (allocator_ != NULL) allocator_->Verify(); |
11663 #endif | 11669 #endif |
11664 } | 11670 } |
11665 | 11671 |
11666 } } // namespace v8::internal | 11672 } } // namespace v8::internal |
OLD | NEW |