| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 GenerateGlobalInstanceTypeCheck(masm, r0, miss); | 86 GenerateGlobalInstanceTypeCheck(masm, r0, miss); |
| 87 | 87 |
| 88 // Check for non-global object that requires access check. | 88 // Check for non-global object that requires access check. |
| 89 __ test_b(FieldOperand(r1, Map::kBitFieldOffset), | 89 __ test_b(FieldOperand(r1, Map::kBitFieldOffset), |
| 90 (1 << Map::kIsAccessCheckNeeded) | | 90 (1 << Map::kIsAccessCheckNeeded) | |
| 91 (1 << Map::kHasNamedInterceptor)); | 91 (1 << Map::kHasNamedInterceptor)); |
| 92 __ j(not_zero, miss); | 92 __ j(not_zero, miss); |
| 93 | 93 |
| 94 __ mov(r0, FieldOperand(receiver, JSObject::kPropertiesOffset)); | 94 __ mov(r0, FieldOperand(receiver, JSObject::kPropertiesOffset)); |
| 95 __ CheckMap(r0, FACTORY->hash_table_map(), miss, DONT_DO_SMI_CHECK); | 95 __ CheckMap(r0, masm->isolate()->factory()->hash_table_map(), miss, |
| 96 DONT_DO_SMI_CHECK); |
| 96 } | 97 } |
| 97 | 98 |
| 98 | 99 |
| 99 // Helper function used to load a property from a dictionary backing | 100 // Helper function used to load a property from a dictionary backing |
| 100 // storage. This function may fail to load a property even though it is | 101 // storage. This function may fail to load a property even though it is |
| 101 // in the dictionary, so code at miss_label must always call a backup | 102 // in the dictionary, so code at miss_label must always call a backup |
| 102 // property load that is complete. This function is safe to call if | 103 // property load that is complete. This function is safe to call if |
| 103 // name is not internalized, and will jump to the miss_label in that | 104 // name is not internalized, and will jump to the miss_label in that |
| 104 // case. The generated code assumes that the receiver has slow | 105 // case. The generated code assumes that the receiver has slow |
| 105 // properties, is not a global object and does not have interceptors. | 106 // properties, is not a global object and does not have interceptors. |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 // key - holds the key and is unchanged (must be a smi). | 264 // key - holds the key and is unchanged (must be a smi). |
| 264 // Scratch registers: | 265 // Scratch registers: |
| 265 // scratch - used to hold elements of the receiver and the loaded value. | 266 // scratch - used to hold elements of the receiver and the loaded value. |
| 266 // result - holds the result on exit if the load succeeds and | 267 // result - holds the result on exit if the load succeeds and |
| 267 // we fall through. | 268 // we fall through. |
| 268 | 269 |
| 269 __ mov(scratch, FieldOperand(receiver, JSObject::kElementsOffset)); | 270 __ mov(scratch, FieldOperand(receiver, JSObject::kElementsOffset)); |
| 270 if (not_fast_array != NULL) { | 271 if (not_fast_array != NULL) { |
| 271 // Check that the object is in fast mode and writable. | 272 // Check that the object is in fast mode and writable. |
| 272 __ CheckMap(scratch, | 273 __ CheckMap(scratch, |
| 273 FACTORY->fixed_array_map(), | 274 masm->isolate()->factory()->fixed_array_map(), |
| 274 not_fast_array, | 275 not_fast_array, |
| 275 DONT_DO_SMI_CHECK); | 276 DONT_DO_SMI_CHECK); |
| 276 } else { | 277 } else { |
| 277 __ AssertFastElements(scratch); | 278 __ AssertFastElements(scratch); |
| 278 } | 279 } |
| 279 // Check that the key (index) is within bounds. | 280 // Check that the key (index) is within bounds. |
| 280 __ cmp(key, FieldOperand(scratch, FixedArray::kLengthOffset)); | 281 __ cmp(key, FieldOperand(scratch, FixedArray::kLengthOffset)); |
| 281 __ j(above_equal, out_of_range); | 282 __ j(above_equal, out_of_range); |
| 282 // Fast case: Do the load. | 283 // Fast case: Do the load. |
| 283 STATIC_ASSERT((kPointerSize == 4) && (kSmiTagSize == 1) && (kSmiTag == 0)); | 284 STATIC_ASSERT((kPointerSize == 4) && (kSmiTagSize == 1) && (kSmiTag == 0)); |
| 284 __ mov(scratch, FieldOperand(scratch, key, times_2, FixedArray::kHeaderSize)); | 285 __ mov(scratch, FieldOperand(scratch, key, times_2, FixedArray::kHeaderSize)); |
| 285 __ cmp(scratch, Immediate(FACTORY->the_hole_value())); | 286 __ cmp(scratch, Immediate(masm->isolate()->factory()->the_hole_value())); |
| 286 // In case the loaded value is the_hole we have to consult GetProperty | 287 // In case the loaded value is the_hole we have to consult GetProperty |
| 287 // to ensure the prototype chain is searched. | 288 // to ensure the prototype chain is searched. |
| 288 __ j(equal, out_of_range); | 289 __ j(equal, out_of_range); |
| 289 if (!result.is(scratch)) { | 290 if (!result.is(scratch)) { |
| 290 __ mov(result, scratch); | 291 __ mov(result, scratch); |
| 291 } | 292 } |
| 292 } | 293 } |
| 293 | 294 |
| 294 | 295 |
| 295 // Checks whether a key is an array index string or a unique name. | 296 // Checks whether a key is an array index string or a unique name. |
| (...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1692 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) | 1693 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) |
| 1693 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 1694 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
| 1694 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 1695 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
| 1695 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1696 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
| 1696 } | 1697 } |
| 1697 | 1698 |
| 1698 | 1699 |
| 1699 } } // namespace v8::internal | 1700 } } // namespace v8::internal |
| 1700 | 1701 |
| 1701 #endif // V8_TARGET_ARCH_IA32 | 1702 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |