42 using namespace v8::internal;
55 ASSERT(
string.length() > 0);
56 #ifdef V8_TARGET_ARCH_IA32
59 __ mov(
eax, Immediate(0));
60 __ mov(
ebx, Immediate(
string.at(0)));
62 for (
int i = 1; i <
string.length(); i++) {
63 __ mov(
ebx, Immediate(
string.at(i)));
70 #elif V8_TARGET_ARCH_X64
72 __ InitializeRootRegister();
75 __ movq(
rax, Immediate(0));
76 __ movq(
rbx, Immediate(
string.at(0)));
78 for (
int i = 1; i <
string.length(); i++) {
79 __ movq(
rbx, Immediate(
string.at(i)));
87 #elif V8_TARGET_ARCH_ARM
89 __ InitializeRootRegister();
91 __ mov(
r0, Operand(0));
92 __ mov(
ip, Operand(
string.at(0)));
94 for (
int i = 1; i <
string.length(); i++) {
95 __ mov(
ip, Operand(
string.at(i)));
101 #elif V8_TARGET_ARCH_MIPS
103 __ InitializeRootRegister();
105 __ li(v0, Operand(0));
106 __ li(t1, Operand(
string.at(0)));
108 for (
int i = 1; i <
string.length(); i++) {
109 __ li(t1, Operand(
string.at(i)));
121 #ifdef V8_TARGET_ARCH_IA32
123 __ mov(
eax, Immediate(key));
127 #elif V8_TARGET_ARCH_X64
129 __ InitializeRootRegister();
131 __ movq(
rax, Immediate(key));
136 #elif V8_TARGET_ARCH_ARM
138 __ InitializeRootRegister();
139 __ mov(
r0, Operand(key));
143 #elif V8_TARGET_ARCH_MIPS
145 __ InitializeRootRegister();
146 __ li(v0, Operand(key));
147 __ GetNumberHash(v0, t1);
168 CHECK(code->IsCode());
174 uint32_t codegen_hash =
177 uint32_t codegen_hash = hash();
179 uint32_t runtime_hash = v8_string->Hash();
180 CHECK(runtime_hash == codegen_hash);
197 CHECK(code->IsCode());
201 uint32_t codegen_hash =
204 uint32_t codegen_hash = hash();
209 Isolate::Current()->heap()->HashSeed());
210 CHECK(runtime_hash == codegen_hash);
220 static uint32_t PseudoRandom(uint32_t i, uint32_t j) {
221 return ~(~((i * 781) ^ (j * 329)));
229 if (a >=
'0' && a <=
'9')
continue;
231 if (b >=
'0' && b <=
'9')
continue;
247 for (uint32_t key = 0; key < 42; key += 7) {
252 static const uint32_t kLimit = 1000;
253 for (uint32_t i = 0; i < 5; i++) {
254 for (uint32_t j = 0; j < 5; j++) {
255 check(PseudoRandom(i, j) % kLimit);
static const int kMaxAsciiCharCode
static const int kEmptyHashField
static void GenerateHashGetHash(MacroAssembler *masm, Register hash)
uint32_t(* HASH_FUNCTION)()
#define ASSERT(condition)
static Code * cast(Object *obj)
const Register kRootRegister
void check_twochars(char a, char b)
void GetCode(CodeDesc *desc)
#define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4)
static void GenerateHashAddCharacter(MacroAssembler *masm, Register hash, Register character)
void generate(MacroAssembler *masm, i::Vector< const char > string)
uint32_t ComputeIntegerHash(uint32_t key, uint32_t seed)
static Flags ComputeFlags(Kind kind, InlineCacheState ic_state=UNINITIALIZED, ExtraICState extra_ic_state=kNoExtraICState, PropertyType type=NORMAL, int argc=-1, InlineCacheHolderFlag holder=OWN_MAP)
static Persistent< Context > New(ExtensionConfiguration *extensions=NULL, Handle< ObjectTemplate > global_template=Handle< ObjectTemplate >(), Handle< Value > global_object=Handle< Value >())
void check(i::Vector< const char > string)
static void GenerateHashInit(MacroAssembler *masm, Register hash, Register character)