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

Side by Side Diff: src/x64/full-codegen-x64.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/x64/codegen-x64.cc ('k') | src/x64/ic-x64.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 2579 matching lines...) Expand 10 before | Expand all | Expand 10 after
2590 __ Move(rax, Factory::false_value()); 2590 __ Move(rax, Factory::false_value());
2591 __ jmp(&done); 2591 __ jmp(&done);
2592 __ bind(&ok); 2592 __ bind(&ok);
2593 __ Move(rax, Factory::true_value()); 2593 __ Move(rax, Factory::true_value());
2594 __ bind(&done); 2594 __ bind(&done);
2595 2595
2596 Apply(context_, rax); 2596 Apply(context_, rax);
2597 } 2597 }
2598 2598
2599 2599
2600 void FullCodeGenerator::EmitHasCachedArrayIndex(ZoneList<Expression*>* args) {
2601 ASSERT(args->length() == 1);
2602
2603 VisitForValue(args->at(0), kAccumulator);
2604
2605 Label materialize_true, materialize_false;
2606 Label* if_true = NULL;
2607 Label* if_false = NULL;
2608 Label* fall_through = NULL;
2609 PrepareTest(&materialize_true, &materialize_false,
2610 &if_true, &if_false, &fall_through);
2611
2612 __ testl(FieldOperand(rax, String::kHashFieldOffset),
2613 Immediate(String::kContainsCachedArrayIndexMask));
2614 __ j(zero, if_true);
2615 __ jmp(if_false);
2616
2617 Apply(context_, if_true, if_false);
2618 }
2619
2620
2621 void FullCodeGenerator::EmitGetCachedArrayIndex(ZoneList<Expression*>* args) {
2622 ASSERT(args->length() == 1);
2623
2624 VisitForValue(args->at(0), kAccumulator);
2625
2626 __ movl(rax, FieldOperand(rax, String::kHashFieldOffset));
2627 ASSERT(String::kHashShift >= kSmiTagSize);
2628 __ IndexFromHash(rax, rax);
2629
2630 Apply(context_, rax);
2631 }
2632
2633
2600 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { 2634 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
2601 Handle<String> name = expr->name(); 2635 Handle<String> name = expr->name();
2602 if (name->length() > 0 && name->Get(0) == '_') { 2636 if (name->length() > 0 && name->Get(0) == '_') {
2603 Comment cmnt(masm_, "[ InlineRuntimeCall"); 2637 Comment cmnt(masm_, "[ InlineRuntimeCall");
2604 EmitInlineRuntimeCall(expr); 2638 EmitInlineRuntimeCall(expr);
2605 return; 2639 return;
2606 } 2640 }
2607 2641
2608 Comment cmnt(masm_, "[ CallRuntime"); 2642 Comment cmnt(masm_, "[ CallRuntime");
2609 ZoneList<Expression*>* args = expr->arguments(); 2643 ZoneList<Expression*>* args = expr->arguments();
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
3246 __ ret(0); 3280 __ ret(0);
3247 } 3281 }
3248 3282
3249 3283
3250 #undef __ 3284 #undef __
3251 3285
3252 3286
3253 } } // namespace v8::internal 3287 } } // namespace v8::internal
3254 3288
3255 #endif // V8_TARGET_ARCH_X64 3289 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | src/x64/ic-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698