Revision: 24037
Author: [email protected]
Date: Thu Sep 18 12:31:31 2014 UTC
Log: Move state sentinels into TypeFeedbackVector.
These sentinels were in the wrong place, living in only tangentially
related class TypeFeedbackInfo, but they codify state in the
TypeFeedbackVector.
[email protected]
Review URL: https://codereview.chromium.org/579153003
https://code.google.com/p/v8/source/detail?r=24037
Added:
/branches/bleeding_edge/src/type-feedback-vector-inl.h
Modified:
/branches/bleeding_edge/BUILD.gn
/branches/bleeding_edge/src/arm/code-stubs-arm.cc
/branches/bleeding_edge/src/arm/full-codegen-arm.cc
/branches/bleeding_edge/src/arm64/code-stubs-arm64.cc
/branches/bleeding_edge/src/arm64/full-codegen-arm64.cc
/branches/bleeding_edge/src/factory.cc
/branches/bleeding_edge/src/ia32/code-stubs-ia32.cc
/branches/bleeding_edge/src/ia32/full-codegen-ia32.cc
/branches/bleeding_edge/src/ic/ic-inl.h
/branches/bleeding_edge/src/ic/ic.cc
/branches/bleeding_edge/src/ic/ic.h
/branches/bleeding_edge/src/mips/code-stubs-mips.cc
/branches/bleeding_edge/src/mips/full-codegen-mips.cc
/branches/bleeding_edge/src/objects-inl.h
/branches/bleeding_edge/src/objects.cc
/branches/bleeding_edge/src/objects.h
/branches/bleeding_edge/src/type-feedback-vector.cc
/branches/bleeding_edge/src/type-feedback-vector.h
/branches/bleeding_edge/src/type-info.cc
/branches/bleeding_edge/src/x64/code-stubs-x64.cc
/branches/bleeding_edge/src/x64/full-codegen-x64.cc
/branches/bleeding_edge/test/cctest/test-heap.cc
/branches/bleeding_edge/tools/gyp/v8.gyp
=======================================
--- /dev/null
+++ /branches/bleeding_edge/src/type-feedback-vector-inl.h Thu Sep 18
12:31:31 2014 UTC
@@ -0,0 +1,45 @@
+// Copyright 2012 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_TYPE_FEEDBACK_VECTOR_INL_H_
+#define V8_TYPE_FEEDBACK_VECTOR_INL_H_
+
+#include "src/type-feedback-vector.h"
+
+namespace v8 {
+namespace internal {
+
+Handle<Object> TypeFeedbackVector::UninitializedSentinel(Isolate* isolate)
{
+ return isolate->factory()->uninitialized_symbol();
+}
+
+
+Handle<Object> TypeFeedbackVector::MegamorphicSentinel(Isolate* isolate) {
+ return isolate->factory()->megamorphic_symbol();
+}
+
+
+Handle<Object> TypeFeedbackVector::PremonomorphicSentinel(Isolate*
isolate) {
+ return isolate->factory()->megamorphic_symbol();
+}
+
+
+Handle<Object> TypeFeedbackVector::GenericSentinel(Isolate* isolate) {
+ return isolate->factory()->generic_symbol();
+}
+
+
+Handle<Object> TypeFeedbackVector::MonomorphicArraySentinel(
+ Isolate* isolate, ElementsKind elements_kind) {
+ return Handle<Object>(Smi::FromInt(static_cast<int>(elements_kind)),
isolate);
+}
+
+
+Object* TypeFeedbackVector::RawUninitializedSentinel(Heap* heap) {
+ return heap->uninitialized_symbol();
+}
+}
+} // namespace v8::internal
+
+#endif // V8_TYPE_FEEDBACK_VECTOR_INL_H_
=======================================
--- /branches/bleeding_edge/BUILD.gn Thu Sep 18 09:59:53 2014 UTC
+++ /branches/bleeding_edge/BUILD.gn Thu Sep 18 12:31:31 2014 UTC
@@ -848,6 +848,7 @@
"src/transitions-inl.h",
"src/transitions.cc",
"src/transitions.h",
+ "src/type-feedback-vector-inl.h",
"src/type-feedback-vector.cc",
"src/type-feedback-vector.h",
"src/type-info.cc",
=======================================
--- /branches/bleeding_edge/src/arm/code-stubs-arm.cc Tue Sep 16 12:51:33
2014 UTC
+++ /branches/bleeding_edge/src/arm/code-stubs-arm.cc Thu Sep 18 12:31:31
2014 UTC
@@ -2316,9 +2316,9 @@
// r3 : slot in feedback vector (Smi)
Label initialize, done, miss, megamorphic, not_array_function;
- DCHECK_EQ(*TypeFeedbackInfo::MegamorphicSentinel(masm->isolate()),
+ DCHECK_EQ(*TypeFeedbackVector::MegamorphicSentinel(masm->isolate()),
masm->isolate()->heap()->megamorphic_symbol());
- DCHECK_EQ(*TypeFeedbackInfo::UninitializedSentinel(masm->isolate()),
+ DCHECK_EQ(*TypeFeedbackVector::UninitializedSentinel(masm->isolate()),
masm->isolate()->heap()->uninitialized_symbol());
// Load the cache state into r4.
=======================================
--- /branches/bleeding_edge/src/arm/full-codegen-arm.cc Tue Sep 16 12:51:33
2014 UTC
+++ /branches/bleeding_edge/src/arm/full-codegen-arm.cc Thu Sep 18 12:31:31
2014 UTC
@@ -1193,7 +1193,7 @@
__ bind(&fixed_array);
__ Move(r1, FeedbackVector());
- __ mov(r2, Operand(TypeFeedbackInfo::MegamorphicSentinel(isolate())));
+ __ mov(r2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
__ str(r2, FieldMemOperand(r1, FixedArray::OffsetOfElementAt(slot)));
__ mov(r1, Operand(Smi::FromInt(1))); // Smi indicates slow check
=======================================
--- /branches/bleeding_edge/src/arm64/code-stubs-arm64.cc Tue Sep 16
12:51:33 2014 UTC
+++ /branches/bleeding_edge/src/arm64/code-stubs-arm64.cc Thu Sep 18
12:31:31 2014 UTC
@@ -2632,9 +2632,9 @@
// index : slot in feedback vector (smi)
Label initialize, done, miss, megamorphic, not_array_function;
- DCHECK_EQ(*TypeFeedbackInfo::MegamorphicSentinel(masm->isolate()),
+ DCHECK_EQ(*TypeFeedbackVector::MegamorphicSentinel(masm->isolate()),
masm->isolate()->heap()->megamorphic_symbol());
- DCHECK_EQ(*TypeFeedbackInfo::UninitializedSentinel(masm->isolate()),
+ DCHECK_EQ(*TypeFeedbackVector::UninitializedSentinel(masm->isolate()),
masm->isolate()->heap()->uninitialized_symbol());
// Load the cache state.
=======================================
--- /branches/bleeding_edge/src/arm64/full-codegen-arm64.cc Tue Sep 16
12:51:33 2014 UTC
+++ /branches/bleeding_edge/src/arm64/full-codegen-arm64.cc Thu Sep 18
12:31:31 2014 UTC
@@ -1180,7 +1180,7 @@
__ Bind(&fixed_array);
__ LoadObject(x1, FeedbackVector());
- __ Mov(x10, Operand(TypeFeedbackInfo::MegamorphicSentinel(isolate())));
+ __ Mov(x10, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
__ Str(x10, FieldMemOperand(x1, FixedArray::OffsetOfElementAt(slot)));
__ Mov(x1, Smi::FromInt(1)); // Smi indicates slow check.
=======================================
--- /branches/bleeding_edge/src/factory.cc Thu Sep 18 09:59:53 2014 UTC
+++ /branches/bleeding_edge/src/factory.cc Thu Sep 18 12:31:31 2014 UTC
@@ -1889,7 +1889,7 @@
Handle<TypeFeedbackVector> Factory::NewTypeFeedbackVector(int slot_count) {
// Ensure we can skip the write barrier
DCHECK_EQ(isolate()->heap()->uninitialized_symbol(),
- *TypeFeedbackInfo::UninitializedSentinel(isolate()));
+ *TypeFeedbackVector::UninitializedSentinel(isolate()));
if (slot_count == 0) {
return Handle<TypeFeedbackVector>::cast(empty_fixed_array());
@@ -1898,7 +1898,7 @@
CALL_HEAP_FUNCTION(isolate(),
isolate()->heap()->AllocateFixedArrayWithFiller(
slot_count, TENURED,
-
*TypeFeedbackInfo::UninitializedSentinel(isolate())),
+
*TypeFeedbackVector::UninitializedSentinel(isolate())),
TypeFeedbackVector);
}
=======================================
--- /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Tue Sep 16 12:51:33
2014 UTC
+++ /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Thu Sep 18 12:31:31
2014 UTC
@@ -1830,7 +1830,7 @@
// function without changing the state.
__ cmp(ecx, edi);
__ j(equal, &done, Label::kFar);
- __ cmp(ecx, Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate)));
+ __ cmp(ecx, Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate)));
__ j(equal, &done, Label::kFar);
if (!FLAG_pretenuring_call_new) {
@@ -1853,14 +1853,14 @@
// A monomorphic miss (i.e, here the cache is not uninitialized) goes
// megamorphic.
- __ cmp(ecx, Immediate(TypeFeedbackInfo::UninitializedSentinel(isolate)));
+ __ cmp(ecx,
Immediate(TypeFeedbackVector::UninitializedSentinel(isolate)));
__ j(equal, &initialize);
// MegamorphicSentinel is an immortal immovable object (undefined) so no
// write-barrier is needed.
__ bind(&megamorphic);
- __ mov(FieldOperand(ebx, edx, times_half_pointer_size,
- FixedArray::kHeaderSize),
- Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate)));
+ __ mov(
+ FieldOperand(ebx, edx, times_half_pointer_size,
FixedArray::kHeaderSize),
+ Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate)));
__ jmp(&done, Label::kFar);
// An uninitialized cache is patched with the function or sentinel to
@@ -2196,9 +2196,9 @@
__ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size,
FixedArray::kHeaderSize));
- __ cmp(ecx, Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate)));
+ __ cmp(ecx, Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate)));
__ j(equal, &slow_start);
- __ cmp(ecx, Immediate(TypeFeedbackInfo::UninitializedSentinel(isolate)));
+ __ cmp(ecx,
Immediate(TypeFeedbackVector::UninitializedSentinel(isolate)));
__ j(equal, &miss);
if (!FLAG_trace_ic) {
@@ -2209,7 +2209,7 @@
__ j(not_equal, &miss);
__ mov(FieldOperand(ebx, edx, times_half_pointer_size,
FixedArray::kHeaderSize),
- Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate)));
+ Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate)));
__ jmp(&slow_start);
}
=======================================
--- /branches/bleeding_edge/src/ia32/full-codegen-ia32.cc Tue Sep 16
12:51:33 2014 UTC
+++ /branches/bleeding_edge/src/ia32/full-codegen-ia32.cc Thu Sep 18
12:31:31 2014 UTC
@@ -1118,7 +1118,7 @@
// No need for a write barrier, we are storing a Smi in the feedback
vector.
__ LoadHeapObject(ebx, FeedbackVector());
__ mov(FieldOperand(ebx, FixedArray::OffsetOfElementAt(slot)),
- Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate())));
+ Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate())));
__ mov(ebx, Immediate(Smi::FromInt(1))); // Smi indicates slow check
__ mov(ecx, Operand(esp, 0 * kPointerSize)); // Get enumerated object
=======================================
--- /branches/bleeding_edge/src/ic/ic-inl.h Tue Sep 16 12:51:33 2014 UTC
+++ /branches/bleeding_edge/src/ic/ic-inl.h Thu Sep 18 12:31:31 2014 UTC
@@ -208,17 +208,17 @@
}
-IC::State CallIC::FeedbackToState(Handle<FixedArray> vector,
+IC::State CallIC::FeedbackToState(Handle<TypeFeedbackVector> vector,
Handle<Smi> slot) const {
IC::State state = UNINITIALIZED;
Object* feedback = vector->get(slot->value());
- if (feedback == *TypeFeedbackInfo::MegamorphicSentinel(isolate())) {
+ if (feedback == *TypeFeedbackVector::MegamorphicSentinel(isolate())) {
state = GENERIC;
} else if (feedback->IsAllocationSite() || feedback->IsJSFunction()) {
state = MONOMORPHIC;
} else {
- CHECK(feedback == *TypeFeedbackInfo::UninitializedSentinel(isolate()));
+ CHECK(feedback ==
*TypeFeedbackVector::UninitializedSentinel(isolate()));
}
return state;
=======================================
--- /branches/bleeding_edge/src/ic/ic.cc Tue Sep 16 12:51:33 2014 UTC
+++ /branches/bleeding_edge/src/ic/ic.cc Thu Sep 18 12:31:31 2014 UTC
@@ -1826,8 +1826,8 @@
bool CallIC::DoCustomHandler(Handle<Object> receiver, Handle<Object>
function,
- Handle<FixedArray> vector, Handle<Smi> slot,
- const CallICState& state) {
+ Handle<TypeFeedbackVector> vector,
+ Handle<Smi> slot, const CallICState& state) {
DCHECK(FLAG_use_ic && function->IsJSFunction());
// Are we the array function?
@@ -1861,12 +1861,14 @@
void CallIC::PatchMegamorphic(Handle<Object> function,
- Handle<FixedArray> vector, Handle<Smi> slot)
{
+ Handle<TypeFeedbackVector> vector,
+ Handle<Smi> slot) {
CallICState state(target()->extra_ic_state());
IC::State old_state = FeedbackToState(vector, slot);
// We are going generic.
- vector->set(slot->value(),
*TypeFeedbackInfo::MegamorphicSentinel(isolate()),
+ vector->set(slot->value(),
+ *TypeFeedbackVector::MegamorphicSentinel(isolate()),
SKIP_WRITE_BARRIER);
CallICStub stub(isolate(), state);
@@ -1886,7 +1888,7 @@
void CallIC::HandleMiss(Handle<Object> receiver, Handle<Object> function,
- Handle<FixedArray> vector, Handle<Smi> slot) {
+ Handle<TypeFeedbackVector> vector, Handle<Smi>
slot) {
CallICState state(target()->extra_ic_state());
IC::State old_state = FeedbackToState(vector, slot);
Handle<Object> name = isolate()->factory()->empty_string();
@@ -1898,7 +1900,7 @@
if (feedback->IsJSFunction() || !function->IsJSFunction()) {
// We are going generic.
vector->set(slot->value(),
- *TypeFeedbackInfo::MegamorphicSentinel(isolate()),
+ *TypeFeedbackVector::MegamorphicSentinel(isolate()),
SKIP_WRITE_BARRIER);
} else {
// The feedback is either uninitialized or an allocation site.
@@ -1907,7 +1909,7 @@
// merely need to patch the target to match the feedback.
// TODO(mvstanton): the better approach is to dispense with patching
// altogether, which is in progress.
- DCHECK(feedback == *TypeFeedbackInfo::UninitializedSentinel(isolate())
||
+ DCHECK(feedback ==
*TypeFeedbackVector::UninitializedSentinel(isolate()) ||
feedback->IsAllocationSite());
// Do we want to install a custom handler?
@@ -1945,7 +1947,7 @@
CallIC ic(isolate);
Handle<Object> receiver = args.at<Object>(0);
Handle<Object> function = args.at<Object>(1);
- Handle<FixedArray> vector = args.at<FixedArray>(2);
+ Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(2);
Handle<Smi> slot = args.at<Smi>(3);
ic.HandleMiss(receiver, function, vector, slot);
return *function;
@@ -1959,7 +1961,7 @@
// A miss on a custom call ic always results in going megamorphic.
CallIC ic(isolate);
Handle<Object> function = args.at<Object>(1);
- Handle<FixedArray> vector = args.at<FixedArray>(2);
+ Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(2);
Handle<Smi> slot = args.at<Smi>(3);
ic.PatchMegamorphic(function, vector, slot);
return *function;
=======================================
--- /branches/bleeding_edge/src/ic/ic.h Tue Sep 16 12:51:33 2014 UTC
+++ /branches/bleeding_edge/src/ic/ic.h Thu Sep 18 12:31:31 2014 UTC
@@ -295,15 +295,15 @@
public:
explicit CallIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) {}
- void PatchMegamorphic(Handle<Object> function, Handle<FixedArray> vector,
- Handle<Smi> slot);
+ void PatchMegamorphic(Handle<Object> function,
+ Handle<TypeFeedbackVector> vector, Handle<Smi>
slot);
void HandleMiss(Handle<Object> receiver, Handle<Object> function,
- Handle<FixedArray> vector, Handle<Smi> slot);
+ Handle<TypeFeedbackVector> vector, Handle<Smi> slot);
// Returns true if a custom handler was installed.
bool DoCustomHandler(Handle<Object> receiver, Handle<Object> function,
- Handle<FixedArray> vector, Handle<Smi> slot,
+ Handle<TypeFeedbackVector> vector, Handle<Smi> slot,
const CallICState& state);
// Code generator routines.
@@ -314,7 +314,7 @@
ConstantPoolArray* constant_pool);
private:
- inline IC::State FeedbackToState(Handle<FixedArray> vector,
+ inline IC::State FeedbackToState(Handle<TypeFeedbackVector> vector,
Handle<Smi> slot) const;
};
=======================================
--- /branches/bleeding_edge/src/mips/code-stubs-mips.cc Tue Sep 16 12:51:33
2014 UTC
+++ /branches/bleeding_edge/src/mips/code-stubs-mips.cc Thu Sep 18 12:31:31
2014 UTC
@@ -2448,9 +2448,9 @@
// a3 : slot in feedback vector (Smi)
Label initialize, done, miss, megamorphic, not_array_function;
- DCHECK_EQ(*TypeFeedbackInfo::MegamorphicSentinel(masm->isolate()),
+ DCHECK_EQ(*TypeFeedbackVector::MegamorphicSentinel(masm->isolate()),
masm->isolate()->heap()->megamorphic_symbol());
- DCHECK_EQ(*TypeFeedbackInfo::UninitializedSentinel(masm->isolate()),
+ DCHECK_EQ(*TypeFeedbackVector::UninitializedSentinel(masm->isolate()),
masm->isolate()->heap()->uninitialized_symbol());
// Load the cache state into t0.
=======================================
--- /branches/bleeding_edge/src/mips/full-codegen-mips.cc Tue Sep 16
12:51:33 2014 UTC
+++ /branches/bleeding_edge/src/mips/full-codegen-mips.cc Thu Sep 18
12:31:31 2014 UTC
@@ -1180,7 +1180,7 @@
__ bind(&fixed_array);
__ li(a1, FeedbackVector());
- __ li(a2, Operand(TypeFeedbackInfo::MegamorphicSentinel(isolate())));
+ __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
__ sw(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(slot)));
__ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check
=======================================
--- /branches/bleeding_edge/src/objects-inl.h Thu Sep 18 09:59:53 2014 UTC
+++ /branches/bleeding_edge/src/objects-inl.h Thu Sep 18 12:31:31 2014 UTC
@@ -31,7 +31,7 @@
#include "src/property.h"
#include "src/prototype.h"
#include "src/transitions-inl.h"
-#include "src/type-feedback-vector.h"
+#include "src/type-feedback-vector-inl.h"
#include "src/v8memory.h"
namespace v8 {
@@ -6996,37 +6996,6 @@
array->set_elements(*storage);
array->set_length(Smi::FromInt(storage->length()));
}
-
-
-Handle<Object> TypeFeedbackInfo::UninitializedSentinel(Isolate* isolate) {
- return isolate->factory()->uninitialized_symbol();
-}
-
-
-Handle<Object> TypeFeedbackInfo::MegamorphicSentinel(Isolate* isolate) {
- return isolate->factory()->megamorphic_symbol();
-}
-
-
-Handle<Object> TypeFeedbackInfo::PremonomorphicSentinel(Isolate* isolate) {
- return isolate->factory()->megamorphic_symbol();
-}
-
-
-Handle<Object> TypeFeedbackInfo::GenericSentinel(Isolate* isolate) {
- return isolate->factory()->generic_symbol();
-}
-
-
-Handle<Object> TypeFeedbackInfo::MonomorphicArraySentinel(Isolate* isolate,
- ElementsKind elements_kind) {
- return Handle<Object>(Smi::FromInt(static_cast<int>(elements_kind)),
isolate);
-}
-
-
-Object* TypeFeedbackInfo::RawUninitializedSentinel(Heap* heap) {
- return heap->uninitialized_symbol();
-}
int TypeFeedbackInfo::ic_total_count() {
=======================================
--- /branches/bleeding_edge/src/objects.cc Thu Sep 18 06:57:12 2014 UTC
+++ /branches/bleeding_edge/src/objects.cc Thu Sep 18 12:31:31 2014 UTC
@@ -10378,7 +10378,7 @@
void SharedFunctionInfo::ClearTypeFeedbackInfo() {
- FixedArray* vector = feedback_vector();
+ TypeFeedbackVector* vector = feedback_vector();
Heap* heap = GetHeap();
int length = vector->length();
@@ -10394,7 +10394,7 @@
break;
// Fall through...
default:
- vector->set(i, TypeFeedbackInfo::RawUninitializedSentinel(heap),
+ vector->set(i,
TypeFeedbackVector::RawUninitializedSentinel(heap),
SKIP_WRITE_BARRIER);
}
}
=======================================
--- /branches/bleeding_edge/src/objects.h Thu Sep 18 11:32:39 2014 UTC
+++ /branches/bleeding_edge/src/objects.h Thu Sep 18 12:31:31 2014 UTC
@@ -8379,28 +8379,6 @@
static const int kStorage3Offset = kStorage2Offset + kPointerSize;
static const int kSize = kStorage3Offset + kPointerSize;
- // TODO(mvstanton): move these sentinel declarations to shared function
info.
- // The object that indicates an uninitialized cache.
- static inline Handle<Object> UninitializedSentinel(Isolate* isolate);
-
- // The object that indicates a megamorphic state.
- static inline Handle<Object> MegamorphicSentinel(Isolate* isolate);
-
- // The object that indicates a premonomorphic state.
- static inline Handle<Object> PremonomorphicSentinel(Isolate* isolate);
-
- // The object that indicates a generic state.
- static inline Handle<Object> GenericSentinel(Isolate* isolate);
-
- // The object that indicates a monomorphic state of Array with
- // ElementsKind
- static inline Handle<Object> MonomorphicArraySentinel(Isolate* isolate,
- ElementsKind elements_kind);
-
- // A raw version of the uninitialized sentinel that's safe to read during
- // garbage collection (e.g., for patching the cache).
- static inline Object* RawUninitializedSentinel(Heap* heap);
-
private:
static const int kTypeChangeChecksumBits = 7;
=======================================
--- /branches/bleeding_edge/src/type-feedback-vector.cc Thu Sep 18 09:59:53
2014 UTC
+++ /branches/bleeding_edge/src/type-feedback-vector.cc Thu Sep 18 12:31:31
2014 UTC
@@ -5,7 +5,7 @@
#include "src/v8.h"
#include "src/objects.h"
-#include "src/type-feedback-vector.h"
+#include "src/type-feedback-vector-inl.h"
namespace v8 {
namespace internal {
=======================================
--- /branches/bleeding_edge/src/type-feedback-vector.h Thu Sep 18 09:59:53
2014 UTC
+++ /branches/bleeding_edge/src/type-feedback-vector.h Thu Sep 18 12:31:31
2014 UTC
@@ -25,6 +25,27 @@
static Handle<TypeFeedbackVector> Copy(Isolate* isolate,
Handle<TypeFeedbackVector>
vector);
+ // The object that indicates an uninitialized cache.
+ static inline Handle<Object> UninitializedSentinel(Isolate* isolate);
+
+ // The object that indicates a megamorphic state.
+ static inline Handle<Object> MegamorphicSentinel(Isolate* isolate);
+
+ // The object that indicates a premonomorphic state.
+ static inline Handle<Object> PremonomorphicSentinel(Isolate* isolate);
+
+ // The object that indicates a generic state.
+ static inline Handle<Object> GenericSentinel(Isolate* isolate);
+
+ // The object that indicates a monomorphic state of Array with
+ // ElementsKind
+ static inline Handle<Object> MonomorphicArraySentinel(
+ Isolate* isolate, ElementsKind elements_kind);
+
+ // A raw version of the uninitialized sentinel that's safe to read during
+ // garbage collection (e.g., for patching the cache).
+ static inline Object* RawUninitializedSentinel(Heap* heap);
+
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(TypeFeedbackVector);
};
=======================================
--- /branches/bleeding_edge/src/type-info.cc Thu Sep 18 09:59:53 2014 UTC
+++ /branches/bleeding_edge/src/type-info.cc Thu Sep 18 12:31:31 2014 UTC
@@ -109,8 +109,9 @@
byte TypeFeedbackOracle::ForInType(int feedback_vector_slot) {
Handle<Object> value = GetInfo(feedback_vector_slot);
return value.is_identical_to(
- TypeFeedbackInfo::UninitializedSentinel(isolate()))
- ? ForInStatement::FAST_FOR_IN : ForInStatement::SLOW_FOR_IN;
+ TypeFeedbackVector::UninitializedSentinel(isolate()))
+ ? ForInStatement::FAST_FOR_IN
+ : ForInStatement::SLOW_FOR_IN;
}
=======================================
--- /branches/bleeding_edge/src/x64/code-stubs-x64.cc Tue Sep 16 12:51:33
2014 UTC
+++ /branches/bleeding_edge/src/x64/code-stubs-x64.cc Thu Sep 18 12:31:31
2014 UTC
@@ -1694,7 +1694,7 @@
// function without changing the state.
__ cmpp(rcx, rdi);
__ j(equal, &done);
- __ Cmp(rcx, TypeFeedbackInfo::MegamorphicSentinel(isolate));
+ __ Cmp(rcx, TypeFeedbackVector::MegamorphicSentinel(isolate));
__ j(equal, &done);
if (!FLAG_pretenuring_call_new) {
@@ -1718,13 +1718,13 @@
// A monomorphic miss (i.e, here the cache is not uninitialized) goes
// megamorphic.
- __ Cmp(rcx, TypeFeedbackInfo::UninitializedSentinel(isolate));
+ __ Cmp(rcx, TypeFeedbackVector::UninitializedSentinel(isolate));
__ j(equal, &initialize);
// MegamorphicSentinel is an immortal immovable object (undefined) so no
// write-barrier is needed.
__ bind(&megamorphic);
__ Move(FieldOperand(rbx, rdx, times_pointer_size,
FixedArray::kHeaderSize),
- TypeFeedbackInfo::MegamorphicSentinel(isolate));
+ TypeFeedbackVector::MegamorphicSentinel(isolate));
__ jmp(&done);
// An uninitialized cache is patched with the function or sentinel to
@@ -2071,9 +2071,9 @@
__ movp(rcx, FieldOperand(rbx, rdx, times_pointer_size,
FixedArray::kHeaderSize));
- __ Cmp(rcx, TypeFeedbackInfo::MegamorphicSentinel(isolate));
+ __ Cmp(rcx, TypeFeedbackVector::MegamorphicSentinel(isolate));
__ j(equal, &slow_start);
- __ Cmp(rcx, TypeFeedbackInfo::UninitializedSentinel(isolate));
+ __ Cmp(rcx, TypeFeedbackVector::UninitializedSentinel(isolate));
__ j(equal, &miss);
if (!FLAG_trace_ic) {
@@ -2082,9 +2082,8 @@
__ AssertNotSmi(rcx);
__ CmpObjectType(rcx, JS_FUNCTION_TYPE, rcx);
__ j(not_equal, &miss);
- __ Move(FieldOperand(rbx, rdx, times_pointer_size,
- FixedArray::kHeaderSize),
- TypeFeedbackInfo::MegamorphicSentinel(isolate));
+ __ Move(FieldOperand(rbx, rdx, times_pointer_size,
FixedArray::kHeaderSize),
+ TypeFeedbackVector::MegamorphicSentinel(isolate));
__ jmp(&slow_start);
}
=======================================
--- /branches/bleeding_edge/src/x64/full-codegen-x64.cc Tue Sep 16 12:51:33
2014 UTC
+++ /branches/bleeding_edge/src/x64/full-codegen-x64.cc Thu Sep 18 12:31:31
2014 UTC
@@ -1150,7 +1150,7 @@
// No need for a write barrier, we are storing a Smi in the feedback
vector.
__ Move(rbx, FeedbackVector());
__ Move(FieldOperand(rbx, FixedArray::OffsetOfElementAt(slot)),
- TypeFeedbackInfo::MegamorphicSentinel(isolate()));
+ TypeFeedbackVector::MegamorphicSentinel(isolate()));
__ Move(rbx, Smi::FromInt(1)); // Smi indicates slow check
__ movp(rcx, Operand(rsp, 0 * kPointerSize)); // Get enumerated object
STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE);
=======================================
--- /branches/bleeding_edge/test/cctest/test-heap.cc Wed Sep 10 12:38:12
2014 UTC
+++ /branches/bleeding_edge/test/cctest/test-heap.cc Thu Sep 18 12:31:31
2014 UTC
@@ -3139,7 +3139,7 @@
*v8::Handle<v8::Function>::Cast(
CcTest::global()->Get(v8_str("f"))));
- Handle<FixedArray> feedback_vector(f->shared()->feedback_vector());
+ Handle<TypeFeedbackVector>
feedback_vector(f->shared()->feedback_vector());
int expected_length = FLAG_vector_ics ? 4 : 2;
CHECK_EQ(expected_length, feedback_vector->length());
@@ -3155,7 +3155,7 @@
CHECK_EQ(expected_length, feedback_vector->length());
for (int i = 0; i < expected_length; i++) {
CHECK_EQ(feedback_vector->get(i),
-
*TypeFeedbackInfo::UninitializedSentinel(CcTest::i_isolate()));
+
*TypeFeedbackVector::UninitializedSentinel(CcTest::i_isolate()));
}
}
=======================================
--- /branches/bleeding_edge/tools/gyp/v8.gyp Thu Sep 18 09:59:53 2014 UTC
+++ /branches/bleeding_edge/tools/gyp/v8.gyp Thu Sep 18 12:31:31 2014 UTC
@@ -761,6 +761,7 @@
'../../src/transitions-inl.h',
'../../src/transitions.cc',
'../../src/transitions.h',
+ '../../src/type-feedback-vector-inl.h',
'../../src/type-feedback-vector.cc',
'../../src/type-feedback-vector.h',
'../../src/type-info.cc',
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.