Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: src/objects-inl.h

Issue 159933002: A64: Synchronize with r19289. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects-debug.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 753
754 754
755 bool Object::IsDependentCode() { 755 bool Object::IsDependentCode() {
756 if (!IsFixedArray()) return false; 756 if (!IsFixedArray()) return false;
757 // There's actually no way to see the difference between a fixed array and 757 // There's actually no way to see the difference between a fixed array and
758 // a dependent codes array. 758 // a dependent codes array.
759 return true; 759 return true;
760 } 760 }
761 761
762 762
763 bool Object::IsTypeFeedbackCells() {
764 if (!IsFixedArray()) return false;
765 // There's actually no way to see the difference between a fixed array and
766 // a cache cells array. Since this is used for asserts we can check that
767 // the length is plausible though.
768 if (FixedArray::cast(this)->length() % 2 != 0) return false;
769 return true;
770 }
771
772
773 bool Object::IsContext() { 763 bool Object::IsContext() {
774 if (!Object::IsHeapObject()) return false; 764 if (!Object::IsHeapObject()) return false;
775 Map* map = HeapObject::cast(this)->map(); 765 Map* map = HeapObject::cast(this)->map();
776 Heap* heap = map->GetHeap(); 766 Heap* heap = map->GetHeap();
777 return (map == heap->function_context_map() || 767 return (map == heap->function_context_map() ||
778 map == heap->catch_context_map() || 768 map == heap->catch_context_map() ||
779 map == heap->with_context_map() || 769 map == heap->with_context_map() ||
780 map == heap->native_context_map() || 770 map == heap->native_context_map() ||
781 map == heap->block_context_map() || 771 map == heap->block_context_map() ||
782 map == heap->module_context_map() || 772 map == heap->module_context_map() ||
(...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after
2784 2774
2785 2775
2786 CAST_ACCESSOR(FixedArray) 2776 CAST_ACCESSOR(FixedArray)
2787 CAST_ACCESSOR(FixedDoubleArray) 2777 CAST_ACCESSOR(FixedDoubleArray)
2788 CAST_ACCESSOR(FixedTypedArrayBase) 2778 CAST_ACCESSOR(FixedTypedArrayBase)
2789 CAST_ACCESSOR(ConstantPoolArray) 2779 CAST_ACCESSOR(ConstantPoolArray)
2790 CAST_ACCESSOR(DescriptorArray) 2780 CAST_ACCESSOR(DescriptorArray)
2791 CAST_ACCESSOR(DeoptimizationInputData) 2781 CAST_ACCESSOR(DeoptimizationInputData)
2792 CAST_ACCESSOR(DeoptimizationOutputData) 2782 CAST_ACCESSOR(DeoptimizationOutputData)
2793 CAST_ACCESSOR(DependentCode) 2783 CAST_ACCESSOR(DependentCode)
2794 CAST_ACCESSOR(TypeFeedbackCells)
2795 CAST_ACCESSOR(StringTable) 2784 CAST_ACCESSOR(StringTable)
2796 CAST_ACCESSOR(JSFunctionResultCache) 2785 CAST_ACCESSOR(JSFunctionResultCache)
2797 CAST_ACCESSOR(NormalizedMapCache) 2786 CAST_ACCESSOR(NormalizedMapCache)
2798 CAST_ACCESSOR(ScopeInfo) 2787 CAST_ACCESSOR(ScopeInfo)
2799 CAST_ACCESSOR(CompilationCacheTable) 2788 CAST_ACCESSOR(CompilationCacheTable)
2800 CAST_ACCESSOR(CodeCacheHashTable) 2789 CAST_ACCESSOR(CodeCacheHashTable)
2801 CAST_ACCESSOR(PolymorphicCodeCacheHashTable) 2790 CAST_ACCESSOR(PolymorphicCodeCacheHashTable)
2802 CAST_ACCESSOR(MapCache) 2791 CAST_ACCESSOR(MapCache)
2803 CAST_ACCESSOR(String) 2792 CAST_ACCESSOR(String)
2804 CAST_ACCESSOR(SeqString) 2793 CAST_ACCESSOR(SeqString)
(...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after
4198 // objects. This is used in the debugger to determine whether or not 4187 // objects. This is used in the debugger to determine whether or not
4199 // a call to code object has been replaced with a debug break call. 4188 // a call to code object has been replaced with a debug break call.
4200 ASSERT(is_inline_cache_stub() || 4189 ASSERT(is_inline_cache_stub() ||
4201 result == UNINITIALIZED || 4190 result == UNINITIALIZED ||
4202 result == DEBUG_STUB); 4191 result == DEBUG_STUB);
4203 return result; 4192 return result;
4204 } 4193 }
4205 4194
4206 4195
4207 ExtraICState Code::extra_ic_state() { 4196 ExtraICState Code::extra_ic_state() {
4208 ASSERT((is_inline_cache_stub() && !needs_extended_extra_ic_state(kind())) 4197 ASSERT(is_inline_cache_stub() || ic_state() == DEBUG_STUB);
4209 || ic_state() == DEBUG_STUB);
4210 return ExtractExtraICStateFromFlags(flags()); 4198 return ExtractExtraICStateFromFlags(flags());
4211 } 4199 }
4212 4200
4213 4201
4214 ExtraICState Code::extended_extra_ic_state() {
4215 ASSERT(is_inline_cache_stub() || ic_state() == DEBUG_STUB);
4216 ASSERT(needs_extended_extra_ic_state(kind()));
4217 return ExtractExtendedExtraICStateFromFlags(flags());
4218 }
4219
4220
4221 Code::StubType Code::type() { 4202 Code::StubType Code::type() {
4222 return ExtractTypeFromFlags(flags()); 4203 return ExtractTypeFromFlags(flags());
4223 } 4204 }
4224 4205
4225 4206
4226 int Code::arguments_count() { 4207 int Code::arguments_count() {
4227 ASSERT(kind() == STUB || is_handler()); 4208 ASSERT(kind() == STUB || is_handler());
4228 return ExtractArgumentsCountFromFlags(flags()); 4209 return ExtractArgumentsCountFromFlags(flags());
4229 } 4210 }
4230 4211
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
4425 void Code::set_back_edges_patched_for_osr(bool value) { 4406 void Code::set_back_edges_patched_for_osr(bool value) {
4426 ASSERT_EQ(FUNCTION, kind()); 4407 ASSERT_EQ(FUNCTION, kind());
4427 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); 4408 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset);
4428 int updated = BackEdgesPatchedForOSRField::update(previous, value); 4409 int updated = BackEdgesPatchedForOSRField::update(previous, value);
4429 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); 4410 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated);
4430 } 4411 }
4431 4412
4432 4413
4433 4414
4434 byte Code::to_boolean_state() { 4415 byte Code::to_boolean_state() {
4435 return extended_extra_ic_state(); 4416 return extra_ic_state();
4436 } 4417 }
4437 4418
4438 4419
4439 bool Code::has_function_cache() { 4420 bool Code::has_function_cache() {
4440 ASSERT(kind() == STUB); 4421 ASSERT(kind() == STUB);
4441 return HasFunctionCacheField::decode( 4422 return HasFunctionCacheField::decode(
4442 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); 4423 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset));
4443 } 4424 }
4444 4425
4445 4426
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
4496 ASSERT(value->IsConstantPoolArray()); 4477 ASSERT(value->IsConstantPoolArray());
4497 WRITE_FIELD(this, kConstantPoolOffset, value); 4478 WRITE_FIELD(this, kConstantPoolOffset, value);
4498 WRITE_BARRIER(GetHeap(), this, kConstantPoolOffset, value); 4479 WRITE_BARRIER(GetHeap(), this, kConstantPoolOffset, value);
4499 } 4480 }
4500 4481
4501 4482
4502 Code::Flags Code::ComputeFlags(Kind kind, 4483 Code::Flags Code::ComputeFlags(Kind kind,
4503 InlineCacheState ic_state, 4484 InlineCacheState ic_state,
4504 ExtraICState extra_ic_state, 4485 ExtraICState extra_ic_state,
4505 StubType type, 4486 StubType type,
4506 int argc, 4487 Kind handler_kind,
4507 InlineCacheHolderFlag holder) { 4488 InlineCacheHolderFlag holder) {
4508 ASSERT(argc <= Code::kMaxArguments);
4509 // Compute the bit mask. 4489 // Compute the bit mask.
4510 unsigned int bits = KindField::encode(kind) 4490 unsigned int bits = KindField::encode(kind)
4511 | ICStateField::encode(ic_state) 4491 | ICStateField::encode(ic_state)
4512 | TypeField::encode(type) 4492 | TypeField::encode(type)
4513 | ExtendedExtraICStateField::encode(extra_ic_state) 4493 | ExtraICStateField::encode(extra_ic_state)
4514 | CacheHolderField::encode(holder); 4494 | CacheHolderField::encode(holder);
4515 if (!Code::needs_extended_extra_ic_state(kind)) { 4495 if (handler_kind != STUB) {
4516 bits |= (argc << kArgumentsCountShift); 4496 bits |= (handler_kind << kArgumentsCountShift);
4517 } 4497 }
4518 return static_cast<Flags>(bits); 4498 return static_cast<Flags>(bits);
4519 } 4499 }
4520 4500
4521 4501
4522 Code::Flags Code::ComputeMonomorphicFlags(Kind kind, 4502 Code::Flags Code::ComputeMonomorphicFlags(Kind kind,
4523 ExtraICState extra_ic_state, 4503 ExtraICState extra_ic_state,
4524 InlineCacheHolderFlag holder, 4504 InlineCacheHolderFlag holder,
4525 StubType type, 4505 StubType type,
4526 int argc) { 4506 Kind handler_kind) {
4527 return ComputeFlags(kind, MONOMORPHIC, extra_ic_state, type, argc, holder); 4507 return ComputeFlags(kind, MONOMORPHIC, extra_ic_state, type,
4508 handler_kind, holder);
4528 } 4509 }
4529 4510
4530 4511
4531 Code::Kind Code::ExtractKindFromFlags(Flags flags) { 4512 Code::Kind Code::ExtractKindFromFlags(Flags flags) {
4532 return KindField::decode(flags); 4513 return KindField::decode(flags);
4533 } 4514 }
4534 4515
4535 4516
4536 InlineCacheState Code::ExtractICStateFromFlags(Flags flags) { 4517 InlineCacheState Code::ExtractICStateFromFlags(Flags flags) {
4537 return ICStateField::decode(flags); 4518 return ICStateField::decode(flags);
4538 } 4519 }
4539 4520
4540 4521
4541 ExtraICState Code::ExtractExtraICStateFromFlags(Flags flags) { 4522 ExtraICState Code::ExtractExtraICStateFromFlags(Flags flags) {
4542 return ExtraICStateField::decode(flags); 4523 return ExtraICStateField::decode(flags);
4543 } 4524 }
4544 4525
4545 4526
4546 ExtraICState Code::ExtractExtendedExtraICStateFromFlags(
4547 Flags flags) {
4548 return ExtendedExtraICStateField::decode(flags);
4549 }
4550
4551
4552 Code::StubType Code::ExtractTypeFromFlags(Flags flags) { 4527 Code::StubType Code::ExtractTypeFromFlags(Flags flags) {
4553 return TypeField::decode(flags); 4528 return TypeField::decode(flags);
4554 } 4529 }
4555 4530
4556 4531
4557 int Code::ExtractArgumentsCountFromFlags(Flags flags) { 4532 int Code::ExtractArgumentsCountFromFlags(Flags flags) {
4558 return (flags & kArgumentsCountMask) >> kArgumentsCountShift; 4533 return (flags & kArgumentsCountMask) >> kArgumentsCountShift;
4559 } 4534 }
4560 4535
4561 4536
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
5673 JSDate* JSDate::cast(Object* obj) { 5648 JSDate* JSDate::cast(Object* obj) {
5674 ASSERT(obj->IsJSDate()); 5649 ASSERT(obj->IsJSDate());
5675 ASSERT(HeapObject::cast(obj)->Size() == JSDate::kSize); 5650 ASSERT(HeapObject::cast(obj)->Size() == JSDate::kSize);
5676 return reinterpret_cast<JSDate*>(obj); 5651 return reinterpret_cast<JSDate*>(obj);
5677 } 5652 }
5678 5653
5679 5654
5680 ACCESSORS(JSMessageObject, type, String, kTypeOffset) 5655 ACCESSORS(JSMessageObject, type, String, kTypeOffset)
5681 ACCESSORS(JSMessageObject, arguments, JSArray, kArgumentsOffset) 5656 ACCESSORS(JSMessageObject, arguments, JSArray, kArgumentsOffset)
5682 ACCESSORS(JSMessageObject, script, Object, kScriptOffset) 5657 ACCESSORS(JSMessageObject, script, Object, kScriptOffset)
5683 ACCESSORS(JSMessageObject, stack_trace, Object, kStackTraceOffset)
5684 ACCESSORS(JSMessageObject, stack_frames, Object, kStackFramesOffset) 5658 ACCESSORS(JSMessageObject, stack_frames, Object, kStackFramesOffset)
5685 SMI_ACCESSORS(JSMessageObject, start_position, kStartPositionOffset) 5659 SMI_ACCESSORS(JSMessageObject, start_position, kStartPositionOffset)
5686 SMI_ACCESSORS(JSMessageObject, end_position, kEndPositionOffset) 5660 SMI_ACCESSORS(JSMessageObject, end_position, kEndPositionOffset)
5687 5661
5688 5662
5689 JSMessageObject* JSMessageObject::cast(Object* obj) { 5663 JSMessageObject* JSMessageObject::cast(Object* obj) {
5690 ASSERT(obj->IsJSMessageObject()); 5664 ASSERT(obj->IsJSMessageObject());
5691 ASSERT(HeapObject::cast(obj)->Size() == JSMessageObject::kSize); 5665 ASSERT(HeapObject::cast(obj)->Size() == JSMessageObject::kSize);
5692 return reinterpret_cast<JSMessageObject*>(obj); 5666 return reinterpret_cast<JSMessageObject*>(obj);
5693 } 5667 }
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
6556 return GetHeap()->CopyFixedDoubleArray(this); 6530 return GetHeap()->CopyFixedDoubleArray(this);
6557 } 6531 }
6558 6532
6559 6533
6560 MaybeObject* ConstantPoolArray::Copy() { 6534 MaybeObject* ConstantPoolArray::Copy() {
6561 if (length() == 0) return this; 6535 if (length() == 0) return this;
6562 return GetHeap()->CopyConstantPoolArray(this); 6536 return GetHeap()->CopyConstantPoolArray(this);
6563 } 6537 }
6564 6538
6565 6539
6566 void TypeFeedbackCells::SetAstId(int index, TypeFeedbackId id) { 6540 Handle<Object> TypeFeedbackInfo::UninitializedSentinel(Isolate* isolate) {
6567 set(1 + index * 2, Smi::FromInt(id.ToInt()));
6568 }
6569
6570
6571 TypeFeedbackId TypeFeedbackCells::AstId(int index) {
6572 return TypeFeedbackId(Smi::cast(get(1 + index * 2))->value());
6573 }
6574
6575
6576 void TypeFeedbackCells::SetCell(int index, Cell* cell) {
6577 set(index * 2, cell);
6578 }
6579
6580
6581 Cell* TypeFeedbackCells::GetCell(int index) {
6582 return Cell::cast(get(index * 2));
6583 }
6584
6585
6586 Handle<Object> TypeFeedbackCells::UninitializedSentinel(Isolate* isolate) {
6587 return isolate->factory()->the_hole_value(); 6541 return isolate->factory()->the_hole_value();
6588 } 6542 }
6589 6543
6590 6544
6591 Handle<Object> TypeFeedbackCells::MegamorphicSentinel(Isolate* isolate) { 6545 Handle<Object> TypeFeedbackInfo::MegamorphicSentinel(Isolate* isolate) {
6592 return isolate->factory()->undefined_value(); 6546 return isolate->factory()->undefined_value();
6593 } 6547 }
6594 6548
6595 6549
6596 Handle<Object> TypeFeedbackCells::MonomorphicArraySentinel(Isolate* isolate, 6550 Handle<Object> TypeFeedbackInfo::MonomorphicArraySentinel(Isolate* isolate,
6597 ElementsKind elements_kind) { 6551 ElementsKind elements_kind) {
6598 return Handle<Object>(Smi::FromInt(static_cast<int>(elements_kind)), isolate); 6552 return Handle<Object>(Smi::FromInt(static_cast<int>(elements_kind)), isolate);
6599 } 6553 }
6600 6554
6601 6555
6602 Object* TypeFeedbackCells::RawUninitializedSentinel(Heap* heap) { 6556 Object* TypeFeedbackInfo::RawUninitializedSentinel(Heap* heap) {
6603 return heap->the_hole_value(); 6557 return heap->the_hole_value();
6604 } 6558 }
6605 6559
6606 6560
6607 int TypeFeedbackInfo::ic_total_count() { 6561 int TypeFeedbackInfo::ic_total_count() {
6608 int current = Smi::cast(READ_FIELD(this, kStorage1Offset))->value(); 6562 int current = Smi::cast(READ_FIELD(this, kStorage1Offset))->value();
6609 return ICTotalCountField::decode(current); 6563 return ICTotalCountField::decode(current);
6610 } 6564 }
6611 6565
6612 6566
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
6675 } 6629 }
6676 6630
6677 6631
6678 bool TypeFeedbackInfo::matches_inlined_type_change_checksum(int checksum) { 6632 bool TypeFeedbackInfo::matches_inlined_type_change_checksum(int checksum) {
6679 int value = Smi::cast(READ_FIELD(this, kStorage2Offset))->value(); 6633 int value = Smi::cast(READ_FIELD(this, kStorage2Offset))->value();
6680 int mask = (1 << kTypeChangeChecksumBits) - 1; 6634 int mask = (1 << kTypeChangeChecksumBits) - 1;
6681 return InlinedTypeChangeChecksum::decode(value) == (checksum & mask); 6635 return InlinedTypeChangeChecksum::decode(value) == (checksum & mask);
6682 } 6636 }
6683 6637
6684 6638
6685 ACCESSORS(TypeFeedbackInfo, type_feedback_cells, TypeFeedbackCells, 6639 ACCESSORS(TypeFeedbackInfo, feedback_vector, FixedArray,
6686 kTypeFeedbackCellsOffset) 6640 kFeedbackVectorOffset)
6687 6641
6688 6642
6689 SMI_ACCESSORS(AliasedArgumentsEntry, aliased_context_slot, kAliasedContextSlot) 6643 SMI_ACCESSORS(AliasedArgumentsEntry, aliased_context_slot, kAliasedContextSlot)
6690 6644
6691 6645
6692 Relocatable::Relocatable(Isolate* isolate) { 6646 Relocatable::Relocatable(Isolate* isolate) {
6693 isolate_ = isolate; 6647 isolate_ = isolate;
6694 prev_ = isolate->relocatable_top(); 6648 prev_ = isolate->relocatable_top();
6695 isolate->set_relocatable_top(this); 6649 isolate->set_relocatable_top(this);
6696 } 6650 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
6790 #undef READ_UINT32_FIELD 6744 #undef READ_UINT32_FIELD
6791 #undef WRITE_UINT32_FIELD 6745 #undef WRITE_UINT32_FIELD
6792 #undef READ_SHORT_FIELD 6746 #undef READ_SHORT_FIELD
6793 #undef WRITE_SHORT_FIELD 6747 #undef WRITE_SHORT_FIELD
6794 #undef READ_BYTE_FIELD 6748 #undef READ_BYTE_FIELD
6795 #undef WRITE_BYTE_FIELD 6749 #undef WRITE_BYTE_FIELD
6796 6750
6797 } } // namespace v8::internal 6751 } } // namespace v8::internal
6798 6752
6799 #endif // V8_OBJECTS_INL_H_ 6753 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects-debug.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698