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

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 3141022: Using array index hash code for string-to-number conversion. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/arm/ic-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2521 matching lines...) Expand 10 before | Expand all | Expand 10 after
2532 __ LoadRoot(r0, Heap::kFalseValueRootIndex); 2532 __ LoadRoot(r0, Heap::kFalseValueRootIndex);
2533 __ jmp(&done); 2533 __ jmp(&done);
2534 __ bind(&ok); 2534 __ bind(&ok);
2535 __ LoadRoot(r0, Heap::kTrueValueRootIndex); 2535 __ LoadRoot(r0, Heap::kTrueValueRootIndex);
2536 __ bind(&done); 2536 __ bind(&done);
2537 2537
2538 Apply(context_, r0); 2538 Apply(context_, r0);
2539 } 2539 }
2540 2540
2541 2541
2542 void FullCodeGenerator::EmitHasCachedArrayIndex(ZoneList<Expression*>* args) {
2543 VisitForValue(args->at(0), kAccumulator);
2544
2545 Label materialize_true, materialize_false;
2546 Label* if_true = NULL;
2547 Label* if_false = NULL;
2548 Label* fall_through = NULL;
2549 PrepareTest(&materialize_true, &materialize_false,
2550 &if_true, &if_false, &fall_through);
2551
2552 __ ldr(r0, FieldMemOperand(r0, String::kHashFieldOffset));
2553 __ tst(r0, Operand(String::kContainsCachedArrayIndexMask));
2554
2555 __ b(eq, if_true);
2556 __ b(if_false);
2557
2558 Apply(context_, if_true, if_false);
2559 }
2560
2561
2562 void FullCodeGenerator::EmitGetCachedArrayIndex(ZoneList<Expression*>* args) {
2563 ASSERT(args->length() == 1);
2564 VisitForValue(args->at(0), kAccumulator);
2565 __ ldr(r0, FieldMemOperand(r0, String::kHashFieldOffset));
2566 __ IndexFromHash(r0, r0);
2567 Apply(context_, r0);
2568 }
2569
2570
2542 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { 2571 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
2543 Handle<String> name = expr->name(); 2572 Handle<String> name = expr->name();
2544 if (name->length() > 0 && name->Get(0) == '_') { 2573 if (name->length() > 0 && name->Get(0) == '_') {
2545 Comment cmnt(masm_, "[ InlineRuntimeCall"); 2574 Comment cmnt(masm_, "[ InlineRuntimeCall");
2546 EmitInlineRuntimeCall(expr); 2575 EmitInlineRuntimeCall(expr);
2547 return; 2576 return;
2548 } 2577 }
2549 2578
2550 Comment cmnt(masm_, "[ CallRuntime"); 2579 Comment cmnt(masm_, "[ CallRuntime");
2551 ZoneList<Expression*>* args = expr->arguments(); 2580 ZoneList<Expression*>* args = expr->arguments();
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
3188 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. 3217 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value.
3189 __ add(pc, r1, Operand(masm_->CodeObject())); 3218 __ add(pc, r1, Operand(masm_->CodeObject()));
3190 } 3219 }
3191 3220
3192 3221
3193 #undef __ 3222 #undef __
3194 3223
3195 } } // namespace v8::internal 3224 } } // namespace v8::internal
3196 3225
3197 #endif // V8_TARGET_ARCH_ARM 3226 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/arm/ic-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698