OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4640 // A monomorphic cache hit or an already megamorphic state: invoke the | 4640 // A monomorphic cache hit or an already megamorphic state: invoke the |
4641 // function without changing the state. | 4641 // function without changing the state. |
4642 __ cmp(r3, r1); | 4642 __ cmp(r3, r1); |
4643 __ b(eq, &done); | 4643 __ b(eq, &done); |
4644 __ CompareRoot(r3, Heap::kUndefinedValueRootIndex); | 4644 __ CompareRoot(r3, Heap::kUndefinedValueRootIndex); |
4645 __ b(eq, &done); | 4645 __ b(eq, &done); |
4646 | 4646 |
4647 // Special handling of the Array() function, which caches not only the | 4647 // Special handling of the Array() function, which caches not only the |
4648 // monomorphic Array function but the initial ElementsKind with special | 4648 // monomorphic Array function but the initial ElementsKind with special |
4649 // sentinels | 4649 // sentinels |
4650 Handle<Object> terminal_kind_sentinel = | |
4651 TypeFeedbackCells::MonomorphicArraySentinel(masm->isolate(), | |
4652 LAST_FAST_ELEMENTS_KIND); | |
4653 __ JumpIfNotSmi(r3, &miss); | 4650 __ JumpIfNotSmi(r3, &miss); |
4654 __ cmp(r3, Operand(terminal_kind_sentinel)); | |
4655 __ b(gt, &miss); | |
4656 // Make sure the function is the Array() function | 4651 // Make sure the function is the Array() function |
4657 __ LoadArrayFunction(r3); | 4652 __ LoadArrayFunction(r3); |
4658 __ cmp(r1, r3); | 4653 __ cmp(r1, r3); |
4659 __ b(ne, &megamorphic); | 4654 __ b(ne, &megamorphic); |
4660 __ jmp(&done); | 4655 __ jmp(&done); |
4661 | 4656 |
4662 __ bind(&miss); | 4657 __ bind(&miss); |
4663 | 4658 |
4664 // A monomorphic miss (i.e, here the cache is not uninitialized) goes | 4659 // A monomorphic miss (i.e, here the cache is not uninitialized) goes |
4665 // megamorphic. | 4660 // megamorphic. |
(...skipping 2519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7185 __ ldr(r5, MemOperand(sp, 0)); | 7180 __ ldr(r5, MemOperand(sp, 0)); |
7186 __ cmp(r5, Operand::Zero()); | 7181 __ cmp(r5, Operand::Zero()); |
7187 __ b(eq, &normal_sequence); | 7182 __ b(eq, &normal_sequence); |
7188 | 7183 |
7189 // We are going to create a holey array, but our kind is non-holey. | 7184 // We are going to create a holey array, but our kind is non-holey. |
7190 // Fix kind and retry | 7185 // Fix kind and retry |
7191 __ add(r3, r3, Operand(1)); | 7186 __ add(r3, r3, Operand(1)); |
7192 __ cmp(r2, Operand(undefined_sentinel)); | 7187 __ cmp(r2, Operand(undefined_sentinel)); |
7193 __ b(eq, &normal_sequence); | 7188 __ b(eq, &normal_sequence); |
7194 | 7189 |
| 7190 // The type cell may have gone megamorphic, don't overwrite if so |
| 7191 __ ldr(r5, FieldMemOperand(r2, kPointerSize)); |
| 7192 __ JumpIfNotSmi(r5, &normal_sequence); |
| 7193 |
7195 // Save the resulting elements kind in type info | 7194 // Save the resulting elements kind in type info |
7196 __ SmiTag(r3); | 7195 __ SmiTag(r3); |
7197 __ str(r3, FieldMemOperand(r2, kPointerSize)); | 7196 __ str(r3, FieldMemOperand(r2, kPointerSize)); |
7198 __ SmiUntag(r3); | 7197 __ SmiUntag(r3); |
7199 | 7198 |
7200 __ bind(&normal_sequence); | 7199 __ bind(&normal_sequence); |
7201 int last_index = GetSequenceIndexFromFastElementsKind( | 7200 int last_index = GetSequenceIndexFromFastElementsKind( |
7202 TERMINAL_FAST_ELEMENTS_KIND); | 7201 TERMINAL_FAST_ELEMENTS_KIND); |
7203 for (int i = 0; i <= last_index; ++i) { | 7202 for (int i = 0; i <= last_index; ++i) { |
7204 Label next; | 7203 Label next; |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7411 __ bind(&fast_elements_case); | 7410 __ bind(&fast_elements_case); |
7412 GenerateCase(masm, FAST_ELEMENTS); | 7411 GenerateCase(masm, FAST_ELEMENTS); |
7413 } | 7412 } |
7414 | 7413 |
7415 | 7414 |
7416 #undef __ | 7415 #undef __ |
7417 | 7416 |
7418 } } // namespace v8::internal | 7417 } } // namespace v8::internal |
7419 | 7418 |
7420 #endif // V8_TARGET_ARCH_ARM | 7419 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |