Revision: 13807
Author: [email protected]
Date: Mon Mar 4 06:45:39 2013
Log: 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
http://code.google.com/p/v8/source/detail?r=13807
Modified:
/branches/bleeding_edge/src/mips/builtins-mips.cc
/branches/bleeding_edge/src/mips/code-stubs-mips.cc
/branches/bleeding_edge/src/mips/code-stubs-mips.h
/branches/bleeding_edge/src/mips/codegen-mips.cc
/branches/bleeding_edge/src/mips/full-codegen-mips.cc
/branches/bleeding_edge/src/mips/ic-mips.cc
/branches/bleeding_edge/src/mips/lithium-codegen-mips.cc
/branches/bleeding_edge/src/mips/stub-cache-mips.cc
=======================================
--- /branches/bleeding_edge/src/mips/builtins-mips.cc Wed Jan 30 08:09:31
2013
+++ /branches/bleeding_edge/src/mips/builtins-mips.cc Mon Mar 4 06:45:39
2013
@@ -698,7 +698,7 @@
// Load the empty string into a2, remove the receiver from the
// stack, and jump back to the case where the argument is a string.
__ bind(&no_arguments);
- __ LoadRoot(argument, Heap::kEmptyStringRootIndex);
+ __ LoadRoot(argument, Heap::kempty_stringRootIndex);
__ Drop(1);
__ Branch(&argument_is_string);
=======================================
--- /branches/bleeding_edge/src/mips/code-stubs-mips.cc Mon Mar 4 06:41:39
2013
+++ /branches/bleeding_edge/src/mips/code-stubs-mips.cc Mon Mar 4 06:45:39
2013
@@ -1577,12 +1577,13 @@
// Check for oddballs: true, false, null, undefined.
__ Branch(&return_not_equal, eq, a3, Operand(ODDBALL_TYPE));
- // Now that we have the types we might as well check for symbol-symbol.
- // Ensure that no non-strings have the symbol bit set.
- STATIC_ASSERT(LAST_TYPE < kNotStringTag + kIsSymbolMask);
- STATIC_ASSERT(kSymbolTag != 0);
+ // Now that we have the types we might as well check for
+ // internalized-internalized.
+ // Ensure that no non-strings have the internalized bit set.
+ STATIC_ASSERT(LAST_TYPE < kNotStringTag + kIsInternalizedMask);
+ STATIC_ASSERT(kInternalizedTag != 0);
__ And(t2, a2, Operand(a3));
- __ And(t0, t2, Operand(kIsSymbolMask));
+ __ And(t0, t2, Operand(kIsInternalizedMask));
__ Branch(&return_not_equal, ne, t0, Operand(zero_reg));
}
@@ -1620,30 +1621,30 @@
}
-// Fast negative check for symbol-to-symbol equality.
-static void EmitCheckForSymbolsOrObjects(MacroAssembler* masm,
- Register lhs,
- Register rhs,
- Label* possible_strings,
- Label* not_both_strings) {
+// Fast negative check for internalized-to-internalized equality.
+static void EmitCheckForInternalizedStringsOrObjects(MacroAssembler* masm,
+ Register lhs,
+ Register rhs,
+ Label*
possible_strings,
+ Label*
not_both_strings) {
ASSERT((lhs.is(a0) && rhs.is(a1)) ||
(lhs.is(a1) && rhs.is(a0)));
// a2 is object type of lhs.
- // Ensure that no non-strings have the symbol bit set.
+ // Ensure that no non-strings have the internalized bit set.
Label object_test;
- STATIC_ASSERT(kSymbolTag != 0);
+ STATIC_ASSERT(kInternalizedTag != 0);
__ And(at, a2, Operand(kIsNotStringMask));
__ Branch(&object_test, ne, at, Operand(zero_reg));
- __ And(at, a2, Operand(kIsSymbolMask));
+ __ And(at, a2, Operand(kIsInternalizedMask));
__ Branch(possible_strings, eq, at, Operand(zero_reg));
__ GetObjectType(rhs, a3, a3);
__ Branch(not_both_strings, ge, a3, Operand(FIRST_NONSTRING_TYPE));
- __ And(at, a3, Operand(kIsSymbolMask));
+ __ And(at, a3, Operand(kIsInternalizedMask));
__ Branch(possible_strings, eq, at, Operand(zero_reg));
- // Both are symbols. We already checked they weren't the same pointer
- // so they are not equal.
+ // Both are internalized strings. We already checked they weren't the
same
+ // pointer so they are not equal.
__ Ret(USE_DELAY_SLOT);
__ li(v0, Operand(1)); // Non-zero indicates not equal.
@@ -1789,7 +1790,7 @@
__ CheckMap(input, scratch, Heap::kHeapNumberMapRootIndex, fail,
DONT_DO_SMI_CHECK);
}
- // We could be strict about symbol/string here, but as long as
+ // We could be strict about internalized/string here, but as long as
// hydrogen doesn't care, the stub doesn't have to care either.
__ bind(&ok);
}
@@ -1902,25 +1903,28 @@
EmitStrictTwoHeapObjectCompare(masm, lhs, rhs);
}
- Label check_for_symbols;
+ Label check_for_internalized_strings;
Label flat_string_check;
// Check for heap-number-heap-number comparison. Can jump to slow case,
// or load both doubles and jump to the code that handles
- // that case. If the inputs are not doubles then jumps to
check_for_symbols.
+ // that case. If the inputs are not doubles then jumps to
+ // check_for_internalized_strings.
// In this case a2 will contain the type of lhs_.
EmitCheckForTwoHeapNumbers(masm,
lhs,
rhs,
&both_loaded_as_doubles,
- &check_for_symbols,
+ &check_for_internalized_strings,
&flat_string_check);
- __ bind(&check_for_symbols);
+ __ bind(&check_for_internalized_strings);
if (cc == eq && !strict()) {
- // Returns an answer for two symbols or two detectable objects.
+ // Returns an answer for two internalized strings or two
+ // detectable objects.
// Otherwise jumps to string case or not both strings case.
// Assumes that a2 is the type of lhs_ on entry.
- EmitCheckForSymbolsOrObjects(masm, lhs, rhs, &flat_string_check,
&slow);
+ EmitCheckForInternalizedStringsOrObjects(
+ masm, lhs, rhs, &flat_string_check, &slow);
}
// Check for both being sequential ASCII strings, and inline if that is
the
@@ -4534,7 +4538,7 @@
// -- a1 : receiver
// -----------------------------------
__ Branch(&miss, ne, a0,
- Operand(masm->isolate()->factory()->length_symbol()));
+ Operand(masm->isolate()->factory()->length_string()));
receiver = a1;
} else {
ASSERT(kind() == Code::LOAD_IC);
@@ -4563,7 +4567,7 @@
// -- a1 : receiver
// -----------------------------------
__ Branch(&miss, ne, a0,
- Operand(masm->isolate()->factory()->prototype_symbol()));
+ Operand(masm->isolate()->factory()->prototype_string()));
receiver = a1;
} else {
ASSERT(kind() == Code::LOAD_IC);
@@ -4592,7 +4596,7 @@
// -- a1 : receiver
// -----------------------------------
__ Branch(&miss, ne, a0,
- Operand(masm->isolate()->factory()->length_symbol()));
+ Operand(masm->isolate()->factory()->length_string()));
receiver = a1;
} else {
ASSERT(kind() == Code::LOAD_IC);
@@ -4630,7 +4634,7 @@
// -- a2 : receiver
// -----------------------------------
__ Branch(&miss, ne, a1,
- Operand(masm->isolate()->factory()->length_symbol()));
+ Operand(masm->isolate()->factory()->length_string()));
receiver = a2;
value = a0;
} else {
@@ -5224,7 +5228,7 @@
// (3) Cons string. Check that it's flat.
// Replace subject with first string and reload instance type.
__ lw(a0, FieldMemOperand(subject, ConsString::kSecondOffset));
- __ LoadRoot(a1, Heap::kEmptyStringRootIndex);
+ __ LoadRoot(a1, Heap::kempty_stringRootIndex);
__ Branch(&runtime, ne, a0, Operand(a1));
__ lw(subject, FieldMemOperand(subject, ConsString::kFirstOffset));
@@ -6102,7 +6106,7 @@
Register scratch = scratch3;
// Make sure that both characters are not digits as such strings has a
- // different hash algorithm. Don't try to look for these in the symbol
table.
+ // different hash algorithm. Don't try to look for these in the string
table.
Label not_array_index;
__ Subu(scratch, c1, Operand(static_cast<int>('0')));
__ Branch(¬_array_index,
@@ -6137,21 +6141,21 @@
// chars: two character string, char 1 in byte 0 and char 2 in byte 1.
// hash: hash of two character string.
- // Load symbol table.
- // Load address of first element of the symbol table.
+ // Load string table.
+ // Load address of first element of the string table.
Register string_table = c2;
__ LoadRoot(string_table, Heap::kStringTableRootIndex);
Register undefined = scratch4;
__ LoadRoot(undefined, Heap::kUndefinedValueRootIndex);
- // Calculate capacity mask from the symbol table capacity.
+ // Calculate capacity mask from the string table capacity.
Register mask = scratch2;
__ lw(mask, FieldMemOperand(string_table, StringTable::kCapacityOffset));
__ sra(mask, mask, 1);
__ Addu(mask, mask, -1);
- // Calculate untagged address of the first element of the symbol table.
+ // Calculate untagged address of the first element of the string table.
Register first_string_table_element = string_table;
__ Addu(first_string_table_element, string_table,
Operand(StringTable::kElementsStartOffset - kHeapObjectTag));
@@ -6161,17 +6165,17 @@
// hash: hash of two character string
// mask: capacity mask
// first_string_table_element: address of the first element of
- // the symbol table
+ // the string table
// undefined: the undefined object
// scratch: -
- // Perform a number of probes in the symbol table.
+ // Perform a number of probes in the string table.
const int kProbes = 4;
Label found_in_string_table;
Label next_probe[kProbes];
Register candidate = scratch5; // Scratch register contains candidate.
for (int i = 0; i < kProbes; i++) {
- // Calculate entry in symbol table.
+ // Calculate entry in string table.
if (i > 0) {
__ Addu(candidate, hash, Operand(StringTable::GetProbeOffset(i)));
} else {
@@ -6195,7 +6199,7 @@
// Must be the hole (deleted entry).
if (FLAG_debug_code) {
__ LoadRoot(scratch, Heap::kTheHoleValueRootIndex);
- __ Assert(eq, "oddball in symbol table is not undefined or the hole",
+ __ Assert(eq, "oddball in string table is not undefined or the hole",
scratch, Operand(candidate));
}
__ jmp(&next_probe[i]);
@@ -6356,7 +6360,7 @@
__ Branch(&sliced_string, ne, t0, Operand(zero_reg));
// Cons string. Check whether it is flat, then fetch first part.
__ lw(t1, FieldMemOperand(v0, ConsString::kSecondOffset));
- __ LoadRoot(t0, Heap::kEmptyStringRootIndex);
+ __ LoadRoot(t0, Heap::kempty_stringRootIndex);
__ Branch(&runtime, ne, t1, Operand(t0));
__ lw(t1, FieldMemOperand(v0, ConsString::kFirstOffset));
// Update instance type.
@@ -6739,8 +6743,8 @@
// Adding two lengths can't overflow.
STATIC_ASSERT(String::kMaxLength < String::kMaxLength * 2);
__ Addu(t2, a2, Operand(a3));
- // Use the symbol table when adding two one character strings, as it
- // helps later optimizations to return a symbol here.
+ // Use the string table when adding two one character strings, as it
+ // helps later optimizations to return a string here.
__ Branch(&longer_than_two, ne, t2, Operand(2));
// Check that both strings are non-external ASCII strings.
@@ -6757,7 +6761,7 @@
__ lbu(a2, FieldMemOperand(a0, SeqOneByteString::kHeaderSize));
__ lbu(a3, FieldMemOperand(a1, SeqOneByteString::kHeaderSize));
- // Try to lookup two character string in symbol table. If it is not found
+ // Try to lookup two character string in string table. If it is not found
// just allocate a new one.
Label make_two_character_string;
StringHelper::GenerateTwoCharacterStringTableProbe(
@@ -7102,7 +7106,7 @@
}
-void ICCompareStub::GenerateSymbols(MacroAssembler* masm) {
+void ICCompareStub::GenerateInternalizedStrings(MacroAssembler* masm) {
ASSERT(state_ == CompareIC::SYMBOL);
Label miss;
@@ -7115,14 +7119,14 @@
// Check that both operands are heap objects.
__ JumpIfEitherSmi(left, right, &miss);
- // Check that both operands are symbols.
+ // Check that both operands are internalized strings.
__ lw(tmp1, FieldMemOperand(left, HeapObject::kMapOffset));
__ lw(tmp2, FieldMemOperand(right, HeapObject::kMapOffset));
__ lbu(tmp1, FieldMemOperand(tmp1, Map::kInstanceTypeOffset));
__ lbu(tmp2, FieldMemOperand(tmp2, Map::kInstanceTypeOffset));
- STATIC_ASSERT(kSymbolTag != 0);
+ STATIC_ASSERT(kInternalizedTag != 0);
__ And(tmp1, tmp1, Operand(tmp2));
- __ And(tmp1, tmp1, kIsSymbolMask);
+ __ And(tmp1, tmp1, kIsInternalizedMask);
__ Branch(&miss, eq, tmp1, Operand(zero_reg));
// Make sure a0 is non-zero. At this point input operands are
// guaranteed to be non-zero.
@@ -7130,7 +7134,7 @@
STATIC_ASSERT(EQUAL == 0);
STATIC_ASSERT(kSmiTag == 0);
__ mov(v0, right);
- // Symbols are compared by identity.
+ // Internalized strings are compared by identity.
__ Ret(ne, left, Operand(right));
__ li(v0, Operand(Smi::FromInt(EQUAL)));
__ Ret();
@@ -7180,13 +7184,13 @@
// Handle not identical strings.
- // Check that both strings are symbols. If they are, we're done
+ // Check that both strings are internalized strings. If they are, we're
done
// because we already know they are not identical.
if (equality) {
ASSERT(GetCondition() == eq);
- STATIC_ASSERT(kSymbolTag != 0);
+ STATIC_ASSERT(kInternalizedTag != 0);
__ And(tmp3, tmp1, Operand(tmp2));
- __ And(tmp5, tmp3, Operand(kIsSymbolMask));
+ __ And(tmp5, tmp3, Operand(kIsInternalizedMask));
Label is_symbol;
__ Branch(&is_symbol, eq, tmp5, Operand(zero_reg));
// Make sure a0 is non-zero. At this point input operands are
@@ -7389,11 +7393,11 @@
Label the_hole;
__ Branch(&the_hole, eq, entity_name, Operand(tmp));
- // Check if the entry name is not a symbol.
+ // Check if the entry name is not a internalized string.
__ lw(entity_name, FieldMemOperand(entity_name,
HeapObject::kMapOffset));
__ lbu(entity_name,
FieldMemOperand(entity_name, Map::kInstanceTypeOffset));
- __ And(scratch0, entity_name, Operand(kIsSymbolMask));
+ __ And(scratch0, entity_name, Operand(kIsInternalizedMask));
__ Branch(miss, eq, scratch0, Operand(zero_reg));
__ bind(&the_hole);
@@ -7569,11 +7573,11 @@
__ Branch(&in_dictionary, eq, entry_key, Operand(key));
if (i != kTotalProbes - 1 && mode_ == NEGATIVE_LOOKUP) {
- // Check if the entry name is not a symbol.
+ // Check if the entry name is not a internalized string.
__ lw(entry_key, FieldMemOperand(entry_key, HeapObject::kMapOffset));
__ lbu(entry_key,
FieldMemOperand(entry_key, Map::kInstanceTypeOffset));
- __ And(result, entry_key, Operand(kIsSymbolMask));
+ __ And(result, entry_key, Operand(kIsInternalizedMask));
__ Branch(&maybe_in_dictionary, eq, result, Operand(zero_reg));
}
}
=======================================
--- /branches/bleeding_edge/src/mips/code-stubs-mips.h Thu Feb 28 09:03:34
2013
+++ /branches/bleeding_edge/src/mips/code-stubs-mips.h Mon Mar 4 06:45:39
2013
@@ -173,9 +173,9 @@
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
- // 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.
// 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
=======================================
--- /branches/bleeding_edge/src/mips/codegen-mips.cc Wed Feb 20 05:12:26
2013
+++ /branches/bleeding_edge/src/mips/codegen-mips.cc Mon Mar 4 06:45:39
2013
@@ -475,7 +475,7 @@
// the string.
__ bind(&cons_string);
__ lw(result, FieldMemOperand(string, ConsString::kSecondOffset));
- __ LoadRoot(at, Heap::kEmptyStringRootIndex);
+ __ LoadRoot(at, Heap::kempty_stringRootIndex);
__ Branch(call_runtime, ne, result, Operand(at));
// Get the first of the two strings and load its instance type.
__ lw(string, FieldMemOperand(string, ConsString::kFirstOffset));
=======================================
--- /branches/bleeding_edge/src/mips/full-codegen-mips.cc Mon Mar 4
06:23:30 2013
+++ /branches/bleeding_edge/src/mips/full-codegen-mips.cc Mon Mar 4
06:45:39 2013
@@ -1638,7 +1638,7 @@
ASSERT(!CompileTimeValue::IsCompileTimeValue(property->value()));
// Fall through.
case ObjectLiteral::Property::COMPUTED:
- if (key->handle()->IsSymbol()) {
+ if (key->handle()->IsInternalizedString()) {
if (property->emit_store()) {
VisitForAccumulatorValue(value);
__ mov(a0, result_register());
@@ -2711,7 +2711,7 @@
__ LoadRoot(t0, Heap::kHashTableMapRootIndex);
__ 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
// transition that shares its descriptor array, this is a false positive.
Label entry, loop, done;
@@ -2736,10 +2736,10 @@
__ Addu(a2, a2, t1);
// Loop through all the keys in the descriptor array. If one of these is
the
- // symbol valueOf the result is false.
- // The use of t2 to store the valueOf symbol asumes that it is not
otherwise
+ // string "valueOf" the result is false.
+ // The use of t2 to store the valueOf string assumes that it is not
otherwise
// used in the loop below.
- __ LoadRoot(t2, Heap::kvalue_of_symbolRootIndex);
+ __ li(t2, Operand(FACTORY->value_of_string()));
__ jmp(&entry);
__ bind(&loop);
__ lw(a3, MemOperand(t0, 0));
@@ -2970,12 +2970,12 @@
// Functions have class 'Function'.
__ bind(&function);
- __ LoadRoot(v0, Heap::kfunction_class_symbolRootIndex);
+ __ LoadRoot(v0, Heap::kfunction_class_stringRootIndex);
__ jmp(&done);
// Objects with a non-function constructor have class 'Object'.
__ bind(&non_function_constructor);
- __ LoadRoot(v0, Heap::kObject_symbolRootIndex);
+ __ LoadRoot(v0, Heap::kObject_stringRootIndex);
__ jmp(&done);
// Non-JS objects have class null.
@@ -3345,7 +3345,7 @@
__ bind(&index_out_of_range);
// When the index is out of range, the spec requires us to return
// the empty string.
- __ LoadRoot(result, Heap::kEmptyStringRootIndex);
+ __ LoadRoot(result, Heap::kempty_stringRootIndex);
__ jmp(&done);
__ bind(&need_conversion);
@@ -3660,7 +3660,7 @@
__ lw(array_length, FieldMemOperand(array, JSArray::kLengthOffset));
__ SmiUntag(array_length);
__ Branch(&non_trivial_array, ne, array_length, Operand(zero_reg));
- __ LoadRoot(v0, Heap::kEmptyStringRootIndex);
+ __ LoadRoot(v0, Heap::kempty_stringRootIndex);
__ Branch(&done);
__ bind(&non_trivial_array);
@@ -4275,12 +4275,12 @@
}
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);
__ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset));
__ LoadRoot(at, Heap::kHeapNumberMapRootIndex);
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);
// Check for undetectable objects => false.
__ GetObjectType(v0, v0, a1);
@@ -4289,16 +4289,16 @@
__ And(a1, a1, Operand(1 << Map::kIsUndetectable));
Split(eq, a1, Operand(zero_reg),
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);
__ Branch(if_true, eq, v0, Operand(at));
__ LoadRoot(at, Heap::kFalseValueRootIndex);
Split(eq, v0, Operand(at), if_true, if_false, fall_through);
} else if (FLAG_harmony_typeof &&
- check->Equals(isolate()->heap()->null_symbol())) {
+ check->Equals(isolate()->heap()->null_string())) {
__ LoadRoot(at, Heap::kNullValueRootIndex);
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);
__ Branch(if_true, eq, v0, Operand(at));
__ JumpIfSmi(v0, if_false);
@@ -4307,14 +4307,14 @@
__ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
__ And(a1, a1, Operand(1 << Map::kIsUndetectable));
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);
STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
__ GetObjectType(v0, v0, a1);
__ Branch(if_true, eq, a1, Operand(JS_FUNCTION_TYPE));
Split(eq, a1, Operand(JS_FUNCTION_PROXY_TYPE),
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);
if (!FLAG_harmony_typeof) {
__ LoadRoot(at, Heap::kNullValueRootIndex);
=======================================
--- /branches/bleeding_edge/src/mips/ic-mips.cc Mon Jan 28 05:37:32 2013
+++ /branches/bleeding_edge/src/mips/ic-mips.cc Mon Mar 4 06:45:39 2013
@@ -305,30 +305,30 @@
}
-// Checks whether a key is an array index string or a symbol string.
-// Falls through if a key is a symbol.
+// Checks whether a key is an array index string or an internalized string.
+// Falls through if a key is an internalized string.
static void GenerateKeyStringCheck(MacroAssembler* masm,
Register key,
Register map,
Register hash,
Label* index_string,
- Label* not_symbol) {
+ Label* not_internalized) {
// The key is not a smi.
// Is it a string?
__ 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?
__ lw(hash, FieldMemOperand(key, String::kHashFieldOffset));
__ And(at, hash, Operand(String::kContainsCachedArrayIndexMask));
__ Branch(index_string, eq, at, Operand(zero_reg));
- // Is the string a symbol?
+ // Is the string internalized?
// map: key map
__ lbu(hash, FieldMemOperand(map, Map::kInstanceTypeOffset));
- STATIC_ASSERT(kSymbolTag != 0);
- __ And(at, hash, Operand(kIsSymbolMask));
- __ Branch(not_symbol, eq, at, Operand(zero_reg));
+ STATIC_ASSERT(kInternalizedTag != 0);
+ __ And(at, hash, Operand(kIsInternalizedMask));
+ __ Branch(not_internalized, eq, at, Operand(zero_reg));
}
@@ -583,7 +583,7 @@
__ bind(&check_string);
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
// a quick inline probe of the receiver's dictionary.
// Otherwise do the monomorphic cache probe.
@@ -610,7 +610,7 @@
__ bind(&slow_call);
// This branch is taken if:
// - 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,
// - there is hope that the runtime will create a monomorphic call stub,
// that will get fetched next time.
@@ -991,7 +991,7 @@
int mask = KeyedLookupCache::kCapacityMask & KeyedLookupCache::kHashMask;
__ 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.
Label load_in_object_property;
static const int kEntriesPerBucket = KeyedLookupCache::kEntriesPerBucket;
=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Mon Mar 4
06:26:30 2013
+++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Mon Mar 4
06:45:39 2013
@@ -2327,12 +2327,12 @@
__ lw(temp, FieldMemOperand(temp,
JSFunction::kSharedFunctionInfoOffset));
__ lw(temp, FieldMemOperand(temp,
SharedFunctionInfo::kInstanceClassNameOffset));
- // The class name we are testing against is a symbol because it's a
literal.
- // The name in the constructor is a symbol because of the way the
context is
- // booted. This routine isn't expected to work for random API-created
+ // The class name we are testing against is internalized since it's a
literal.
+ // The name in the constructor is internalized because of the way the
context
+ // 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
- // syntax. Since both sides are symbols it is sufficient to use an
identity
- // comparison.
+ // syntax. Since both sides are internalized it is sufficient to use an
+ // identity comparison.
// 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.
@@ -5720,7 +5720,7 @@
// register.
Condition final_branch_condition = kNoCondition;
Register scratch = scratch0();
- if (type_name->Equals(heap()->number_symbol())) {
+ if (type_name->Equals(heap()->number_string())) {
__ JumpIfSmi(input, true_label);
__ lw(input, FieldMemOperand(input, HeapObject::kMapOffset));
__ LoadRoot(at, Heap::kHeapNumberMapRootIndex);
@@ -5728,7 +5728,7 @@
cmp2 = Operand(at);
final_branch_condition = eq;
- } else if (type_name->Equals(heap()->string_symbol())) {
+ } else if (type_name->Equals(heap()->string_string())) {
__ JumpIfSmi(input, false_label);
__ GetObjectType(input, input, scratch);
__ Branch(USE_DELAY_SLOT, false_label,
@@ -5741,7 +5741,7 @@
cmp2 = Operand(zero_reg);
final_branch_condition = eq;
- } else if (type_name->Equals(heap()->boolean_symbol())) {
+ } else if (type_name->Equals(heap()->boolean_string())) {
__ LoadRoot(at, Heap::kTrueValueRootIndex);
__ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input));
__ LoadRoot(at, Heap::kFalseValueRootIndex);
@@ -5749,13 +5749,13 @@
cmp2 = Operand(input);
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);
cmp1 = at;
cmp2 = Operand(input);
final_branch_condition = eq;
- } else if (type_name->Equals(heap()->undefined_symbol())) {
+ } else if (type_name->Equals(heap()->undefined_string())) {
__ LoadRoot(at, Heap::kUndefinedValueRootIndex);
__ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input));
// The first instruction of JumpIfSmi is an And - it is safe in the
delay
@@ -5769,7 +5769,7 @@
cmp2 = Operand(zero_reg);
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);
__ JumpIfSmi(input, false_label);
__ GetObjectType(input, scratch, input);
@@ -5778,7 +5778,7 @@
cmp2 = Operand(JS_FUNCTION_PROXY_TYPE);
final_branch_condition = eq;
- } else if (type_name->Equals(heap()->object_symbol())) {
+ } else if (type_name->Equals(heap()->object_string())) {
__ JumpIfSmi(input, false_label);
if (!FLAG_harmony_typeof) {
__ LoadRoot(at, Heap::kNullValueRootIndex);
=======================================
--- /branches/bleeding_edge/src/mips/stub-cache-mips.cc Mon Mar 4 06:29:40
2013
+++ /branches/bleeding_edge/src/mips/stub-cache-mips.cc Mon Mar 4 06:45:39
2013
@@ -121,14 +121,14 @@
// 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 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,
Label* miss_label,
Register receiver,
Handle<String> name,
Register scratch0,
Register scratch1) {
- ASSERT(name->IsSymbol());
+ ASSERT(name->IsInternalizedString());
Counters* counters = masm->isolate()->counters();
__ IncrementCounter(counters->negative_lookups(), 1, scratch0, scratch1);
__ IncrementCounter(counters->negative_lookups_miss(), 1, scratch0,
scratch1);
@@ -1103,7 +1103,7 @@
if (!current->HasFastProperties() &&
!current->IsJSGlobalObject() &&
!current->IsJSGlobalProxy()) {
- if (!name->IsSymbol()) {
+ if (!name->IsInternalizedString()) {
name = factory()->InternalizeString(name);
}
ASSERT(current->property_dictionary()->FindEntry(*name) ==
@@ -2001,7 +2001,7 @@
if (index_out_of_range.is_linked()) {
__ bind(&index_out_of_range);
- __ LoadRoot(v0, Heap::kEmptyStringRootIndex);
+ __ LoadRoot(v0, Heap::kempty_stringRootIndex);
__ Drop(argc + 1);
__ Ret();
}
@@ -2420,7 +2420,7 @@
break;
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);
__ Branch(&miss, Ugreater_equal, a3, Operand(FIRST_NONSTRING_TYPE));
// Check that the maps starting from the prototype haven't changed.
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.