Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Unified Diff: src/arm/stub-cache-arm.cc

Issue 12330012: ES6 symbols: Allow symbols as property names (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Platform ports Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/stub-cache-arm.cc
diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc
index 6a5eeada767f38e8f3077cc40ca35ba2e28070fd..5f57ba5cd3e08eeee088b3f818b2056c4434c42f 100644
--- a/src/arm/stub-cache-arm.cc
+++ b/src/arm/stub-cache-arm.cc
@@ -130,14 +130,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 internalized 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 scratch0,
Register scratch1) {
- ASSERT(name->IsInternalizedString());
+ ASSERT(name->IsUniqueName());
Counters* counters = masm->isolate()->counters();
__ IncrementCounter(counters->negative_lookups(), 1, scratch0, scratch1);
__ IncrementCounter(counters->negative_lookups_miss(), 1, scratch0, scratch1);
@@ -173,13 +173,13 @@ static void GenerateDictionaryNegativeLookup(MacroAssembler* masm,
__ ldr(properties, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
- StringDictionaryLookupStub::GenerateNegativeLookup(masm,
- miss_label,
- &done,
- receiver,
- properties,
- name,
- scratch1);
+ NameDictionaryLookupStub::GenerateNegativeLookup(masm,
+ miss_label,
+ &done,
+ receiver,
+ properties,
+ name,
+ scratch1);
__ bind(&done);
__ DecrementCounter(counters->negative_lookups_miss(), 1, scratch0, scratch1);
}
@@ -228,7 +228,7 @@ void StubCache::GenerateProbe(MacroAssembler* masm,
__ JumpIfSmi(receiver, &miss);
// Get the map of the receiver and compute the hash.
- __ ldr(scratch, FieldMemOperand(name, String::kHashFieldOffset));
+ __ ldr(scratch, FieldMemOperand(name, Name::kHashFieldOffset));
__ ldr(ip, FieldMemOperand(receiver, HeapObject::kMapOffset));
__ add(scratch, scratch, Operand(ip));
uint32_t mask = kPrimaryTableSize - 1;
@@ -442,7 +442,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,
@@ -773,7 +773,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,
@@ -804,7 +804,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());
@@ -898,7 +898,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 =
@@ -955,7 +955,7 @@ class CallInterceptorCompiler BASE_EMBEDDED {
// property.
static void GenerateCheckPropertyCell(MacroAssembler* masm,
Handle<GlobalObject> global,
- Handle<String> name,
+ Handle<Name> name,
Register scratch,
Label* miss) {
Handle<JSGlobalPropertyCell> cell =
@@ -975,7 +975,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;
@@ -1072,7 +1072,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.
@@ -1102,11 +1102,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);
@@ -1175,7 +1176,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);
@@ -1195,7 +1196,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::GenerateDictionaryLoadCallback(Register receiver,
Register scratch2,
Register scratch3,
Handle<AccessorInfo> callback,
- Handle<String> name,
+ Handle<Name> name,
Label* miss) {
ASSERT(!receiver.is(scratch1));
ASSERT(!receiver.is(scratch2));
@@ -1228,20 +1229,20 @@ void StubCompiler::GenerateDictionaryLoadCallback(Register receiver,
// Probe the dictionary.
Label probe_done;
- StringDictionaryLookupStub::GeneratePositiveLookup(masm(),
- miss,
- &probe_done,
- dictionary,
- name_reg,
- scratch2,
- scratch3);
+ NameDictionaryLookupStub::GeneratePositiveLookup(masm(),
+ miss,
+ &probe_done,
+ dictionary,
+ name_reg,
+ scratch2,
+ scratch3);
__ bind(&probe_done);
// If probing finds an entry in the dictionary, scratch3 contains the
// pointer into the dictionary. Check that the value is the callback.
Register pointer = scratch3;
- const int kElementsStartOffset = StringDictionary::kHeaderSize +
- StringDictionary::kElementsStartIndex * kPointerSize;
+ const int kElementsStartOffset = NameDictionary::kHeaderSize +
+ NameDictionary::kElementsStartIndex * kPointerSize;
const int kValueOffset = kElementsStartOffset + kPointerSize;
__ ldr(scratch2, FieldMemOperand(pointer, kValueOffset));
__ cmp(scratch2, Operand(callback));
@@ -1258,7 +1259,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);
@@ -1315,7 +1316,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());
@@ -1456,7 +1457,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(r2, Operand(name));
__ b(ne, miss);
@@ -1466,7 +1467,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());
@@ -1524,7 +1525,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 -------------
// -- r2 : name
// -- lr : return address
@@ -2440,7 +2441,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 -------------
// -- r2 : name
@@ -2449,7 +2450,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;
}
@@ -2573,7 +2574,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 -------------
// -- r2 : name
// -- lr : return address
@@ -2614,13 +2615,14 @@ Handle<Code> CallStubCompiler::CompileCallGlobal(
Handle<GlobalObject> holder,
Handle<JSGlobalPropertyCell> cell,
Handle<JSFunction> function,
- Handle<String> name) {
+ Handle<Name> name) {
// ----------- S t a t e -------------
// -- r2 : name
// -- lr : return address
// -----------------------------------
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;
}
@@ -2670,7 +2672,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 -------------
// -- r0 : value
// -- r1 : receiver
@@ -2698,7 +2700,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) {
@@ -2782,7 +2784,7 @@ void StoreStubCompiler::GenerateStoreViaSetter(
Handle<Code> StoreStubCompiler::CompileStoreViaSetter(
- Handle<String> name,
+ Handle<Name> name,
Handle<JSObject> receiver,
Handle<JSObject> holder,
Handle<JSFunction> setter) {
@@ -2811,7 +2813,7 @@ Handle<Code> StoreStubCompiler::CompileStoreViaSetter(
Handle<Code> StoreStubCompiler::CompileStoreInterceptor(
Handle<JSObject> receiver,
- Handle<String> name) {
+ Handle<Name> name) {
// ----------- S t a t e -------------
// -- r0 : value
// -- r1 : receiver
@@ -2857,7 +2859,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 -------------
// -- r0 : value
// -- r1 : receiver
@@ -2903,7 +2905,7 @@ Handle<Code> StoreStubCompiler::CompileStoreGlobal(
Handle<Code> LoadStubCompiler::CompileLoadNonexistent(
Handle<JSObject> object,
Handle<JSObject> last,
- Handle<String> name,
+ Handle<Name> name,
Handle<GlobalObject> global) {
// ----------- S t a t e -------------
// -- r0 : receiver
@@ -2961,7 +2963,7 @@ Register* KeyedLoadStubCompiler::registers() {
}
-void KeyedLoadStubCompiler::GenerateNameCheck(Handle<String> name,
+void KeyedLoadStubCompiler::GenerateNameCheck(Handle<Name> name,
Register name_reg,
Label* miss) {
__ cmp(name_reg, Operand(name));
@@ -3009,7 +3011,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 -------------
// -- r0 : receiver
@@ -3036,7 +3038,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 -------------
// -- r0 : receiver
@@ -3133,7 +3135,7 @@ Handle<Code> KeyedLoadStubCompiler::CompileLoadPolymorphic(
Handle<Code> KeyedStoreStubCompiler::CompileStoreField(Handle<JSObject> object,
int index,
Handle<Map> transition,
- Handle<String> name) {
+ Handle<Name> name) {
// ----------- S t a t e -------------
// -- r0 : value
// -- r1 : name
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698