OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |