Only generate a single normal IC per kind per slow-mode map.

BUG=
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/429543004

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22680 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
verwaest@chromium.org 2014-07-29 17:02:52 +00:00
parent 3416d1133f
commit b337649d14
9 changed files with 60 additions and 42 deletions

View File

@ -5648,7 +5648,7 @@ class Internals {
static const int kNullValueRootIndex = 7;
static const int kTrueValueRootIndex = 8;
static const int kFalseValueRootIndex = 9;
static const int kEmptyStringRootIndex = 163;
static const int kEmptyStringRootIndex = 164;
// The external allocation limit should be below 256 MB on all architectures
// to avoid that resource-constrained embedders run low on memory.

View File

@ -1273,8 +1273,14 @@ Handle<Code> PropertyICCompiler::CompilePolymorphic(TypeHandleList* types,
if (check == PROPERTY &&
(kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) {
__ cmp(this->name(), Operand(name));
__ b(ne, &miss);
// In case we are compiling an IC for dictionary loads and stores, just
// check whether the name is unique.
if (name.is_identical_to(isolate()->factory()->normal_ic_symbol())) {
__ JumpIfNotUniqueName(this->name(), &miss);
} else {
__ cmp(this->name(), Operand(name));
__ b(ne, &miss);
}
}
Label number_case;

View File

@ -1241,7 +1241,13 @@ Handle<Code> PropertyICCompiler::CompilePolymorphic(TypeHandleList* types,
if (check == PROPERTY &&
(kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) {
__ CompareAndBranch(this->name(), Operand(name), ne, &miss);
// In case we are compiling an IC for dictionary loads and stores, just
// check whether the name is unique.
if (name.is_identical_to(isolate()->factory()->normal_ic_symbol())) {
__ JumpIfNotUniqueName(this->name(), &miss);
} else {
__ CompareAndBranch(this->name(), Operand(name), ne, &miss);
}
}
Label number_case;

View File

@ -2924,14 +2924,15 @@ void Heap::CreateInitialObjects() {
// Number of queued microtasks stored in Isolate::pending_microtask_count().
set_microtask_queue(empty_fixed_array());
set_frozen_symbol(*factory->NewPrivateSymbol());
set_nonexistent_symbol(*factory->NewPrivateSymbol());
set_detailed_stack_trace_symbol(*factory->NewPrivateSymbol());
set_elements_transition_symbol(*factory->NewPrivateSymbol());
set_uninitialized_symbol(*factory->NewPrivateSymbol());
set_frozen_symbol(*factory->NewPrivateSymbol());
set_megamorphic_symbol(*factory->NewPrivateSymbol());
set_nonexistent_symbol(*factory->NewPrivateSymbol());
set_normal_ic_symbol(*factory->NewPrivateSymbol());
set_observed_symbol(*factory->NewPrivateSymbol());
set_stack_trace_symbol(*factory->NewPrivateSymbol());
set_detailed_stack_trace_symbol(*factory->NewPrivateSymbol());
set_uninitialized_symbol(*factory->NewPrivateSymbol());
Handle<SeededNumberDictionary> slow_element_dictionary =
SeededNumberDictionary::New(isolate(), 0, TENURED);

View File

@ -79,33 +79,24 @@ namespace internal {
V(Map, sliced_string_map, SlicedStringMap) \
V(Map, sliced_ascii_string_map, SlicedAsciiStringMap) \
V(Map, external_string_map, ExternalStringMap) \
V(Map, \
external_string_with_one_byte_data_map, \
V(Map, external_string_with_one_byte_data_map, \
ExternalStringWithOneByteDataMap) \
V(Map, external_ascii_string_map, ExternalAsciiStringMap) \
V(Map, short_external_string_map, ShortExternalStringMap) \
V(Map, \
short_external_string_with_one_byte_data_map, \
V(Map, short_external_string_with_one_byte_data_map, \
ShortExternalStringWithOneByteDataMap) \
V(Map, internalized_string_map, InternalizedStringMap) \
V(Map, ascii_internalized_string_map, AsciiInternalizedStringMap) \
V(Map, \
external_internalized_string_map, \
ExternalInternalizedStringMap) \
V(Map, \
external_internalized_string_with_one_byte_data_map, \
V(Map, external_internalized_string_map, ExternalInternalizedStringMap) \
V(Map, external_internalized_string_with_one_byte_data_map, \
ExternalInternalizedStringWithOneByteDataMap) \
V(Map, \
external_ascii_internalized_string_map, \
V(Map, external_ascii_internalized_string_map, \
ExternalAsciiInternalizedStringMap) \
V(Map, \
short_external_internalized_string_map, \
V(Map, short_external_internalized_string_map, \
ShortExternalInternalizedStringMap) \
V(Map, \
short_external_internalized_string_with_one_byte_data_map, \
V(Map, short_external_internalized_string_with_one_byte_data_map, \
ShortExternalInternalizedStringWithOneByteDataMap) \
V(Map, \
short_external_ascii_internalized_string_map, \
V(Map, short_external_ascii_internalized_string_map, \
ShortExternalAsciiInternalizedStringMap) \
V(Map, short_external_ascii_string_map, ShortExternalAsciiStringMap) \
V(Map, undetectable_string_map, UndetectableStringMap) \
@ -119,20 +110,16 @@ namespace internal {
V(Map, external_float32_array_map, ExternalFloat32ArrayMap) \
V(Map, external_float64_array_map, ExternalFloat64ArrayMap) \
V(Map, external_uint8_clamped_array_map, ExternalUint8ClampedArrayMap) \
V(ExternalArray, empty_external_int8_array, \
EmptyExternalInt8Array) \
V(ExternalArray, empty_external_uint8_array, \
EmptyExternalUint8Array) \
V(ExternalArray, empty_external_int8_array, EmptyExternalInt8Array) \
V(ExternalArray, empty_external_uint8_array, EmptyExternalUint8Array) \
V(ExternalArray, empty_external_int16_array, EmptyExternalInt16Array) \
V(ExternalArray, empty_external_uint16_array, \
EmptyExternalUint16Array) \
V(ExternalArray, empty_external_uint16_array, EmptyExternalUint16Array) \
V(ExternalArray, empty_external_int32_array, EmptyExternalInt32Array) \
V(ExternalArray, empty_external_uint32_array, \
EmptyExternalUint32Array) \
V(ExternalArray, empty_external_uint32_array, EmptyExternalUint32Array) \
V(ExternalArray, empty_external_float32_array, EmptyExternalFloat32Array) \
V(ExternalArray, empty_external_float64_array, EmptyExternalFloat64Array) \
V(ExternalArray, empty_external_uint8_clamped_array, \
EmptyExternalUint8ClampedArray) \
EmptyExternalUint8ClampedArray) \
V(Map, fixed_uint8_array_map, FixedUint8ArrayMap) \
V(Map, fixed_int8_array_map, FixedInt8ArrayMap) \
V(Map, fixed_uint16_array_map, FixedUint16ArrayMap) \
@ -151,7 +138,7 @@ namespace internal {
V(FixedTypedArrayBase, empty_fixed_float32_array, EmptyFixedFloat32Array) \
V(FixedTypedArrayBase, empty_fixed_float64_array, EmptyFixedFloat64Array) \
V(FixedTypedArrayBase, empty_fixed_uint8_clamped_array, \
EmptyFixedUint8ClampedArray) \
EmptyFixedUint8ClampedArray) \
V(Map, sloppy_arguments_elements_map, SloppyArgumentsElementsMap) \
V(Map, function_context_map, FunctionContextMap) \
V(Map, catch_context_map, CatchContextMap) \
@ -191,12 +178,13 @@ namespace internal {
V(Symbol, nonexistent_symbol, NonExistentSymbol) \
V(Symbol, elements_transition_symbol, ElementsTransitionSymbol) \
V(SeededNumberDictionary, empty_slow_element_dictionary, \
EmptySlowElementDictionary) \
EmptySlowElementDictionary) \
V(Symbol, observed_symbol, ObservedSymbol) \
V(Symbol, uninitialized_symbol, UninitializedSymbol) \
V(Symbol, megamorphic_symbol, MegamorphicSymbol) \
V(Symbol, stack_trace_symbol, StackTraceSymbol) \
V(Symbol, detailed_stack_trace_symbol, DetailedStackTraceSymbol) \
V(Symbol, normal_ic_symbol, NormalICSymbol) \
V(FixedArray, materialized_objects, MaterializedObjects) \
V(FixedArray, allocation_sites_scratchpad, AllocationSitesScratchpad) \
V(FixedArray, microtask_queue, MicrotaskQueue)

View File

@ -1300,8 +1300,14 @@ Handle<Code> PropertyICCompiler::CompilePolymorphic(TypeHandleList* types,
if (check == PROPERTY &&
(kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) {
__ cmp(this->name(), Immediate(name));
__ j(not_equal, &miss);
// In case we are compiling an IC for dictionary loads and stores, just
// check whether the name is unique.
if (name.is_identical_to(isolate()->factory()->normal_ic_symbol())) {
__ JumpIfNotUniqueName(this->name(), &miss);
} else {
__ cmp(this->name(), Immediate(name));
__ j(not_equal, &miss);
}
}
Label number_case;

View File

@ -724,7 +724,7 @@ Handle<HeapType> IC::MapToType<HeapType>(Handle<Map> map, Isolate* region);
void IC::UpdateMonomorphicIC(Handle<Code> handler, Handle<String> name) {
if (!handler->is_handler()) return set_target(*handler);
ASSERT(handler->is_handler());
Handle<Code> ic = PropertyICCompiler::ComputeMonomorphic(
kind(), name, receiver_type(), handler, extra_ic_state());
set_target(*ic);

View File

@ -132,8 +132,13 @@ Handle<Code> PropertyHandlerCompiler::Find(Handle<Name> name,
Handle<Code> PropertyICCompiler::ComputeMonomorphic(
Code::Kind kind, Handle<Name> name, Handle<HeapType> type,
Handle<Code> handler, ExtraICState extra_ic_state) {
CacheHolderFlag flag;
Isolate* isolate = name->GetIsolate();
if (handler.is_identical_to(isolate->builtins()->LoadIC_Normal()) ||
handler.is_identical_to(isolate->builtins()->StoreIC_Normal())) {
name = isolate->factory()->normal_ic_symbol();
}
CacheHolderFlag flag;
Handle<Map> stub_holder = IC::GetICCacheHolder(*type, isolate, &flag);
Handle<Code> ic;

View File

@ -1234,8 +1234,14 @@ Handle<Code> PropertyICCompiler::CompilePolymorphic(TypeHandleList* types,
if (check == PROPERTY &&
(kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) {
__ Cmp(this->name(), name);
__ j(not_equal, &miss);
// In case we are compiling an IC for dictionary loads and stores, just
// check whether the name is unique.
if (name.is_identical_to(isolate()->factory()->normal_ic_symbol())) {
__ JumpIfNotUniqueName(this->name(), &miss);
} else {
__ Cmp(this->name(), name);
__ j(not_equal, &miss);
}
}
Label number_case;