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

Unified Diff: src/x64/stub-cache-x64.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/x64/macro-assembler-x64.cc ('k') | test/mjsunit/harmony/symbols.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/stub-cache-x64.cc
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc
index 4be5738756ea9a663c0bac5cc89ade52dbeae834..23a4d4624bcc305cd5e5e6582ce7e43ae2db40dd 100644
--- a/src/x64/stub-cache-x64.cc
+++ b/src/x64/stub-cache-x64.cc
@@ -110,14 +110,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);
@@ -146,12 +146,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);
}
@@ -193,7 +193,7 @@ void StubCache::GenerateProbe(MacroAssembler* masm,
__ JumpIfSmi(receiver, &miss);
// Get the map of the receiver and compute the hash.
- __ movl(scratch, FieldOperand(name, String::kHashFieldOffset));
+ __ movl(scratch, FieldOperand(name, Name::kHashFieldOffset));
// Use only the low 32 bits of the map pointer.
__ addl(scratch, FieldOperand(receiver, HeapObject::kMapOffset));
__ xor_(scratch, Immediate(flags));
@@ -205,7 +205,7 @@ void StubCache::GenerateProbe(MacroAssembler* masm,
ProbeTable(isolate, masm, flags, kPrimary, receiver, name, scratch);
// Primary miss: Compute hash for secondary probe.
- __ movl(scratch, FieldOperand(name, String::kHashFieldOffset));
+ __ movl(scratch, FieldOperand(name, Name::kHashFieldOffset));
__ addl(scratch, FieldOperand(receiver, HeapObject::kMapOffset));
__ xor_(scratch, Immediate(flags));
__ and_(scratch, Immediate((kPrimaryTableSize - 1) << kHeapObjectTagSize));
@@ -532,7 +532,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,
@@ -564,7 +564,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());
@@ -657,7 +657,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 =
@@ -745,7 +745,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,
@@ -873,7 +873,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 =
@@ -891,7 +891,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;
@@ -917,7 +917,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.
@@ -949,11 +949,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);
@@ -1028,7 +1029,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);
@@ -1049,7 +1050,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));
@@ -1061,21 +1062,21 @@ 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
// index into the dictionary. Check that the value is the callback.
Register index = scratch3;
const int kElementsStartOffset =
- StringDictionary::kHeaderSize +
- StringDictionary::kElementsStartIndex * kPointerSize;
+ NameDictionary::kHeaderSize +
+ NameDictionary::kElementsStartIndex * kPointerSize;
const int kValueOffset = kElementsStartOffset + kPointerSize;
__ movq(scratch2,
Operand(dictionary, index, times_pointer_size,
@@ -1095,7 +1096,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);
@@ -1170,7 +1171,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);
@@ -1193,7 +1194,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());
@@ -1335,7 +1336,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(rcx, name);
__ j(not_equal, miss);
@@ -1345,7 +1346,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());
@@ -1403,7 +1404,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 -------------
// rcx : function name
// rsp[0] : return address
@@ -2191,7 +2192,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 -------------
// rcx : function name
@@ -2206,7 +2207,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;
}
@@ -2329,7 +2330,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 -------------
// rcx : function name
// rsp[0] : return address
@@ -2392,7 +2393,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 -------------
// rcx : function name
// rsp[0] : return address
@@ -2404,7 +2405,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;
}
@@ -2453,7 +2455,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 -------------
// -- rax : value
// -- rcx : name
@@ -2484,7 +2486,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) {
@@ -2571,7 +2573,7 @@ void StoreStubCompiler::GenerateStoreViaSetter(
Handle<Code> StoreStubCompiler::CompileStoreViaSetter(
- Handle<String> name,
+ Handle<Name> name,
Handle<JSObject> receiver,
Handle<JSObject> holder,
Handle<JSFunction> setter) {
@@ -2600,7 +2602,7 @@ Handle<Code> StoreStubCompiler::CompileStoreViaSetter(
Handle<Code> StoreStubCompiler::CompileStoreInterceptor(
Handle<JSObject> receiver,
- Handle<String> name) {
+ Handle<Name> name) {
// ----------- S t a t e -------------
// -- rax : value
// -- rcx : name
@@ -2647,7 +2649,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 -------------
// -- rax : value
// -- rcx : name
@@ -2695,7 +2697,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 -------------
// -- rax : value
// -- rcx : key
@@ -2798,7 +2800,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 -------------
// -- rax : receiver
@@ -2857,7 +2859,7 @@ Register* KeyedLoadStubCompiler::registers() {
}
-void KeyedLoadStubCompiler::GenerateNameCheck(Handle<String> name,
+void KeyedLoadStubCompiler::GenerateNameCheck(Handle<Name> name,
Register name_reg,
Label* miss) {
__ Cmp(name_reg, name);
@@ -2905,7 +2907,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 -------------
// -- rax : receiver
@@ -2932,7 +2934,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 -------------
// -- rax : receiver
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | test/mjsunit/harmony/symbols.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698