| 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 6330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6341 if (position != RelocInfo::kNoPosition) instr->set_position(position); | 6341 if (position != RelocInfo::kNoPosition) instr->set_position(position); |
| 6342 return is_store ? NULL : instr; | 6342 return is_store ? NULL : instr; |
| 6343 } | 6343 } |
| 6344 | 6344 |
| 6345 HInstruction* checkspec = | 6345 HInstruction* checkspec = |
| 6346 AddInstruction(HCheckInstanceType::NewIsSpecObject(object, zone())); | 6346 AddInstruction(HCheckInstanceType::NewIsSpecObject(object, zone())); |
| 6347 HBasicBlock* join = graph()->CreateBasicBlock(); | 6347 HBasicBlock* join = graph()->CreateBasicBlock(); |
| 6348 | 6348 |
| 6349 HInstruction* elements_kind_instr = | 6349 HInstruction* elements_kind_instr = |
| 6350 AddInstruction(new(zone()) HElementsKind(object)); | 6350 AddInstruction(new(zone()) HElementsKind(object)); |
| 6351 HCompareConstantEqAndBranch* elements_kind_branch = NULL; | |
| 6352 HInstruction* elements = | 6351 HInstruction* elements = |
| 6353 AddInstruction(new(zone()) HLoadElements(object, checkspec)); | 6352 AddInstruction(new(zone()) HLoadElements(object, checkspec)); |
| 6354 HLoadExternalArrayPointer* external_elements = NULL; | 6353 HLoadExternalArrayPointer* external_elements = NULL; |
| 6355 HInstruction* checked_key = NULL; | 6354 HInstruction* checked_key = NULL; |
| 6356 | 6355 |
| 6357 // Generated code assumes that FAST_* and DICTIONARY_ELEMENTS ElementsKinds | 6356 // Generated code assumes that FAST_* and DICTIONARY_ELEMENTS ElementsKinds |
| 6358 // are handled before external arrays. | 6357 // are handled before external arrays. |
| 6359 STATIC_ASSERT(FAST_SMI_ELEMENTS < FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND); | 6358 STATIC_ASSERT(FAST_SMI_ELEMENTS < FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND); |
| 6360 STATIC_ASSERT(FAST_HOLEY_ELEMENTS < FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND); | 6359 STATIC_ASSERT(FAST_HOLEY_ELEMENTS < FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND); |
| 6361 STATIC_ASSERT(FAST_DOUBLE_ELEMENTS < FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND); | 6360 STATIC_ASSERT(FAST_DOUBLE_ELEMENTS < FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 6372 && todo_external_array) { | 6371 && todo_external_array) { |
| 6373 HInstruction* length = | 6372 HInstruction* length = |
| 6374 AddInstruction(new(zone()) HFixedArrayBaseLength(elements)); | 6373 AddInstruction(new(zone()) HFixedArrayBaseLength(elements)); |
| 6375 checked_key = AddInstruction(new(zone()) HBoundsCheck(key, length)); | 6374 checked_key = AddInstruction(new(zone()) HBoundsCheck(key, length)); |
| 6376 external_elements = new(zone()) HLoadExternalArrayPointer(elements); | 6375 external_elements = new(zone()) HLoadExternalArrayPointer(elements); |
| 6377 AddInstruction(external_elements); | 6376 AddInstruction(external_elements); |
| 6378 } | 6377 } |
| 6379 if (type_todo[elements_kind]) { | 6378 if (type_todo[elements_kind]) { |
| 6380 HBasicBlock* if_true = graph()->CreateBasicBlock(); | 6379 HBasicBlock* if_true = graph()->CreateBasicBlock(); |
| 6381 HBasicBlock* if_false = graph()->CreateBasicBlock(); | 6380 HBasicBlock* if_false = graph()->CreateBasicBlock(); |
| 6382 elements_kind_branch = new(zone()) HCompareConstantEqAndBranch( | 6381 HCompareConstantEqAndBranch* elements_kind_branch = |
| 6383 elements_kind_instr, elements_kind, Token::EQ_STRICT); | 6382 new(zone()) HCompareConstantEqAndBranch( |
| 6383 elements_kind_instr, elements_kind, Token::EQ_STRICT); |
| 6384 elements_kind_branch->SetSuccessorAt(0, if_true); | 6384 elements_kind_branch->SetSuccessorAt(0, if_true); |
| 6385 elements_kind_branch->SetSuccessorAt(1, if_false); | 6385 elements_kind_branch->SetSuccessorAt(1, if_false); |
| 6386 current_block()->Finish(elements_kind_branch); | 6386 current_block()->Finish(elements_kind_branch); |
| 6387 | 6387 |
| 6388 set_current_block(if_true); | 6388 set_current_block(if_true); |
| 6389 HInstruction* access; | 6389 HInstruction* access; |
| 6390 if (IsFastElementsKind(elements_kind)) { | 6390 if (IsFastElementsKind(elements_kind)) { |
| 6391 if (is_store && !IsFastDoubleElementsKind(elements_kind)) { | 6391 if (is_store && !IsFastDoubleElementsKind(elements_kind)) { |
| 6392 AddInstruction(new(zone()) HCheckMaps( | 6392 AddInstruction(new(zone()) HCheckMaps( |
| 6393 elements, isolate()->factory()->fixed_array_map(), | 6393 elements, isolate()->factory()->fixed_array_map(), |
| (...skipping 3617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10011 } | 10011 } |
| 10012 } | 10012 } |
| 10013 | 10013 |
| 10014 #ifdef DEBUG | 10014 #ifdef DEBUG |
| 10015 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 10015 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
| 10016 if (allocator_ != NULL) allocator_->Verify(); | 10016 if (allocator_ != NULL) allocator_->Verify(); |
| 10017 #endif | 10017 #endif |
| 10018 } | 10018 } |
| 10019 | 10019 |
| 10020 } } // namespace v8::internal | 10020 } } // namespace v8::internal |
| OLD | NEW |