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:
parent
3416d1133f
commit
b337649d14
@ -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.
|
||||
|
@ -1273,9 +1273,15 @@ Handle<Code> PropertyICCompiler::CompilePolymorphic(TypeHandleList* types,
|
||||
|
||||
if (check == PROPERTY &&
|
||||
(kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) {
|
||||
// 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;
|
||||
Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
|
||||
|
@ -1241,8 +1241,14 @@ Handle<Code> PropertyICCompiler::CompilePolymorphic(TypeHandleList* types,
|
||||
|
||||
if (check == PROPERTY &&
|
||||
(kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) {
|
||||
// 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;
|
||||
Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
|
||||
|
@ -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);
|
||||
|
38
src/heap.h
38
src/heap.h
@ -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,16 +110,12 @@ 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, \
|
||||
@ -197,6 +184,7 @@ namespace internal {
|
||||
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)
|
||||
|
@ -1300,9 +1300,15 @@ Handle<Code> PropertyICCompiler::CompilePolymorphic(TypeHandleList* types,
|
||||
|
||||
if (check == PROPERTY &&
|
||||
(kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) {
|
||||
// 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;
|
||||
Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -1234,9 +1234,15 @@ Handle<Code> PropertyICCompiler::CompilePolymorphic(TypeHandleList* types,
|
||||
|
||||
if (check == PROPERTY &&
|
||||
(kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) {
|
||||
// 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;
|
||||
Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
|
||||
|
Loading…
Reference in New Issue
Block a user