| Index: src/objects-inl.h
|
| diff --git a/src/objects-inl.h b/src/objects-inl.h
|
| index 51e8f3f2f3e8de2a18020382e271dc3ee22b1cb1..0fa4e7ae7a612292c855beeefa904b4e70b47dd3 100644
|
| --- a/src/objects-inl.h
|
| +++ b/src/objects-inl.h
|
| @@ -45,7 +45,7 @@
|
| #include "spaces.h"
|
| #include "store-buffer.h"
|
| #include "v8memory.h"
|
| -
|
| +#include "factory.h"
|
| #include "incremental-marking.h"
|
|
|
| namespace v8 {
|
| @@ -554,6 +554,16 @@ bool Object::IsDeoptimizationOutputData() {
|
| }
|
|
|
|
|
| +bool Object::IsTypeFeedbackCells() {
|
| + if (!IsFixedArray()) return false;
|
| + // There's actually no way to see the difference between a fixed array and
|
| + // a cache cells array. Since this is used for asserts we can check that
|
| + // the length is plausible though.
|
| + if (FixedArray::cast(this)->length() % 2 != 0) return false;
|
| + return true;
|
| +}
|
| +
|
| +
|
| bool Object::IsContext() {
|
| if (Object::IsHeapObject()) {
|
| Map* map = HeapObject::cast(this)->map();
|
| @@ -2101,6 +2111,7 @@ CAST_ACCESSOR(FixedDoubleArray)
|
| CAST_ACCESSOR(DescriptorArray)
|
| CAST_ACCESSOR(DeoptimizationInputData)
|
| CAST_ACCESSOR(DeoptimizationOutputData)
|
| +CAST_ACCESSOR(TypeFeedbackCells)
|
| CAST_ACCESSOR(SymbolTable)
|
| CAST_ACCESSOR(JSFunctionResultCache)
|
| CAST_ACCESSOR(NormalizedMapCache)
|
| @@ -3167,18 +3178,6 @@ void Code::set_to_boolean_state(byte value) {
|
| }
|
|
|
|
|
| -bool Code::has_function_cache() {
|
| - ASSERT(kind() == STUB);
|
| - return READ_BYTE_FIELD(this, kHasFunctionCacheOffset) != 0;
|
| -}
|
| -
|
| -
|
| -void Code::set_has_function_cache(bool flag) {
|
| - ASSERT(kind() == STUB);
|
| - WRITE_BYTE_FIELD(this, kHasFunctionCacheOffset, flag);
|
| -}
|
| -
|
| -
|
| bool Code::is_inline_cache_stub() {
|
| Kind kind = this->kind();
|
| return kind >= FIRST_IC_KIND && kind <= LAST_IC_KIND;
|
| @@ -4042,6 +4041,8 @@ INT_ACCESSORS(Code, instruction_size, kInstructionSizeOffset)
|
| ACCESSORS(Code, relocation_info, ByteArray, kRelocationInfoOffset)
|
| ACCESSORS(Code, handler_table, FixedArray, kHandlerTableOffset)
|
| ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset)
|
| +ACCESSORS(Code, type_feedback_cells,
|
| + TypeFeedbackCells, kTypeFeedbackCellsOffset)
|
| ACCESSORS(Code, next_code_flushing_candidate,
|
| Object, kNextCodeFlushingCandidateOffset)
|
|
|
| @@ -4685,6 +4686,41 @@ MaybeObject* FixedDoubleArray::Copy() {
|
| }
|
|
|
|
|
| +void TypeFeedbackCells::SetAstId(int index, Smi* id) {
|
| + set(1 + index * 2, id);
|
| +}
|
| +
|
| +
|
| +Smi* TypeFeedbackCells::AstId(int index) {
|
| + return Smi::cast(get(1 + index * 2));
|
| +}
|
| +
|
| +
|
| +void TypeFeedbackCells::SetCell(int index, JSGlobalPropertyCell* cell) {
|
| + set(index * 2, cell);
|
| +}
|
| +
|
| +
|
| +JSGlobalPropertyCell* TypeFeedbackCells::Cell(int index) {
|
| + return JSGlobalPropertyCell::cast(get(index * 2));
|
| +}
|
| +
|
| +
|
| +Handle<Object> TypeFeedbackCells::UninitializedSentinel(Isolate* isolate) {
|
| + return isolate->factory()->the_hole_value();
|
| +}
|
| +
|
| +
|
| +Handle<Object> TypeFeedbackCells::MegamorphicSentinel(Isolate* isolate) {
|
| + return isolate->factory()->undefined_value();
|
| +}
|
| +
|
| +
|
| +Object* TypeFeedbackCells::RawUninitializedSentinel(Heap* heap) {
|
| + return heap->raw_unchecked_the_hole_value();
|
| +}
|
| +
|
| +
|
| Relocatable::Relocatable(Isolate* isolate) {
|
| ASSERT(isolate == Isolate::Current());
|
| isolate_ = isolate;
|
|
|