Commit 4292356b authored by palfia@homejinni.com's avatar palfia@homejinni.com

MIPS: Renamed "symbols" to "internalized strings" throughout the code base, in...

MIPS: Renamed "symbols" to "internalized strings" throughout the code base, in preparation of the introduction of ES6 'symbols' (aka private/unique names).

Port r13781 (59f39a06)

Original commit message:
The SymbolTable became the StringTable. I also made sure to adapt all comments. The only remaining use of the term "symbol" (other than unrelated uses in the parser and such) is now 'NewSymbol' in the API and the 'V8.KeyedLoadGenericSymbol' counter, changing which might break embedders.

The one functional change in this CL is that I removed the former 'empty_string' constant, since it is redundant given the 'empty_symbol' constant that we also had (and both were used inconsistently).

BUG=

Review URL: https://codereview.chromium.org/12374074

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13807 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 42a9a868
...@@ -698,7 +698,7 @@ void Builtins::Generate_StringConstructCode(MacroAssembler* masm) { ...@@ -698,7 +698,7 @@ void Builtins::Generate_StringConstructCode(MacroAssembler* masm) {
// Load the empty string into a2, remove the receiver from the // Load the empty string into a2, remove the receiver from the
// stack, and jump back to the case where the argument is a string. // stack, and jump back to the case where the argument is a string.
__ bind(&no_arguments); __ bind(&no_arguments);
__ LoadRoot(argument, Heap::kEmptyStringRootIndex); __ LoadRoot(argument, Heap::kempty_stringRootIndex);
__ Drop(1); __ Drop(1);
__ Branch(&argument_is_string); __ Branch(&argument_is_string);
......
This diff is collapsed.
...@@ -173,9 +173,9 @@ class StringHelper : public AllStatic { ...@@ -173,9 +173,9 @@ class StringHelper : public AllStatic {
int flags); int flags);
// Probe the symbol table for a two character string. If the string is // Probe the string table for a two character string. If the string is
// not found by probing a jump to the label not_found is performed. This jump // not found by probing a jump to the label not_found is performed. This jump
// does not guarantee that the string is not in the symbol table. If the // does not guarantee that the string is not in the string table. If the
// string is found the code falls through with the string in register r0. // string is found the code falls through with the string in register r0.
// Contents of both c1 and c2 registers are modified. At the exit c1 is // Contents of both c1 and c2 registers are modified. At the exit c1 is
// guaranteed to contain halfword with low and high bytes equal to // guaranteed to contain halfword with low and high bytes equal to
......
...@@ -475,7 +475,7 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm, ...@@ -475,7 +475,7 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm,
// the string. // the string.
__ bind(&cons_string); __ bind(&cons_string);
__ lw(result, FieldMemOperand(string, ConsString::kSecondOffset)); __ lw(result, FieldMemOperand(string, ConsString::kSecondOffset));
__ LoadRoot(at, Heap::kEmptyStringRootIndex); __ LoadRoot(at, Heap::kempty_stringRootIndex);
__ Branch(call_runtime, ne, result, Operand(at)); __ Branch(call_runtime, ne, result, Operand(at));
// Get the first of the two strings and load its instance type. // Get the first of the two strings and load its instance type.
__ lw(string, FieldMemOperand(string, ConsString::kFirstOffset)); __ lw(string, FieldMemOperand(string, ConsString::kFirstOffset));
......
...@@ -1638,7 +1638,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { ...@@ -1638,7 +1638,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
ASSERT(!CompileTimeValue::IsCompileTimeValue(property->value())); ASSERT(!CompileTimeValue::IsCompileTimeValue(property->value()));
// Fall through. // Fall through.
case ObjectLiteral::Property::COMPUTED: case ObjectLiteral::Property::COMPUTED:
if (key->handle()->IsSymbol()) { if (key->handle()->IsInternalizedString()) {
if (property->emit_store()) { if (property->emit_store()) {
VisitForAccumulatorValue(value); VisitForAccumulatorValue(value);
__ mov(a0, result_register()); __ mov(a0, result_register());
...@@ -2711,7 +2711,7 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( ...@@ -2711,7 +2711,7 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf(
__ LoadRoot(t0, Heap::kHashTableMapRootIndex); __ LoadRoot(t0, Heap::kHashTableMapRootIndex);
__ Branch(if_false, eq, a2, Operand(t0)); __ Branch(if_false, eq, a2, Operand(t0));
// Look for valueOf symbol in the descriptor array, and indicate false if // Look for valueOf name in the descriptor array, and indicate false if
// found. Since we omit an enumeration index check, if it is added via a // found. Since we omit an enumeration index check, if it is added via a
// transition that shares its descriptor array, this is a false positive. // transition that shares its descriptor array, this is a false positive.
Label entry, loop, done; Label entry, loop, done;
...@@ -2736,10 +2736,10 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( ...@@ -2736,10 +2736,10 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf(
__ Addu(a2, a2, t1); __ Addu(a2, a2, t1);
// Loop through all the keys in the descriptor array. If one of these is the // Loop through all the keys in the descriptor array. If one of these is the
// symbol valueOf the result is false. // string "valueOf" the result is false.
// The use of t2 to store the valueOf symbol asumes that it is not otherwise // The use of t2 to store the valueOf string assumes that it is not otherwise
// used in the loop below. // used in the loop below.
__ LoadRoot(t2, Heap::kvalue_of_symbolRootIndex); __ li(t2, Operand(FACTORY->value_of_string()));
__ jmp(&entry); __ jmp(&entry);
__ bind(&loop); __ bind(&loop);
__ lw(a3, MemOperand(t0, 0)); __ lw(a3, MemOperand(t0, 0));
...@@ -2970,12 +2970,12 @@ void FullCodeGenerator::EmitClassOf(CallRuntime* expr) { ...@@ -2970,12 +2970,12 @@ void FullCodeGenerator::EmitClassOf(CallRuntime* expr) {
// Functions have class 'Function'. // Functions have class 'Function'.
__ bind(&function); __ bind(&function);
__ LoadRoot(v0, Heap::kfunction_class_symbolRootIndex); __ LoadRoot(v0, Heap::kfunction_class_stringRootIndex);
__ jmp(&done); __ jmp(&done);
// Objects with a non-function constructor have class 'Object'. // Objects with a non-function constructor have class 'Object'.
__ bind(&non_function_constructor); __ bind(&non_function_constructor);
__ LoadRoot(v0, Heap::kObject_symbolRootIndex); __ LoadRoot(v0, Heap::kObject_stringRootIndex);
__ jmp(&done); __ jmp(&done);
// Non-JS objects have class null. // Non-JS objects have class null.
...@@ -3345,7 +3345,7 @@ void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) { ...@@ -3345,7 +3345,7 @@ void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) {
__ bind(&index_out_of_range); __ bind(&index_out_of_range);
// When the index is out of range, the spec requires us to return // When the index is out of range, the spec requires us to return
// the empty string. // the empty string.
__ LoadRoot(result, Heap::kEmptyStringRootIndex); __ LoadRoot(result, Heap::kempty_stringRootIndex);
__ jmp(&done); __ jmp(&done);
__ bind(&need_conversion); __ bind(&need_conversion);
...@@ -3660,7 +3660,7 @@ void FullCodeGenerator::EmitFastAsciiArrayJoin(CallRuntime* expr) { ...@@ -3660,7 +3660,7 @@ void FullCodeGenerator::EmitFastAsciiArrayJoin(CallRuntime* expr) {
__ lw(array_length, FieldMemOperand(array, JSArray::kLengthOffset)); __ lw(array_length, FieldMemOperand(array, JSArray::kLengthOffset));
__ SmiUntag(array_length); __ SmiUntag(array_length);
__ Branch(&non_trivial_array, ne, array_length, Operand(zero_reg)); __ Branch(&non_trivial_array, ne, array_length, Operand(zero_reg));
__ LoadRoot(v0, Heap::kEmptyStringRootIndex); __ LoadRoot(v0, Heap::kempty_stringRootIndex);
__ Branch(&done); __ Branch(&done);
__ bind(&non_trivial_array); __ bind(&non_trivial_array);
...@@ -4275,12 +4275,12 @@ void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr, ...@@ -4275,12 +4275,12 @@ void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr,
} }
PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
if (check->Equals(isolate()->heap()->number_symbol())) { if (check->Equals(isolate()->heap()->number_string())) {
__ JumpIfSmi(v0, if_true); __ JumpIfSmi(v0, if_true);
__ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset));
__ LoadRoot(at, Heap::kHeapNumberMapRootIndex); __ LoadRoot(at, Heap::kHeapNumberMapRootIndex);
Split(eq, v0, Operand(at), if_true, if_false, fall_through); Split(eq, v0, Operand(at), if_true, if_false, fall_through);
} else if (check->Equals(isolate()->heap()->string_symbol())) { } else if (check->Equals(isolate()->heap()->string_string())) {
__ JumpIfSmi(v0, if_false); __ JumpIfSmi(v0, if_false);
// Check for undetectable objects => false. // Check for undetectable objects => false.
__ GetObjectType(v0, v0, a1); __ GetObjectType(v0, v0, a1);
...@@ -4289,16 +4289,16 @@ void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr, ...@@ -4289,16 +4289,16 @@ void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr,
__ And(a1, a1, Operand(1 << Map::kIsUndetectable)); __ And(a1, a1, Operand(1 << Map::kIsUndetectable));
Split(eq, a1, Operand(zero_reg), Split(eq, a1, Operand(zero_reg),
if_true, if_false, fall_through); if_true, if_false, fall_through);
} else if (check->Equals(isolate()->heap()->boolean_symbol())) { } else if (check->Equals(isolate()->heap()->boolean_string())) {
__ LoadRoot(at, Heap::kTrueValueRootIndex); __ LoadRoot(at, Heap::kTrueValueRootIndex);
__ Branch(if_true, eq, v0, Operand(at)); __ Branch(if_true, eq, v0, Operand(at));
__ LoadRoot(at, Heap::kFalseValueRootIndex); __ LoadRoot(at, Heap::kFalseValueRootIndex);
Split(eq, v0, Operand(at), if_true, if_false, fall_through); Split(eq, v0, Operand(at), if_true, if_false, fall_through);
} else if (FLAG_harmony_typeof && } else if (FLAG_harmony_typeof &&
check->Equals(isolate()->heap()->null_symbol())) { check->Equals(isolate()->heap()->null_string())) {
__ LoadRoot(at, Heap::kNullValueRootIndex); __ LoadRoot(at, Heap::kNullValueRootIndex);
Split(eq, v0, Operand(at), if_true, if_false, fall_through); Split(eq, v0, Operand(at), if_true, if_false, fall_through);
} else if (check->Equals(isolate()->heap()->undefined_symbol())) { } else if (check->Equals(isolate()->heap()->undefined_string())) {
__ LoadRoot(at, Heap::kUndefinedValueRootIndex); __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
__ Branch(if_true, eq, v0, Operand(at)); __ Branch(if_true, eq, v0, Operand(at));
__ JumpIfSmi(v0, if_false); __ JumpIfSmi(v0, if_false);
...@@ -4307,14 +4307,14 @@ void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr, ...@@ -4307,14 +4307,14 @@ void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr,
__ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
__ And(a1, a1, Operand(1 << Map::kIsUndetectable)); __ And(a1, a1, Operand(1 << Map::kIsUndetectable));
Split(ne, a1, Operand(zero_reg), if_true, if_false, fall_through); Split(ne, a1, Operand(zero_reg), if_true, if_false, fall_through);
} else if (check->Equals(isolate()->heap()->function_symbol())) { } else if (check->Equals(isolate()->heap()->function_string())) {
__ JumpIfSmi(v0, if_false); __ JumpIfSmi(v0, if_false);
STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
__ GetObjectType(v0, v0, a1); __ GetObjectType(v0, v0, a1);
__ Branch(if_true, eq, a1, Operand(JS_FUNCTION_TYPE)); __ Branch(if_true, eq, a1, Operand(JS_FUNCTION_TYPE));
Split(eq, a1, Operand(JS_FUNCTION_PROXY_TYPE), Split(eq, a1, Operand(JS_FUNCTION_PROXY_TYPE),
if_true, if_false, fall_through); if_true, if_false, fall_through);
} else if (check->Equals(isolate()->heap()->object_symbol())) { } else if (check->Equals(isolate()->heap()->object_string())) {
__ JumpIfSmi(v0, if_false); __ JumpIfSmi(v0, if_false);
if (!FLAG_harmony_typeof) { if (!FLAG_harmony_typeof) {
__ LoadRoot(at, Heap::kNullValueRootIndex); __ LoadRoot(at, Heap::kNullValueRootIndex);
......
...@@ -305,30 +305,30 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, ...@@ -305,30 +305,30 @@ static void GenerateFastArrayLoad(MacroAssembler* masm,
} }
// Checks whether a key is an array index string or a symbol string. // Checks whether a key is an array index string or an internalized string.
// Falls through if a key is a symbol. // Falls through if a key is an internalized string.
static void GenerateKeyStringCheck(MacroAssembler* masm, static void GenerateKeyStringCheck(MacroAssembler* masm,
Register key, Register key,
Register map, Register map,
Register hash, Register hash,
Label* index_string, Label* index_string,
Label* not_symbol) { Label* not_internalized) {
// The key is not a smi. // The key is not a smi.
// Is it a string? // Is it a string?
__ GetObjectType(key, map, hash); __ GetObjectType(key, map, hash);
__ Branch(not_symbol, ge, hash, Operand(FIRST_NONSTRING_TYPE)); __ Branch(not_internalized, ge, hash, Operand(FIRST_NONSTRING_TYPE));
// Is the string an array index, with cached numeric value? // Is the string an array index, with cached numeric value?
__ lw(hash, FieldMemOperand(key, String::kHashFieldOffset)); __ lw(hash, FieldMemOperand(key, String::kHashFieldOffset));
__ And(at, hash, Operand(String::kContainsCachedArrayIndexMask)); __ And(at, hash, Operand(String::kContainsCachedArrayIndexMask));
__ Branch(index_string, eq, at, Operand(zero_reg)); __ Branch(index_string, eq, at, Operand(zero_reg));
// Is the string a symbol? // Is the string internalized?
// map: key map // map: key map
__ lbu(hash, FieldMemOperand(map, Map::kInstanceTypeOffset)); __ lbu(hash, FieldMemOperand(map, Map::kInstanceTypeOffset));
STATIC_ASSERT(kSymbolTag != 0); STATIC_ASSERT(kInternalizedTag != 0);
__ And(at, hash, Operand(kIsSymbolMask)); __ And(at, hash, Operand(kIsInternalizedMask));
__ Branch(not_symbol, eq, at, Operand(zero_reg)); __ Branch(not_internalized, eq, at, Operand(zero_reg));
} }
...@@ -583,7 +583,7 @@ void KeyedCallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) { ...@@ -583,7 +583,7 @@ void KeyedCallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) {
__ bind(&check_string); __ bind(&check_string);
GenerateKeyStringCheck(masm, a2, a0, a3, &index_string, &slow_call); GenerateKeyStringCheck(masm, a2, a0, a3, &index_string, &slow_call);
// The key is known to be a symbol. // The key is known to be internalized.
// If the receiver is a regular JS object with slow properties then do // If the receiver is a regular JS object with slow properties then do
// a quick inline probe of the receiver's dictionary. // a quick inline probe of the receiver's dictionary.
// Otherwise do the monomorphic cache probe. // Otherwise do the monomorphic cache probe.
...@@ -610,7 +610,7 @@ void KeyedCallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) { ...@@ -610,7 +610,7 @@ void KeyedCallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) {
__ bind(&slow_call); __ bind(&slow_call);
// This branch is taken if: // This branch is taken if:
// - the receiver requires boxing or access check, // - the receiver requires boxing or access check,
// - the key is neither smi nor symbol, // - the key is neither smi nor an internalized string,
// - the value loaded is not a function, // - the value loaded is not a function,
// - there is hope that the runtime will create a monomorphic call stub, // - there is hope that the runtime will create a monomorphic call stub,
// that will get fetched next time. // that will get fetched next time.
...@@ -991,7 +991,7 @@ void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { ...@@ -991,7 +991,7 @@ void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) {
int mask = KeyedLookupCache::kCapacityMask & KeyedLookupCache::kHashMask; int mask = KeyedLookupCache::kCapacityMask & KeyedLookupCache::kHashMask;
__ And(a3, a3, Operand(mask)); __ And(a3, a3, Operand(mask));
// Load the key (consisting of map and symbol) from the cache and // Load the key (consisting of map and internalized string) from the cache and
// check for match. // check for match.
Label load_in_object_property; Label load_in_object_property;
static const int kEntriesPerBucket = KeyedLookupCache::kEntriesPerBucket; static const int kEntriesPerBucket = KeyedLookupCache::kEntriesPerBucket;
......
...@@ -2327,12 +2327,12 @@ void LCodeGen::EmitClassOfTest(Label* is_true, ...@@ -2327,12 +2327,12 @@ void LCodeGen::EmitClassOfTest(Label* is_true,
__ lw(temp, FieldMemOperand(temp, JSFunction::kSharedFunctionInfoOffset)); __ lw(temp, FieldMemOperand(temp, JSFunction::kSharedFunctionInfoOffset));
__ lw(temp, FieldMemOperand(temp, __ lw(temp, FieldMemOperand(temp,
SharedFunctionInfo::kInstanceClassNameOffset)); SharedFunctionInfo::kInstanceClassNameOffset));
// The class name we are testing against is a symbol because it's a literal. // The class name we are testing against is internalized since it's a literal.
// The name in the constructor is a symbol because of the way the context is // The name in the constructor is internalized because of the way the context
// booted. This routine isn't expected to work for random API-created // is booted. This routine isn't expected to work for random API-created
// classes and it doesn't have to because you can't access it with natives // classes and it doesn't have to because you can't access it with natives
// syntax. Since both sides are symbols it is sufficient to use an identity // syntax. Since both sides are internalized it is sufficient to use an
// comparison. // identity comparison.
// End with the address of this class_name instance in temp register. // End with the address of this class_name instance in temp register.
// On MIPS, the caller must do the comparison with Handle<String>class_name. // On MIPS, the caller must do the comparison with Handle<String>class_name.
...@@ -5720,7 +5720,7 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label, ...@@ -5720,7 +5720,7 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label,
// register. // register.
Condition final_branch_condition = kNoCondition; Condition final_branch_condition = kNoCondition;
Register scratch = scratch0(); Register scratch = scratch0();
if (type_name->Equals(heap()->number_symbol())) { if (type_name->Equals(heap()->number_string())) {
__ JumpIfSmi(input, true_label); __ JumpIfSmi(input, true_label);
__ lw(input, FieldMemOperand(input, HeapObject::kMapOffset)); __ lw(input, FieldMemOperand(input, HeapObject::kMapOffset));
__ LoadRoot(at, Heap::kHeapNumberMapRootIndex); __ LoadRoot(at, Heap::kHeapNumberMapRootIndex);
...@@ -5728,7 +5728,7 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label, ...@@ -5728,7 +5728,7 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label,
cmp2 = Operand(at); cmp2 = Operand(at);
final_branch_condition = eq; final_branch_condition = eq;
} else if (type_name->Equals(heap()->string_symbol())) { } else if (type_name->Equals(heap()->string_string())) {
__ JumpIfSmi(input, false_label); __ JumpIfSmi(input, false_label);
__ GetObjectType(input, input, scratch); __ GetObjectType(input, input, scratch);
__ Branch(USE_DELAY_SLOT, false_label, __ Branch(USE_DELAY_SLOT, false_label,
...@@ -5741,7 +5741,7 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label, ...@@ -5741,7 +5741,7 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label,
cmp2 = Operand(zero_reg); cmp2 = Operand(zero_reg);
final_branch_condition = eq; final_branch_condition = eq;
} else if (type_name->Equals(heap()->boolean_symbol())) { } else if (type_name->Equals(heap()->boolean_string())) {
__ LoadRoot(at, Heap::kTrueValueRootIndex); __ LoadRoot(at, Heap::kTrueValueRootIndex);
__ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input));
__ LoadRoot(at, Heap::kFalseValueRootIndex); __ LoadRoot(at, Heap::kFalseValueRootIndex);
...@@ -5749,13 +5749,13 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label, ...@@ -5749,13 +5749,13 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label,
cmp2 = Operand(input); cmp2 = Operand(input);
final_branch_condition = eq; final_branch_condition = eq;
} else if (FLAG_harmony_typeof && type_name->Equals(heap()->null_symbol())) { } else if (FLAG_harmony_typeof && type_name->Equals(heap()->null_string())) {
__ LoadRoot(at, Heap::kNullValueRootIndex); __ LoadRoot(at, Heap::kNullValueRootIndex);
cmp1 = at; cmp1 = at;
cmp2 = Operand(input); cmp2 = Operand(input);
final_branch_condition = eq; final_branch_condition = eq;
} else if (type_name->Equals(heap()->undefined_symbol())) { } else if (type_name->Equals(heap()->undefined_string())) {
__ LoadRoot(at, Heap::kUndefinedValueRootIndex); __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
__ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input));
// The first instruction of JumpIfSmi is an And - it is safe in the delay // The first instruction of JumpIfSmi is an And - it is safe in the delay
...@@ -5769,7 +5769,7 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label, ...@@ -5769,7 +5769,7 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label,
cmp2 = Operand(zero_reg); cmp2 = Operand(zero_reg);
final_branch_condition = ne; final_branch_condition = ne;
} else if (type_name->Equals(heap()->function_symbol())) { } else if (type_name->Equals(heap()->function_string())) {
STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
__ JumpIfSmi(input, false_label); __ JumpIfSmi(input, false_label);
__ GetObjectType(input, scratch, input); __ GetObjectType(input, scratch, input);
...@@ -5778,7 +5778,7 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label, ...@@ -5778,7 +5778,7 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label,
cmp2 = Operand(JS_FUNCTION_PROXY_TYPE); cmp2 = Operand(JS_FUNCTION_PROXY_TYPE);
final_branch_condition = eq; final_branch_condition = eq;
} else if (type_name->Equals(heap()->object_symbol())) { } else if (type_name->Equals(heap()->object_string())) {
__ JumpIfSmi(input, false_label); __ JumpIfSmi(input, false_label);
if (!FLAG_harmony_typeof) { if (!FLAG_harmony_typeof) {
__ LoadRoot(at, Heap::kNullValueRootIndex); __ LoadRoot(at, Heap::kNullValueRootIndex);
......
...@@ -121,14 +121,14 @@ static void ProbeTable(Isolate* isolate, ...@@ -121,14 +121,14 @@ static void ProbeTable(Isolate* isolate,
// the property. This function may return false negatives, so miss_label // the property. This function may return false negatives, so miss_label
// must always call a backup property check that is complete. // must always call a backup property check that is complete.
// This function is safe to call if the receiver has fast properties. // This function is safe to call if the receiver has fast properties.
// Name must be a symbol and receiver must be a heap object. // Name must be internalized and receiver must be a heap object.
static void GenerateDictionaryNegativeLookup(MacroAssembler* masm, static void GenerateDictionaryNegativeLookup(MacroAssembler* masm,
Label* miss_label, Label* miss_label,
Register receiver, Register receiver,
Handle<String> name, Handle<String> name,
Register scratch0, Register scratch0,
Register scratch1) { Register scratch1) {
ASSERT(name->IsSymbol()); ASSERT(name->IsInternalizedString());
Counters* counters = masm->isolate()->counters(); Counters* counters = masm->isolate()->counters();
__ IncrementCounter(counters->negative_lookups(), 1, scratch0, scratch1); __ IncrementCounter(counters->negative_lookups(), 1, scratch0, scratch1);
__ IncrementCounter(counters->negative_lookups_miss(), 1, scratch0, scratch1); __ IncrementCounter(counters->negative_lookups_miss(), 1, scratch0, scratch1);
...@@ -1103,7 +1103,7 @@ Register StubCompiler::CheckPrototypes(Handle<JSObject> object, ...@@ -1103,7 +1103,7 @@ Register StubCompiler::CheckPrototypes(Handle<JSObject> object,
if (!current->HasFastProperties() && if (!current->HasFastProperties() &&
!current->IsJSGlobalObject() && !current->IsJSGlobalObject() &&
!current->IsJSGlobalProxy()) { !current->IsJSGlobalProxy()) {
if (!name->IsSymbol()) { if (!name->IsInternalizedString()) {
name = factory()->InternalizeString(name); name = factory()->InternalizeString(name);
} }
ASSERT(current->property_dictionary()->FindEntry(*name) == ASSERT(current->property_dictionary()->FindEntry(*name) ==
...@@ -2001,7 +2001,7 @@ Handle<Code> CallStubCompiler::CompileStringCharAtCall( ...@@ -2001,7 +2001,7 @@ Handle<Code> CallStubCompiler::CompileStringCharAtCall(
if (index_out_of_range.is_linked()) { if (index_out_of_range.is_linked()) {
__ bind(&index_out_of_range); __ bind(&index_out_of_range);
__ LoadRoot(v0, Heap::kEmptyStringRootIndex); __ LoadRoot(v0, Heap::kempty_stringRootIndex);
__ Drop(argc + 1); __ Drop(argc + 1);
__ Ret(); __ Ret();
} }
...@@ -2420,7 +2420,7 @@ void CallStubCompiler::CompileHandlerFrontend(Handle<Object> object, ...@@ -2420,7 +2420,7 @@ void CallStubCompiler::CompileHandlerFrontend(Handle<Object> object,
break; break;
case STRING_CHECK: case STRING_CHECK:
// Check that the object is a two-byte string or a symbol. // Check that the object is a string.
__ GetObjectType(a1, a3, a3); __ GetObjectType(a1, a3, a3);
__ Branch(&miss, Ugreater_equal, a3, Operand(FIRST_NONSTRING_TYPE)); __ Branch(&miss, Ugreater_equal, a3, Operand(FIRST_NONSTRING_TYPE));
// Check that the maps starting from the prototype haven't changed. // Check that the maps starting from the prototype haven't changed.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment