| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 code->set_stack_slots(GetStackSlotCount()); | 89 code->set_stack_slots(GetStackSlotCount()); |
| 90 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); | 90 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); |
| 91 if (FLAG_weak_embedded_maps_in_optimized_code) { | 91 if (FLAG_weak_embedded_maps_in_optimized_code) { |
| 92 RegisterDependentCodeForEmbeddedMaps(code); | 92 RegisterDependentCodeForEmbeddedMaps(code); |
| 93 } | 93 } |
| 94 PopulateDeoptimizationData(code); | 94 PopulateDeoptimizationData(code); |
| 95 info()->CommitDependencies(code); | 95 info()->CommitDependencies(code); |
| 96 } | 96 } |
| 97 | 97 |
| 98 | 98 |
| 99 void LChunkBuilder::Abort(const char* reason) { | 99 void LChunkBuilder::Abort(BailoutReason reason) { |
| 100 info()->set_bailout_reason(reason); | 100 info()->set_bailout_reason(reason); |
| 101 status_ = ABORTED; | 101 status_ = ABORTED; |
| 102 } | 102 } |
| 103 | 103 |
| 104 | 104 |
| 105 void LCodeGen::Comment(const char* format, ...) { | 105 void LCodeGen::Comment(const char* format, ...) { |
| 106 if (!FLAG_code_comments) return; | 106 if (!FLAG_code_comments) return; |
| 107 char buffer[4 * KB]; | 107 char buffer[4 * KB]; |
| 108 StringBuilder builder(buffer, ARRAY_SIZE(buffer)); | 108 StringBuilder builder(buffer, ARRAY_SIZE(buffer)); |
| 109 va_list arguments; | 109 va_list arguments; |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 void LCodeGen::DeoptimizeIf(Condition cc, | 649 void LCodeGen::DeoptimizeIf(Condition cc, |
| 650 LEnvironment* environment, | 650 LEnvironment* environment, |
| 651 Deoptimizer::BailoutType bailout_type) { | 651 Deoptimizer::BailoutType bailout_type) { |
| 652 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 652 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
| 653 ASSERT(environment->HasBeenRegistered()); | 653 ASSERT(environment->HasBeenRegistered()); |
| 654 int id = environment->deoptimization_index(); | 654 int id = environment->deoptimization_index(); |
| 655 ASSERT(info()->IsOptimizing() || info()->IsStub()); | 655 ASSERT(info()->IsOptimizing() || info()->IsStub()); |
| 656 Address entry = | 656 Address entry = |
| 657 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); | 657 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); |
| 658 if (entry == NULL) { | 658 if (entry == NULL) { |
| 659 Abort("bailout was not prepared"); | 659 Abort(kBailoutWasNotPrepared); |
| 660 return; | 660 return; |
| 661 } | 661 } |
| 662 | 662 |
| 663 ASSERT(FLAG_deopt_every_n_times == 0); // Not yet implemented on x64. | 663 ASSERT(FLAG_deopt_every_n_times == 0); // Not yet implemented on x64. |
| 664 | 664 |
| 665 if (FLAG_trap_on_deopt && info()->IsOptimizing()) { | 665 if (FLAG_trap_on_deopt && info()->IsOptimizing()) { |
| 666 Label done; | 666 Label done; |
| 667 if (cc != no_condition) { | 667 if (cc != no_condition) { |
| 668 __ j(NegateCondition(cc), &done, Label::kNear); | 668 __ j(NegateCondition(cc), &done, Label::kNear); |
| 669 } | 669 } |
| (...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1630 if (FLAG_debug_code) { | 1630 if (FLAG_debug_code) { |
| 1631 __ push(value); | 1631 __ push(value); |
| 1632 __ movq(value, FieldOperand(string, HeapObject::kMapOffset)); | 1632 __ movq(value, FieldOperand(string, HeapObject::kMapOffset)); |
| 1633 __ movzxbq(value, FieldOperand(value, Map::kInstanceTypeOffset)); | 1633 __ movzxbq(value, FieldOperand(value, Map::kInstanceTypeOffset)); |
| 1634 | 1634 |
| 1635 __ andb(value, Immediate(kStringRepresentationMask | kStringEncodingMask)); | 1635 __ andb(value, Immediate(kStringRepresentationMask | kStringEncodingMask)); |
| 1636 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag; | 1636 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag; |
| 1637 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag; | 1637 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag; |
| 1638 __ cmpq(value, Immediate(encoding == String::ONE_BYTE_ENCODING | 1638 __ cmpq(value, Immediate(encoding == String::ONE_BYTE_ENCODING |
| 1639 ? one_byte_seq_type : two_byte_seq_type)); | 1639 ? one_byte_seq_type : two_byte_seq_type)); |
| 1640 __ Check(equal, "Unexpected string type"); | 1640 __ Check(equal, kUnexpectedStringType); |
| 1641 __ pop(value); | 1641 __ pop(value); |
| 1642 } | 1642 } |
| 1643 | 1643 |
| 1644 if (encoding == String::ONE_BYTE_ENCODING) { | 1644 if (encoding == String::ONE_BYTE_ENCODING) { |
| 1645 __ movb(FieldOperand(string, index, times_1, SeqString::kHeaderSize), | 1645 __ movb(FieldOperand(string, index, times_1, SeqString::kHeaderSize), |
| 1646 value); | 1646 value); |
| 1647 } else { | 1647 } else { |
| 1648 __ movw(FieldOperand(string, index, times_2, SeqString::kHeaderSize), | 1648 __ movw(FieldOperand(string, index, times_2, SeqString::kHeaderSize), |
| 1649 value); | 1649 value); |
| 1650 } | 1650 } |
| (...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3076 LOperand* elements_pointer, | 3076 LOperand* elements_pointer, |
| 3077 LOperand* key, | 3077 LOperand* key, |
| 3078 ElementsKind elements_kind, | 3078 ElementsKind elements_kind, |
| 3079 uint32_t offset, | 3079 uint32_t offset, |
| 3080 uint32_t additional_index) { | 3080 uint32_t additional_index) { |
| 3081 Register elements_pointer_reg = ToRegister(elements_pointer); | 3081 Register elements_pointer_reg = ToRegister(elements_pointer); |
| 3082 int shift_size = ElementsKindToShiftSize(elements_kind); | 3082 int shift_size = ElementsKindToShiftSize(elements_kind); |
| 3083 if (key->IsConstantOperand()) { | 3083 if (key->IsConstantOperand()) { |
| 3084 int constant_value = ToInteger32(LConstantOperand::cast(key)); | 3084 int constant_value = ToInteger32(LConstantOperand::cast(key)); |
| 3085 if (constant_value & 0xF0000000) { | 3085 if (constant_value & 0xF0000000) { |
| 3086 Abort("array index constant value too big"); | 3086 Abort(kArrayIndexConstantValueTooBig); |
| 3087 } | 3087 } |
| 3088 return Operand(elements_pointer_reg, | 3088 return Operand(elements_pointer_reg, |
| 3089 ((constant_value + additional_index) << shift_size) | 3089 ((constant_value + additional_index) << shift_size) |
| 3090 + offset); | 3090 + offset); |
| 3091 } else { | 3091 } else { |
| 3092 ScaleFactor scale_factor = static_cast<ScaleFactor>(shift_size); | 3092 ScaleFactor scale_factor = static_cast<ScaleFactor>(shift_size); |
| 3093 return Operand(elements_pointer_reg, | 3093 return Operand(elements_pointer_reg, |
| 3094 ToRegister(key), | 3094 ToRegister(key), |
| 3095 scale_factor, | 3095 scale_factor, |
| 3096 offset + (additional_index << shift_size)); | 3096 offset + (additional_index << shift_size)); |
| (...skipping 2462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5559 FixedArray::kHeaderSize - kPointerSize)); | 5559 FixedArray::kHeaderSize - kPointerSize)); |
| 5560 __ bind(&done); | 5560 __ bind(&done); |
| 5561 } | 5561 } |
| 5562 | 5562 |
| 5563 | 5563 |
| 5564 #undef __ | 5564 #undef __ |
| 5565 | 5565 |
| 5566 } } // namespace v8::internal | 5566 } } // namespace v8::internal |
| 5567 | 5567 |
| 5568 #endif // V8_TARGET_ARCH_X64 | 5568 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |