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)
static Flags ComputeFlags(Kind kind, InlineCacheState ic_state=UNINITIALIZED, ExtraICState extra_ic_state=kNoExtraICState, StubType type=NORMAL, int argc=-1, InlineCacheHolderFlag holder=OWN_MAP)
#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 Persistent< Context > New(ExtensionConfiguration *extensions=NULL, Handle< ObjectTemplate > global_template=Handle< ObjectTemplate >(), Handle< Value > global_object=Handle< Value >())
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
void check(i::Vector< const char > string)
static void GenerateHashInit(MacroAssembler *masm, Register hash, Register character)