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

Unified Diff: src/stub-cache.h

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/runtime.js ('k') | src/stub-cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/stub-cache.h
diff --git a/src/stub-cache.h b/src/stub-cache.h
index 3a98f544c755bed4441e3049768cfec3fb026b34..cf750d5140e61d6240286606bd96bd0956206b96 100644
--- a/src/stub-cache.h
+++ b/src/stub-cache.h
@@ -67,7 +67,7 @@ class SCTableReference {
class StubCache {
public:
struct Entry {
- String* key;
+ Name* key;
Code* value;
Map* map;
};
@@ -77,36 +77,36 @@ class StubCache {
// Computes the right stub matching. Inserts the result in the
// cache before returning. This might compile a stub if needed.
- Handle<Code> ComputeLoadNonexistent(Handle<String> name,
+ Handle<Code> ComputeLoadNonexistent(Handle<Name> name,
Handle<JSObject> object);
- Handle<Code> ComputeLoadField(Handle<String> name,
+ Handle<Code> ComputeLoadField(Handle<Name> name,
Handle<JSObject> object,
Handle<JSObject> holder,
PropertyIndex field_index);
- Handle<Code> ComputeLoadCallback(Handle<String> name,
+ Handle<Code> ComputeLoadCallback(Handle<Name> name,
Handle<JSObject> object,
Handle<JSObject> holder,
Handle<AccessorInfo> callback);
- Handle<Code> ComputeLoadViaGetter(Handle<String> name,
+ Handle<Code> ComputeLoadViaGetter(Handle<Name> name,
Handle<JSObject> object,
Handle<JSObject> holder,
Handle<JSFunction> getter);
- Handle<Code> ComputeLoadConstant(Handle<String> name,
+ Handle<Code> ComputeLoadConstant(Handle<Name> name,
Handle<JSObject> object,
Handle<JSObject> holder,
Handle<JSFunction> value);
- Handle<Code> ComputeLoadInterceptor(Handle<String> name,
+ Handle<Code> ComputeLoadInterceptor(Handle<Name> name,
Handle<JSObject> object,
Handle<JSObject> holder);
Handle<Code> ComputeLoadNormal();
- Handle<Code> ComputeLoadGlobal(Handle<String> name,
+ Handle<Code> ComputeLoadGlobal(Handle<Name> name,
Handle<JSObject> object,
Handle<GlobalObject> holder,
Handle<JSGlobalPropertyCell> cell,
@@ -114,28 +114,28 @@ class StubCache {
// ---
- Handle<Code> ComputeKeyedLoadField(Handle<String> name,
+ Handle<Code> ComputeKeyedLoadField(Handle<Name> name,
Handle<JSObject> object,
Handle<JSObject> holder,
PropertyIndex field_index);
- Handle<Code> ComputeKeyedLoadCallback(Handle<String> name,
+ Handle<Code> ComputeKeyedLoadCallback(Handle<Name> name,
Handle<JSObject> object,
Handle<JSObject> holder,
Handle<AccessorInfo> callback);
- Handle<Code> ComputeKeyedLoadConstant(Handle<String> name,
+ Handle<Code> ComputeKeyedLoadConstant(Handle<Name> name,
Handle<JSObject> object,
Handle<JSObject> holder,
Handle<JSFunction> value);
- Handle<Code> ComputeKeyedLoadInterceptor(Handle<String> name,
+ Handle<Code> ComputeKeyedLoadInterceptor(Handle<Name> name,
Handle<JSObject> object,
Handle<JSObject> holder);
// ---
- Handle<Code> ComputeStoreField(Handle<String> name,
+ Handle<Code> ComputeStoreField(Handle<Name> name,
Handle<JSObject> object,
int field_index,
Handle<Map> transition,
@@ -143,30 +143,30 @@ class StubCache {
Handle<Code> ComputeStoreNormal(StrictModeFlag strict_mode);
- Handle<Code> ComputeStoreGlobal(Handle<String> name,
+ Handle<Code> ComputeStoreGlobal(Handle<Name> name,
Handle<GlobalObject> object,
Handle<JSGlobalPropertyCell> cell,
StrictModeFlag strict_mode);
- Handle<Code> ComputeStoreCallback(Handle<String> name,
+ Handle<Code> ComputeStoreCallback(Handle<Name> name,
Handle<JSObject> object,
Handle<JSObject> holder,
Handle<AccessorInfo> callback,
StrictModeFlag strict_mode);
- Handle<Code> ComputeStoreViaSetter(Handle<String> name,
+ Handle<Code> ComputeStoreViaSetter(Handle<Name> name,
Handle<JSObject> object,
Handle<JSObject> holder,
Handle<JSFunction> setter,
StrictModeFlag strict_mode);
- Handle<Code> ComputeStoreInterceptor(Handle<String> name,
+ Handle<Code> ComputeStoreInterceptor(Handle<Name> name,
Handle<JSObject> object,
StrictModeFlag strict_mode);
// ---
- Handle<Code> ComputeKeyedStoreField(Handle<String> name,
+ Handle<Code> ComputeKeyedStoreField(Handle<Name> name,
Handle<JSObject> object,
int field_index,
Handle<Map> transition,
@@ -184,7 +184,7 @@ class StubCache {
Handle<Code> ComputeCallField(int argc,
Code::Kind,
Code::ExtraICState extra_state,
- Handle<String> name,
+ Handle<Name> name,
Handle<Object> object,
Handle<JSObject> holder,
PropertyIndex index);
@@ -192,7 +192,7 @@ class StubCache {
Handle<Code> ComputeCallConstant(int argc,
Code::Kind,
Code::ExtraICState extra_state,
- Handle<String> name,
+ Handle<Name> name,
Handle<Object> object,
Handle<JSObject> holder,
Handle<JSFunction> function);
@@ -200,14 +200,14 @@ class StubCache {
Handle<Code> ComputeCallInterceptor(int argc,
Code::Kind,
Code::ExtraICState extra_state,
- Handle<String> name,
+ Handle<Name> name,
Handle<Object> object,
Handle<JSObject> holder);
Handle<Code> ComputeCallGlobal(int argc,
Code::Kind,
Code::ExtraICState extra_state,
- Handle<String> name,
+ Handle<Name> name,
Handle<JSObject> object,
Handle<GlobalObject> holder,
Handle<JSGlobalPropertyCell> cell,
@@ -254,14 +254,14 @@ class StubCache {
#endif
// Update cache for entry hash(name, map).
- Code* Set(String* name, Map* map, Code* code);
+ Code* Set(Name* name, Map* map, Code* code);
// Clear the lookup table (@ mark compact collection).
void Clear();
// Collect all maps that match the name and flags.
void CollectMatchingMaps(SmallMapList* types,
- String* name,
+ Name* name,
Code::Flags flags,
Handle<Context> native_context,
Zone* zone);
@@ -332,12 +332,12 @@ class StubCache {
// Hash algorithm for the primary table. This algorithm is replicated in
// assembler for every architecture. Returns an index into the table that
// is scaled by 1 << kHeapObjectTagSize.
- static int PrimaryOffset(String* name, Code::Flags flags, Map* map) {
+ static int PrimaryOffset(Name* name, Code::Flags flags, Map* map) {
// This works well because the heap object tag size and the hash
// shift are equal. Shifting down the length field to get the
// hash code would effectively throw away two bits of the hash
// code.
- STATIC_ASSERT(kHeapObjectTagSize == String::kHashShift);
+ STATIC_ASSERT(kHeapObjectTagSize == Name::kHashShift);
// Compute the hash of the name (use entire hash field).
ASSERT(name->HasHashCode());
uint32_t field = name->hash_field();
@@ -358,25 +358,25 @@ class StubCache {
// Hash algorithm for the secondary table. This algorithm is replicated in
// assembler for every architecture. Returns an index into the table that
// is scaled by 1 << kHeapObjectTagSize.
- static int SecondaryOffset(String* name, Code::Flags flags, int seed) {
+ static int SecondaryOffset(Name* name, Code::Flags flags, int seed) {
// Use the seed from the primary cache in the secondary cache.
- uint32_t string_low32bits =
+ uint32_t name_low32bits =
static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name));
// We always set the in_loop bit to zero when generating the lookup code
// so do it here too so the hash codes match.
uint32_t iflags =
(static_cast<uint32_t>(flags) & ~Code::kFlagsNotUsedInLookup);
- uint32_t key = (seed - string_low32bits) + iflags;
+ uint32_t key = (seed - name_low32bits) + iflags;
return key & ((kSecondaryTableSize - 1) << kHeapObjectTagSize);
}
// Compute the entry for a given offset in exactly the same way as
// we do in generated code. We generate an hash code that already
- // ends in String::kHashShift 0s. Then we multiply it so it is a multiple
+ // ends in Name::kHashShift 0s. Then we multiply it so it is a multiple
// of sizeof(Entry). This makes it easier to avoid making mistakes
// in the hashed offset computations.
static Entry* entry(Entry* table, int offset) {
- const int multiplier = sizeof(*table) >> String::kHashShift;
+ const int multiplier = sizeof(*table) >> Name::kHashShift;
return reinterpret_cast<Entry*>(
reinterpret_cast<Address>(table) + offset * multiplier);
}
@@ -478,7 +478,7 @@ class StubCompiler BASE_EMBEDDED {
Handle<JSObject> object,
int index,
Handle<Map> transition,
- Handle<String> name,
+ Handle<Name> name,
Register receiver_reg,
Register name_reg,
Register scratch1,
@@ -511,7 +511,7 @@ class StubCompiler BASE_EMBEDDED {
Register holder_reg,
Register scratch1,
Register scratch2,
- Handle<String> name,
+ Handle<Name> name,
Label* miss) {
return CheckPrototypes(object, object_reg, holder, holder_reg, scratch1,
scratch2, name, kInvalidProtoDepth, miss);
@@ -523,14 +523,14 @@ class StubCompiler BASE_EMBEDDED {
Register holder_reg,
Register scratch1,
Register scratch2,
- Handle<String> name,
+ Handle<Name> name,
int save_at_depth,
Label* miss);
protected:
Handle<Code> GetCodeWithFlags(Code::Flags flags, const char* name);
- Handle<Code> GetCodeWithFlags(Code::Flags flags, Handle<String> name);
+ Handle<Code> GetCodeWithFlags(Code::Flags flags, Handle<Name> name);
MacroAssembler* masm() { return &masm_; }
void set_failure(Failure* failure) { failure_ = failure; }
@@ -542,7 +542,7 @@ class StubCompiler BASE_EMBEDDED {
Register scratch2,
Register scratch3,
PropertyIndex index,
- Handle<String> name,
+ Handle<Name> name,
Label* miss);
void GenerateLoadCallback(Handle<JSObject> object,
@@ -554,7 +554,7 @@ class StubCompiler BASE_EMBEDDED {
Register scratch3,
Register scratch4,
Handle<AccessorInfo> callback,
- Handle<String> name,
+ Handle<Name> name,
Label* miss);
void GenerateDictionaryLoadCallback(Register receiver,
@@ -563,7 +563,7 @@ class StubCompiler BASE_EMBEDDED {
Register scratch2,
Register scratch3,
Handle<AccessorInfo> callback,
- Handle<String> name,
+ Handle<Name> name,
Label* miss);
void GenerateLoadConstant(Handle<JSObject> object,
@@ -573,7 +573,7 @@ class StubCompiler BASE_EMBEDDED {
Register scratch2,
Register scratch3,
Handle<JSFunction> value,
- Handle<String> name,
+ Handle<Name> name,
Label* miss);
void GenerateLoadInterceptor(Handle<JSObject> object,
@@ -584,11 +584,11 @@ class StubCompiler BASE_EMBEDDED {
Register scratch1,
Register scratch2,
Register scratch3,
- Handle<String> name,
+ Handle<Name> name,
Label* miss);
static void LookupPostInterceptor(Handle<JSObject> holder,
- Handle<String> name,
+ Handle<Name> name,
LookupResult* lookup);
Isolate* isolate() { return isolate_; }
@@ -610,22 +610,22 @@ class BaseLoadStubCompiler: public StubCompiler {
Handle<Code> CompileLoadField(Handle<JSObject> object,
Handle<JSObject> holder,
- Handle<String> name,
+ Handle<Name> name,
PropertyIndex index);
Handle<Code> CompileLoadCallback(Handle<JSObject> object,
Handle<JSObject> holder,
- Handle<String> name,
+ Handle<Name> name,
Handle<AccessorInfo> callback);
Handle<Code> CompileLoadConstant(Handle<JSObject> object,
Handle<JSObject> holder,
- Handle<String> name,
+ Handle<Name> name,
Handle<JSFunction> value);
Handle<Code> CompileLoadInterceptor(Handle<JSObject> object,
Handle<JSObject> holder,
- Handle<String> name);
+ Handle<Name> name);
protected:
Register receiver() { return registers_[0]; }
@@ -637,11 +637,11 @@ class BaseLoadStubCompiler: public StubCompiler {
private:
virtual Code::Kind kind() = 0;
- virtual void GenerateNameCheck(Handle<String> name,
+ virtual void GenerateNameCheck(Handle<Name> name,
Register name_reg,
Label* miss) { }
virtual Handle<Code> GetCode(Code::StubType type,
- Handle<String> name,
+ Handle<Name> name,
InlineCacheState state = MONOMORPHIC) = 0;
Register* registers_;
};
@@ -654,7 +654,7 @@ class LoadStubCompiler: public BaseLoadStubCompiler {
Handle<Code> CompileLoadNonexistent(Handle<JSObject> object,
Handle<JSObject> last,
- Handle<String> name,
+ Handle<Name> name,
Handle<GlobalObject> global);
static void GenerateLoadViaGetter(MacroAssembler* masm,
@@ -662,20 +662,20 @@ class LoadStubCompiler: public BaseLoadStubCompiler {
Handle<Code> CompileLoadViaGetter(Handle<JSObject> object,
Handle<JSObject> holder,
- Handle<String> name,
+ Handle<Name> name,
Handle<JSFunction> getter);
Handle<Code> CompileLoadGlobal(Handle<JSObject> object,
Handle<GlobalObject> holder,
Handle<JSGlobalPropertyCell> cell,
- Handle<String> name,
+ Handle<Name> name,
bool is_dont_delete);
private:
Register* registers();
virtual Code::Kind kind() { return Code::LOAD_IC; }
virtual Handle<Code> GetCode(Code::StubType type,
- Handle<String> name,
+ Handle<Name> name,
InlineCacheState state = MONOMORPHIC);
};
@@ -698,9 +698,9 @@ class KeyedLoadStubCompiler: public BaseLoadStubCompiler {
Register* registers();
virtual Code::Kind kind() { return Code::KEYED_LOAD_IC; }
virtual Handle<Code> GetCode(Code::StubType type,
- Handle<String> name,
+ Handle<Name> name,
InlineCacheState state = MONOMORPHIC);
- virtual void GenerateNameCheck(Handle<String> name,
+ virtual void GenerateNameCheck(Handle<Name> name,
Register name_reg,
Label* miss);
};
@@ -715,9 +715,9 @@ class StoreStubCompiler: public StubCompiler {
Handle<Code> CompileStoreField(Handle<JSObject> object,
int index,
Handle<Map> transition,
- Handle<String> name);
+ Handle<Name> name);
- Handle<Code> CompileStoreCallback(Handle<String> name,
+ Handle<Code> CompileStoreCallback(Handle<Name> name,
Handle<JSObject> object,
Handle<JSObject> holder,
Handle<AccessorInfo> callback);
@@ -725,20 +725,20 @@ class StoreStubCompiler: public StubCompiler {
static void GenerateStoreViaSetter(MacroAssembler* masm,
Handle<JSFunction> setter);
- Handle<Code> CompileStoreViaSetter(Handle<String> name,
+ Handle<Code> CompileStoreViaSetter(Handle<Name> name,
Handle<JSObject> object,
Handle<JSObject> holder,
Handle<JSFunction> setter);
Handle<Code> CompileStoreInterceptor(Handle<JSObject> object,
- Handle<String> name);
+ Handle<Name> name);
Handle<Code> CompileStoreGlobal(Handle<GlobalObject> object,
Handle<JSGlobalPropertyCell> holder,
- Handle<String> name);
+ Handle<Name> name);
private:
- Handle<Code> GetCode(Code::StubType type, Handle<String> name);
+ Handle<Code> GetCode(Code::StubType type, Handle<Name> name);
StrictModeFlag strict_mode_;
};
@@ -756,7 +756,7 @@ class KeyedStoreStubCompiler: public StubCompiler {
Handle<Code> CompileStoreField(Handle<JSObject> object,
int index,
Handle<Map> transition,
- Handle<String> name);
+ Handle<Name> name);
Handle<Code> CompileStoreElement(Handle<Map> receiver_map);
@@ -782,7 +782,7 @@ class KeyedStoreStubCompiler: public StubCompiler {
private:
Handle<Code> GetCode(Code::StubType type,
- Handle<String> name,
+ Handle<Name> name,
InlineCacheState state = MONOMORPHIC);
StrictModeFlag strict_mode_;
@@ -815,23 +815,23 @@ class CallStubCompiler: public StubCompiler {
Handle<Code> CompileCallField(Handle<JSObject> object,
Handle<JSObject> holder,
PropertyIndex index,
- Handle<String> name);
+ Handle<Name> name);
Handle<Code> CompileCallConstant(Handle<Object> object,
Handle<JSObject> holder,
Handle<JSFunction> function,
- Handle<String> name,
+ Handle<Name> name,
CheckType check);
Handle<Code> CompileCallInterceptor(Handle<JSObject> object,
Handle<JSObject> holder,
- Handle<String> name);
+ Handle<Name> name);
Handle<Code> CompileCallGlobal(Handle<JSObject> object,
Handle<GlobalObject> holder,
Handle<JSGlobalPropertyCell> cell,
Handle<JSFunction> function,
- Handle<String> name);
+ Handle<Name> name);
static bool HasCustomCallGenerator(Handle<JSFunction> function);
@@ -861,16 +861,16 @@ class CallStubCompiler: public StubCompiler {
Handle<JSFunction> function,
Handle<String> name);
- Handle<Code> GetCode(Code::StubType type, Handle<String> name);
+ Handle<Code> GetCode(Code::StubType type, Handle<Name> name);
Handle<Code> GetCode(Handle<JSFunction> function);
const ParameterCount& arguments() { return arguments_; }
- void GenerateNameCheck(Handle<String> name, Label* miss);
+ void GenerateNameCheck(Handle<Name> name, Label* miss);
void GenerateGlobalReceiverCheck(Handle<JSObject> object,
Handle<JSObject> holder,
- Handle<String> name,
+ Handle<Name> name,
Label* miss);
// Generates code to load the function from the cell checking that
« no previous file with comments | « src/runtime.js ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698