Index: src/ia32/stub-cache-ia32.cc |
diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc |
index 2cf6fdf1d66380b225265bd0c03ae7671c915461..df6456355179f41609c839dc06eef0523f98f066 100644 |
--- a/src/ia32/stub-cache-ia32.cc |
+++ b/src/ia32/stub-cache-ia32.cc |
@@ -141,14 +141,14 @@ static void ProbeTable(Isolate* isolate, |
// the property. This function may return false negatives, so miss_label |
// must always call a backup property check that is complete. |
// This function is safe to call if the receiver has fast properties. |
-// Name must be an internalized string and receiver must be a heap object. |
+// Name must be unique and receiver must be a heap object. |
static void GenerateDictionaryNegativeLookup(MacroAssembler* masm, |
Label* miss_label, |
Register receiver, |
- Handle<String> name, |
+ Handle<Name> name, |
Register r0, |
Register r1) { |
- ASSERT(name->IsInternalizedString()); |
+ ASSERT(name->IsUniqueName()); |
Counters* counters = masm->isolate()->counters(); |
__ IncrementCounter(counters->negative_lookups(), 1); |
__ IncrementCounter(counters->negative_lookups_miss(), 1); |
@@ -177,12 +177,12 @@ static void GenerateDictionaryNegativeLookup(MacroAssembler* masm, |
__ j(not_equal, miss_label); |
Label done; |
- StringDictionaryLookupStub::GenerateNegativeLookup(masm, |
- miss_label, |
- &done, |
- properties, |
- name, |
- r1); |
+ NameDictionaryLookupStub::GenerateNegativeLookup(masm, |
+ miss_label, |
+ &done, |
+ properties, |
+ name, |
+ r1); |
__ bind(&done); |
__ DecrementCounter(counters->negative_lookups_miss(), 1); |
} |
@@ -227,7 +227,7 @@ void StubCache::GenerateProbe(MacroAssembler* masm, |
__ JumpIfSmi(receiver, &miss); |
// Get the map of the receiver and compute the hash. |
- __ mov(offset, FieldOperand(name, String::kHashFieldOffset)); |
+ __ mov(offset, FieldOperand(name, Name::kHashFieldOffset)); |
__ add(offset, FieldOperand(receiver, HeapObject::kMapOffset)); |
__ xor_(offset, flags); |
// We mask out the last two bits because they are not part of the hash and |
@@ -241,7 +241,7 @@ void StubCache::GenerateProbe(MacroAssembler* masm, |
ProbeTable(isolate(), masm, flags, kPrimary, name, receiver, offset, extra); |
// Primary miss: Compute hash for secondary probe. |
- __ mov(offset, FieldOperand(name, String::kHashFieldOffset)); |
+ __ mov(offset, FieldOperand(name, Name::kHashFieldOffset)); |
__ add(offset, FieldOperand(receiver, HeapObject::kMapOffset)); |
__ xor_(offset, flags); |
__ and_(offset, (kPrimaryTableSize - 1) << kHeapObjectTagSize); |
@@ -546,7 +546,7 @@ class CallInterceptorCompiler BASE_EMBEDDED { |
void Compile(MacroAssembler* masm, |
Handle<JSObject> object, |
Handle<JSObject> holder, |
- Handle<String> name, |
+ Handle<Name> name, |
LookupResult* lookup, |
Register receiver, |
Register scratch1, |
@@ -578,7 +578,7 @@ class CallInterceptorCompiler BASE_EMBEDDED { |
Register scratch3, |
Handle<JSObject> interceptor_holder, |
LookupResult* lookup, |
- Handle<String> name, |
+ Handle<Name> name, |
const CallOptimization& optimization, |
Label* miss_label) { |
ASSERT(optimization.is_constant_call()); |
@@ -671,7 +671,7 @@ class CallInterceptorCompiler BASE_EMBEDDED { |
Register scratch1, |
Register scratch2, |
Register scratch3, |
- Handle<String> name, |
+ Handle<Name> name, |
Handle<JSObject> interceptor_holder, |
Label* miss_label) { |
Register holder = |
@@ -759,7 +759,7 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm, |
Handle<JSObject> object, |
int index, |
Handle<Map> transition, |
- Handle<String> name, |
+ Handle<Name> name, |
Register receiver_reg, |
Register name_reg, |
Register scratch1, |
@@ -893,7 +893,7 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm, |
// property. |
static void GenerateCheckPropertyCell(MacroAssembler* masm, |
Handle<GlobalObject> global, |
- Handle<String> name, |
+ Handle<Name> name, |
Register scratch, |
Label* miss) { |
Handle<JSGlobalPropertyCell> cell = |
@@ -916,7 +916,7 @@ static void GenerateCheckPropertyCell(MacroAssembler* masm, |
static void GenerateCheckPropertyCells(MacroAssembler* masm, |
Handle<JSObject> object, |
Handle<JSObject> holder, |
- Handle<String> name, |
+ Handle<Name> name, |
Register scratch, |
Label* miss) { |
Handle<JSObject> current = object; |
@@ -942,7 +942,7 @@ Register StubCompiler::CheckPrototypes(Handle<JSObject> object, |
Register holder_reg, |
Register scratch1, |
Register scratch2, |
- Handle<String> name, |
+ Handle<Name> name, |
int save_at_depth, |
Label* miss) { |
// Make sure there's no overlap between holder and object registers. |
@@ -972,11 +972,12 @@ Register StubCompiler::CheckPrototypes(Handle<JSObject> object, |
if (!current->HasFastProperties() && |
!current->IsJSGlobalObject() && |
!current->IsJSGlobalProxy()) { |
- if (!name->IsInternalizedString()) { |
- name = factory()->InternalizeString(name); |
+ if (!name->IsUniqueName()) { |
+ ASSERT(name->IsString()); |
+ name = factory()->InternalizeString(Handle<String>::cast(name)); |
} |
ASSERT(current->property_dictionary()->FindEntry(*name) == |
- StringDictionary::kNotFound); |
+ NameDictionary::kNotFound); |
GenerateDictionaryNegativeLookup(masm(), miss, reg, name, |
scratch1, scratch2); |
@@ -1051,7 +1052,7 @@ void StubCompiler::GenerateLoadField(Handle<JSObject> object, |
Register scratch2, |
Register scratch3, |
PropertyIndex index, |
- Handle<String> name, |
+ Handle<Name> name, |
Label* miss) { |
// Check that the receiver isn't a smi. |
__ JumpIfSmi(receiver, miss); |
@@ -1072,7 +1073,7 @@ void StubCompiler::GenerateDictionaryLoadCallback(Register receiver, |
Register scratch2, |
Register scratch3, |
Handle<AccessorInfo> callback, |
- Handle<String> name, |
+ Handle<Name> name, |
Label* miss) { |
ASSERT(!receiver.is(scratch2)); |
ASSERT(!receiver.is(scratch3)); |
@@ -1087,13 +1088,13 @@ void StubCompiler::GenerateDictionaryLoadCallback(Register receiver, |
// Probe the dictionary. |
Label probe_done, pop_and_miss; |
- StringDictionaryLookupStub::GeneratePositiveLookup(masm(), |
- &pop_and_miss, |
- &probe_done, |
- dictionary, |
- name_reg, |
- scratch2, |
- scratch3); |
+ NameDictionaryLookupStub::GeneratePositiveLookup(masm(), |
+ &pop_and_miss, |
+ &probe_done, |
+ dictionary, |
+ name_reg, |
+ scratch2, |
+ scratch3); |
__ bind(&pop_and_miss); |
if (must_preserve_dictionary_reg) { |
__ pop(dictionary); |
@@ -1105,8 +1106,8 @@ void StubCompiler::GenerateDictionaryLoadCallback(Register receiver, |
// index into the dictionary. Check that the value is the callback. |
Register index = scratch2; |
const int kElementsStartOffset = |
- StringDictionary::kHeaderSize + |
- StringDictionary::kElementsStartIndex * kPointerSize; |
+ NameDictionary::kHeaderSize + |
+ NameDictionary::kElementsStartIndex * kPointerSize; |
const int kValueOffset = kElementsStartOffset + kPointerSize; |
__ mov(scratch3, |
Operand(dictionary, index, times_4, kValueOffset - kHeapObjectTag)); |
@@ -1127,7 +1128,7 @@ void StubCompiler::GenerateLoadCallback(Handle<JSObject> object, |
Register scratch3, |
Register scratch4, |
Handle<AccessorInfo> callback, |
- Handle<String> name, |
+ Handle<Name> name, |
Label* miss) { |
// Check that the receiver isn't a smi. |
__ JumpIfSmi(receiver, miss); |
@@ -1193,7 +1194,7 @@ void StubCompiler::GenerateLoadConstant(Handle<JSObject> object, |
Register scratch2, |
Register scratch3, |
Handle<JSFunction> value, |
- Handle<String> name, |
+ Handle<Name> name, |
Label* miss) { |
// Check that the receiver isn't a smi. |
__ JumpIfSmi(receiver, miss); |
@@ -1216,7 +1217,7 @@ void StubCompiler::GenerateLoadInterceptor(Handle<JSObject> object, |
Register scratch1, |
Register scratch2, |
Register scratch3, |
- Handle<String> name, |
+ Handle<Name> name, |
Label* miss) { |
ASSERT(interceptor_holder->HasNamedInterceptor()); |
ASSERT(!interceptor_holder->GetNamedInterceptor()->getter()->IsUndefined()); |
@@ -1366,7 +1367,7 @@ void StubCompiler::GenerateLoadInterceptor(Handle<JSObject> object, |
} |
-void CallStubCompiler::GenerateNameCheck(Handle<String> name, Label* miss) { |
+void CallStubCompiler::GenerateNameCheck(Handle<Name> name, Label* miss) { |
if (kind_ == Code::KEYED_CALL_IC) { |
__ cmp(ecx, Immediate(name)); |
__ j(not_equal, miss); |
@@ -1376,7 +1377,7 @@ void CallStubCompiler::GenerateNameCheck(Handle<String> name, Label* miss) { |
void CallStubCompiler::GenerateGlobalReceiverCheck(Handle<JSObject> object, |
Handle<JSObject> holder, |
- Handle<String> name, |
+ Handle<Name> name, |
Label* miss) { |
ASSERT(holder->IsGlobalObject()); |
@@ -1438,7 +1439,7 @@ void CallStubCompiler::GenerateMissBranch() { |
Handle<Code> CallStubCompiler::CompileCallField(Handle<JSObject> object, |
Handle<JSObject> holder, |
PropertyIndex index, |
- Handle<String> name) { |
+ Handle<Name> name) { |
// ----------- S t a t e ------------- |
// -- ecx : name |
// -- esp[0] : return address |
@@ -2371,7 +2372,7 @@ Handle<Code> CallStubCompiler::CompileFastApiCall( |
Handle<Code> CallStubCompiler::CompileCallConstant(Handle<Object> object, |
Handle<JSObject> holder, |
Handle<JSFunction> function, |
- Handle<String> name, |
+ Handle<Name> name, |
CheckType check) { |
// ----------- S t a t e ------------- |
// -- ecx : name |
@@ -2384,7 +2385,7 @@ Handle<Code> CallStubCompiler::CompileCallConstant(Handle<Object> object, |
if (HasCustomCallGenerator(function)) { |
Handle<Code> code = CompileCustomCall(object, holder, |
Handle<JSGlobalPropertyCell>::null(), |
- function, name); |
+ function, Handle<String>::cast(name)); |
// A null handle means bail out to the regular compiler code below. |
if (!code.is_null()) return code; |
} |
@@ -2505,7 +2506,7 @@ Handle<Code> CallStubCompiler::CompileCallConstant(Handle<Object> object, |
Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object, |
Handle<JSObject> holder, |
- Handle<String> name) { |
+ Handle<Name> name) { |
// ----------- S t a t e ------------- |
// -- ecx : name |
// -- esp[0] : return address |
@@ -2567,7 +2568,7 @@ Handle<Code> CallStubCompiler::CompileCallGlobal( |
Handle<GlobalObject> holder, |
Handle<JSGlobalPropertyCell> cell, |
Handle<JSFunction> function, |
- Handle<String> name) { |
+ Handle<Name> name) { |
// ----------- S t a t e ------------- |
// -- ecx : name |
// -- esp[0] : return address |
@@ -2577,7 +2578,8 @@ Handle<Code> CallStubCompiler::CompileCallGlobal( |
// ----------------------------------- |
if (HasCustomCallGenerator(function)) { |
- Handle<Code> code = CompileCustomCall(object, holder, cell, function, name); |
+ Handle<Code> code = CompileCustomCall( |
+ object, holder, cell, function, Handle<String>::cast(name)); |
// A null handle means bail out to the regular compiler code below. |
if (!code.is_null()) return code; |
} |
@@ -2626,7 +2628,7 @@ Handle<Code> CallStubCompiler::CompileCallGlobal( |
Handle<Code> StoreStubCompiler::CompileStoreField(Handle<JSObject> object, |
int index, |
Handle<Map> transition, |
- Handle<String> name) { |
+ Handle<Name> name) { |
// ----------- S t a t e ------------- |
// -- eax : value |
// -- ecx : name |
@@ -2657,7 +2659,7 @@ Handle<Code> StoreStubCompiler::CompileStoreField(Handle<JSObject> object, |
Handle<Code> StoreStubCompiler::CompileStoreCallback( |
- Handle<String> name, |
+ Handle<Name> name, |
Handle<JSObject> receiver, |
Handle<JSObject> holder, |
Handle<AccessorInfo> callback) { |
@@ -2747,7 +2749,7 @@ void StoreStubCompiler::GenerateStoreViaSetter( |
Handle<Code> StoreStubCompiler::CompileStoreViaSetter( |
- Handle<String> name, |
+ Handle<Name> name, |
Handle<JSObject> receiver, |
Handle<JSObject> holder, |
Handle<JSFunction> setter) { |
@@ -2779,7 +2781,7 @@ Handle<Code> StoreStubCompiler::CompileStoreViaSetter( |
Handle<Code> StoreStubCompiler::CompileStoreInterceptor( |
Handle<JSObject> receiver, |
- Handle<String> name) { |
+ Handle<Name> name) { |
// ----------- S t a t e ------------- |
// -- eax : value |
// -- ecx : name |
@@ -2826,7 +2828,7 @@ Handle<Code> StoreStubCompiler::CompileStoreInterceptor( |
Handle<Code> StoreStubCompiler::CompileStoreGlobal( |
Handle<GlobalObject> object, |
Handle<JSGlobalPropertyCell> cell, |
- Handle<String> name) { |
+ Handle<Name> name) { |
// ----------- S t a t e ------------- |
// -- eax : value |
// -- ecx : name |
@@ -2874,7 +2876,7 @@ Handle<Code> StoreStubCompiler::CompileStoreGlobal( |
Handle<Code> KeyedStoreStubCompiler::CompileStoreField(Handle<JSObject> object, |
int index, |
Handle<Map> transition, |
- Handle<String> name) { |
+ Handle<Name> name) { |
// ----------- S t a t e ------------- |
// -- eax : value |
// -- ecx : key |
@@ -2973,7 +2975,7 @@ Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic( |
Handle<Code> LoadStubCompiler::CompileLoadNonexistent( |
Handle<JSObject> object, |
Handle<JSObject> last, |
- Handle<String> name, |
+ Handle<Name> name, |
Handle<GlobalObject> global) { |
// ----------- S t a t e ------------- |
// -- ecx : name |
@@ -3033,7 +3035,7 @@ Register* KeyedLoadStubCompiler::registers() { |
} |
-void KeyedLoadStubCompiler::GenerateNameCheck(Handle<String> name, |
+void KeyedLoadStubCompiler::GenerateNameCheck(Handle<Name> name, |
Register name_reg, |
Label* miss) { |
__ cmp(name_reg, Immediate(name)); |
@@ -3081,7 +3083,7 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, |
Handle<Code> LoadStubCompiler::CompileLoadViaGetter( |
Handle<JSObject> receiver, |
Handle<JSObject> holder, |
- Handle<String> name, |
+ Handle<Name> name, |
Handle<JSFunction> getter) { |
// ----------- S t a t e ------------- |
// -- ecx : name |
@@ -3108,7 +3110,7 @@ Handle<Code> LoadStubCompiler::CompileLoadGlobal( |
Handle<JSObject> object, |
Handle<GlobalObject> holder, |
Handle<JSGlobalPropertyCell> cell, |
- Handle<String> name, |
+ Handle<Name> name, |
bool is_dont_delete) { |
// ----------- S t a t e ------------- |
// -- ecx : name |