| 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 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1162 AddInstruction(new(zone) HLoadElements(object, mapcheck)); | 1162 AddInstruction(new(zone) HLoadElements(object, mapcheck)); |
| 1163 if (is_store && (fast_elements || fast_smi_only_elements) && | 1163 if (is_store && (fast_elements || fast_smi_only_elements) && |
| 1164 store_mode != STORE_NO_TRANSITION_HANDLE_COW) { | 1164 store_mode != STORE_NO_TRANSITION_HANDLE_COW) { |
| 1165 HCheckMaps* check_cow_map = new(zone) HCheckMaps( | 1165 HCheckMaps* check_cow_map = new(zone) HCheckMaps( |
| 1166 elements, isolate()->factory()->fixed_array_map(), zone); | 1166 elements, isolate()->factory()->fixed_array_map(), zone); |
| 1167 check_cow_map->ClearGVNFlag(kDependsOnElementsKind); | 1167 check_cow_map->ClearGVNFlag(kDependsOnElementsKind); |
| 1168 AddInstruction(check_cow_map); | 1168 AddInstruction(check_cow_map); |
| 1169 } | 1169 } |
| 1170 HInstruction* length = NULL; | 1170 HInstruction* length = NULL; |
| 1171 if (is_js_array) { | 1171 if (is_js_array) { |
| 1172 length = AddInstruction(new(zone) HJSArrayLength(object, mapcheck, | 1172 length = AddInstruction( |
| 1173 HType::Smi())); | 1173 HLoadNamedField::NewArrayLength(object, zone)); |
| 1174 } else { | 1174 } else { |
| 1175 length = AddInstruction(new(zone) HFixedArrayBaseLength(elements)); | 1175 length = AddInstruction(new(zone) HFixedArrayBaseLength(elements)); |
| 1176 } | 1176 } |
| 1177 HValue* checked_key = NULL; | 1177 HValue* checked_key = NULL; |
| 1178 if (IsExternalArrayElementsKind(elements_kind)) { | 1178 if (IsExternalArrayElementsKind(elements_kind)) { |
| 1179 if (store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS) { | 1179 if (store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS) { |
| 1180 HLoadExternalArrayPointer* external_elements = | 1180 HLoadExternalArrayPointer* external_elements = |
| 1181 new(zone) HLoadExternalArrayPointer(elements); | 1181 new(zone) HLoadExternalArrayPointer(elements); |
| 1182 AddInstruction(external_elements); | 1182 AddInstruction(external_elements); |
| 1183 BailoutId previous_id = environment()->ast_id(); | 1183 BailoutId previous_id = environment()->ast_id(); |
| (...skipping 6158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7342 HBasicBlock* if_jsarray = graph()->CreateBasicBlock(); | 7342 HBasicBlock* if_jsarray = graph()->CreateBasicBlock(); |
| 7343 HBasicBlock* if_fastobject = graph()->CreateBasicBlock(); | 7343 HBasicBlock* if_fastobject = graph()->CreateBasicBlock(); |
| 7344 HHasInstanceTypeAndBranch* typecheck = | 7344 HHasInstanceTypeAndBranch* typecheck = |
| 7345 new(zone()) HHasInstanceTypeAndBranch(object, JS_ARRAY_TYPE); | 7345 new(zone()) HHasInstanceTypeAndBranch(object, JS_ARRAY_TYPE); |
| 7346 typecheck->SetSuccessorAt(0, if_jsarray); | 7346 typecheck->SetSuccessorAt(0, if_jsarray); |
| 7347 typecheck->SetSuccessorAt(1, if_fastobject); | 7347 typecheck->SetSuccessorAt(1, if_fastobject); |
| 7348 current_block()->Finish(typecheck); | 7348 current_block()->Finish(typecheck); |
| 7349 | 7349 |
| 7350 set_current_block(if_jsarray); | 7350 set_current_block(if_jsarray); |
| 7351 HInstruction* length; | 7351 HInstruction* length; |
| 7352 length = AddInstruction(new(zone()) HJSArrayLength(object, typecheck, | 7352 length = AddInstruction( |
| 7353 HType::Smi())); | 7353 HLoadNamedField::NewArrayLength(object, zone())); |
| 7354 checked_key = AddBoundsCheck(key, length, ALLOW_SMI_KEY); | 7354 checked_key = AddBoundsCheck(key, length, ALLOW_SMI_KEY); |
| 7355 access = AddInstruction(BuildFastElementAccess( | 7355 access = AddInstruction(BuildFastElementAccess( |
| 7356 elements, checked_key, val, elements_kind_branch, | 7356 elements, checked_key, val, elements_kind_branch, |
| 7357 elements_kind, is_store, STANDARD_STORE)); | 7357 elements_kind, is_store, STANDARD_STORE)); |
| 7358 if (!is_store) { | 7358 if (!is_store) { |
| 7359 Push(access); | 7359 Push(access); |
| 7360 } | 7360 } |
| 7361 | 7361 |
| 7362 *has_side_effects |= access->HasObservableSideEffects(); | 7362 *has_side_effects |= access->HasObservableSideEffects(); |
| 7363 if (position != -1) { | 7363 if (position != -1) { |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7547 expr->RecordTypeFeedback(oracle(), zone()); | 7547 expr->RecordTypeFeedback(oracle(), zone()); |
| 7548 | 7548 |
| 7549 if (TryArgumentsAccess(expr)) return; | 7549 if (TryArgumentsAccess(expr)) return; |
| 7550 | 7550 |
| 7551 CHECK_ALIVE(VisitForValue(expr->obj())); | 7551 CHECK_ALIVE(VisitForValue(expr->obj())); |
| 7552 | 7552 |
| 7553 HInstruction* instr = NULL; | 7553 HInstruction* instr = NULL; |
| 7554 if (expr->AsProperty()->IsArrayLength()) { | 7554 if (expr->AsProperty()->IsArrayLength()) { |
| 7555 HValue* array = Pop(); | 7555 HValue* array = Pop(); |
| 7556 AddInstruction(new(zone()) HCheckNonSmi(array)); | 7556 AddInstruction(new(zone()) HCheckNonSmi(array)); |
| 7557 HInstruction* mapcheck = | 7557 AddInstruction(HCheckInstanceType::NewIsJSArray(array, zone())); |
| 7558 AddInstruction(HCheckInstanceType::NewIsJSArray(array, zone())); | 7558 instr = HLoadNamedField::NewArrayLength(array, zone()); |
| 7559 instr = new(zone()) HJSArrayLength(array, mapcheck); | |
| 7560 } else if (expr->IsStringLength()) { | 7559 } else if (expr->IsStringLength()) { |
| 7561 HValue* string = Pop(); | 7560 HValue* string = Pop(); |
| 7562 AddInstruction(new(zone()) HCheckNonSmi(string)); | 7561 AddInstruction(new(zone()) HCheckNonSmi(string)); |
| 7563 AddInstruction(HCheckInstanceType::NewIsString(string, zone())); | 7562 AddInstruction(HCheckInstanceType::NewIsString(string, zone())); |
| 7564 instr = HStringLength::New(zone(), string); | 7563 instr = HStringLength::New(zone(), string); |
| 7565 } else if (expr->IsStringAccess()) { | 7564 } else if (expr->IsStringAccess()) { |
| 7566 CHECK_ALIVE(VisitForValue(expr->key())); | 7565 CHECK_ALIVE(VisitForValue(expr->key())); |
| 7567 HValue* index = Pop(); | 7566 HValue* index = Pop(); |
| 7568 HValue* string = Pop(); | 7567 HValue* string = Pop(); |
| 7569 HValue* context = environment()->LookupContext(); | 7568 HValue* context = environment()->LookupContext(); |
| (...skipping 3693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11263 } | 11262 } |
| 11264 } | 11263 } |
| 11265 | 11264 |
| 11266 #ifdef DEBUG | 11265 #ifdef DEBUG |
| 11267 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 11266 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
| 11268 if (allocator_ != NULL) allocator_->Verify(); | 11267 if (allocator_ != NULL) allocator_->Verify(); |
| 11269 #endif | 11268 #endif |
| 11270 } | 11269 } |
| 11271 | 11270 |
| 11272 } } // namespace v8::internal | 11271 } } // namespace v8::internal |
| OLD | NEW |