| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 2300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2311 HInstruction* HGraphBuilder::AddElementAccess( | 2311 HInstruction* HGraphBuilder::AddElementAccess( |
| 2312 HValue* elements, | 2312 HValue* elements, |
| 2313 HValue* checked_key, | 2313 HValue* checked_key, |
| 2314 HValue* val, | 2314 HValue* val, |
| 2315 HValue* dependency, | 2315 HValue* dependency, |
| 2316 ElementsKind elements_kind, | 2316 ElementsKind elements_kind, |
| 2317 bool is_store, | 2317 bool is_store, |
| 2318 LoadKeyedHoleMode load_mode) { | 2318 LoadKeyedHoleMode load_mode) { |
| 2319 if (is_store) { | 2319 if (is_store) { |
| 2320 ASSERT(val != NULL); | 2320 ASSERT(val != NULL); |
| 2321 if (elements_kind == EXTERNAL_PIXEL_ELEMENTS || | 2321 if (elements_kind == EXTERNAL_UINT8_CLAMPED_ELEMENTS || |
| 2322 elements_kind == UINT8_CLAMPED_ELEMENTS) { | 2322 elements_kind == UINT8_CLAMPED_ELEMENTS) { |
| 2323 val = Add<HClampToUint8>(val); | 2323 val = Add<HClampToUint8>(val); |
| 2324 } | 2324 } |
| 2325 return Add<HStoreKeyed>(elements, checked_key, val, elements_kind, | 2325 return Add<HStoreKeyed>(elements, checked_key, val, elements_kind, |
| 2326 elements_kind == FAST_SMI_ELEMENTS | 2326 elements_kind == FAST_SMI_ELEMENTS |
| 2327 ? STORE_TO_INITIALIZED_ENTRY | 2327 ? STORE_TO_INITIALIZED_ENTRY |
| 2328 : INITIALIZING_STORE); | 2328 : INITIALIZING_STORE); |
| 2329 } | 2329 } |
| 2330 | 2330 |
| 2331 ASSERT(!is_store); | 2331 ASSERT(!is_store); |
| 2332 ASSERT(val == NULL); | 2332 ASSERT(val == NULL); |
| 2333 HLoadKeyed* load = Add<HLoadKeyed>( | 2333 HLoadKeyed* load = Add<HLoadKeyed>( |
| 2334 elements, checked_key, dependency, elements_kind, load_mode); | 2334 elements, checked_key, dependency, elements_kind, load_mode); |
| 2335 if (FLAG_opt_safe_uint32_operations && | 2335 if (FLAG_opt_safe_uint32_operations && |
| 2336 (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS || | 2336 (elements_kind == EXTERNAL_UINT32_ELEMENTS || |
| 2337 elements_kind == UINT32_ELEMENTS)) { | 2337 elements_kind == UINT32_ELEMENTS)) { |
| 2338 graph()->RecordUint32Instruction(load); | 2338 graph()->RecordUint32Instruction(load); |
| 2339 } | 2339 } |
| 2340 return load; | 2340 return load; |
| 2341 } | 2341 } |
| 2342 | 2342 |
| 2343 | 2343 |
| 2344 HLoadNamedField* HGraphBuilder::AddLoadElements(HValue* object) { | 2344 HLoadNamedField* HGraphBuilder::AddLoadElements(HValue* object) { |
| 2345 return Add<HLoadNamedField>(object, HObjectAccess::ForElementsPointer()); | 2345 return Add<HLoadNamedField>(object, HObjectAccess::ForElementsPointer()); |
| 2346 } | 2346 } |
| (...skipping 6036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8383 | 8383 |
| 8384 if (!is_zero_byte_offset) { | 8384 if (!is_zero_byte_offset) { |
| 8385 byte_offset_smi.If<HIsSmiAndBranch>(byte_offset); | 8385 byte_offset_smi.If<HIsSmiAndBranch>(byte_offset); |
| 8386 byte_offset_smi.Then(); | 8386 byte_offset_smi.Then(); |
| 8387 } | 8387 } |
| 8388 | 8388 |
| 8389 { // byte_offset is Smi. | 8389 { // byte_offset is Smi. |
| 8390 BuildArrayBufferViewInitialization<JSTypedArray>( | 8390 BuildArrayBufferViewInitialization<JSTypedArray>( |
| 8391 obj, buffer, byte_offset, byte_length); | 8391 obj, buffer, byte_offset, byte_length); |
| 8392 | 8392 |
| 8393 ExternalArrayType array_type = kExternalByteArray; // Bogus initialization. | 8393 ExternalArrayType array_type = kExternalInt8Array; // Bogus initialization. |
| 8394 size_t element_size = 1; // Bogus initialization. | 8394 size_t element_size = 1; // Bogus initialization. |
| 8395 Runtime::ArrayIdToTypeAndSize(array_id, &array_type, &element_size); | 8395 Runtime::ArrayIdToTypeAndSize(array_id, &array_type, &element_size); |
| 8396 | 8396 |
| 8397 HInstruction* length = AddUncasted<HDiv>(byte_length, | 8397 HInstruction* length = AddUncasted<HDiv>(byte_length, |
| 8398 Add<HConstant>(static_cast<int32_t>(element_size))); | 8398 Add<HConstant>(static_cast<int32_t>(element_size))); |
| 8399 | 8399 |
| 8400 Add<HStoreNamedField>(obj, | 8400 Add<HStoreNamedField>(obj, |
| 8401 HObjectAccess::ForJSTypedArrayLength(), | 8401 HObjectAccess::ForJSTypedArrayLength(), |
| 8402 length); | 8402 length); |
| 8403 | 8403 |
| (...skipping 2677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11081 if (ShouldProduceTraceOutput()) { | 11081 if (ShouldProduceTraceOutput()) { |
| 11082 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11082 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 11083 } | 11083 } |
| 11084 | 11084 |
| 11085 #ifdef DEBUG | 11085 #ifdef DEBUG |
| 11086 graph_->Verify(false); // No full verify. | 11086 graph_->Verify(false); // No full verify. |
| 11087 #endif | 11087 #endif |
| 11088 } | 11088 } |
| 11089 | 11089 |
| 11090 } } // namespace v8::internal | 11090 } } // namespace v8::internal |
| OLD | NEW |