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

Side by Side Diff: src/hydrogen.cc

Issue 1248483007: Store offset between fixed typed array base and data start in object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 5 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
« no previous file with comments | « src/heap/heap.cc ('k') | src/hydrogen-instructions.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/hydrogen.h" 5 #include "src/hydrogen.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 2440 matching lines...) Expand 10 before | Expand all | Expand 10 after
2451 HValue* checked_key = NULL; 2451 HValue* checked_key = NULL;
2452 if (IsExternalArrayElementsKind(elements_kind) || 2452 if (IsExternalArrayElementsKind(elements_kind) ||
2453 IsFixedTypedArrayElementsKind(elements_kind)) { 2453 IsFixedTypedArrayElementsKind(elements_kind)) {
2454 checked_object = Add<HCheckArrayBufferNotNeutered>(checked_object); 2454 checked_object = Add<HCheckArrayBufferNotNeutered>(checked_object);
2455 2455
2456 HValue* backing_store; 2456 HValue* backing_store;
2457 if (IsExternalArrayElementsKind(elements_kind)) { 2457 if (IsExternalArrayElementsKind(elements_kind)) {
2458 backing_store = Add<HLoadNamedField>( 2458 backing_store = Add<HLoadNamedField>(
2459 elements, nullptr, HObjectAccess::ForExternalArrayExternalPointer()); 2459 elements, nullptr, HObjectAccess::ForExternalArrayExternalPointer());
2460 } else { 2460 } else {
2461 backing_store = elements; 2461 HValue* external_pointer = Add<HLoadNamedField>(
2462 elements, nullptr,
2463 HObjectAccess::ForFixedTypedArrayBaseExternalPointer());
2464 HValue* base_pointer = Add<HLoadNamedField>(
2465 elements, nullptr,
2466 HObjectAccess::ForFixedTypedArrayBaseBasePointer());
2467 backing_store = AddUncasted<HAdd>(external_pointer, base_pointer,
2468 Strength::WEAK, AddOfExternalAndTagged);
2462 } 2469 }
2463 if (store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS) { 2470 if (store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS) {
2464 NoObservableSideEffectsScope no_effects(this); 2471 NoObservableSideEffectsScope no_effects(this);
2465 IfBuilder length_checker(this); 2472 IfBuilder length_checker(this);
2466 length_checker.If<HCompareNumericAndBranch>(key, length, Token::LT); 2473 length_checker.If<HCompareNumericAndBranch>(key, length, Token::LT);
2467 length_checker.Then(); 2474 length_checker.Then();
2468 IfBuilder negative_checker(this); 2475 IfBuilder negative_checker(this);
2469 HValue* bounds_check = negative_checker.If<HCompareNumericAndBranch>( 2476 HValue* bounds_check = negative_checker.If<HCompareNumericAndBranch>(
2470 key, graph()->GetConstant0(), Token::GTE); 2477 key, graph()->GetConstant0(), Token::GTE);
2471 negative_checker.Then(); 2478 negative_checker.Then();
(...skipping 7540 matching lines...) Expand 10 before | Expand all | Expand 10 after
10012 #endif 10019 #endif
10013 10020
10014 AddStoreMapConstant(elements, fixed_typed_array_map); 10021 AddStoreMapConstant(elements, fixed_typed_array_map);
10015 10022
10016 Add<HStoreNamedField>(elements, 10023 Add<HStoreNamedField>(elements,
10017 HObjectAccess::ForFixedArrayLength(), 10024 HObjectAccess::ForFixedArrayLength(),
10018 length); 10025 length);
10019 Add<HStoreNamedField>( 10026 Add<HStoreNamedField>(
10020 elements, HObjectAccess::ForFixedTypedArrayBaseBasePointer(), elements); 10027 elements, HObjectAccess::ForFixedTypedArrayBaseBasePointer(), elements);
10021 10028
10029 Add<HStoreNamedField>(
10030 elements, HObjectAccess::ForFixedTypedArrayBaseExternalPointer(),
10031 Add<HConstant>(ExternalReference::fixed_typed_array_base_data_offset()));
10032
10022 HValue* filler = Add<HConstant>(static_cast<int32_t>(0)); 10033 HValue* filler = Add<HConstant>(static_cast<int32_t>(0));
10023 10034
10024 if (initialize) { 10035 if (initialize) {
10025 LoopBuilder builder(this, context(), LoopBuilder::kPostIncrement); 10036 LoopBuilder builder(this, context(), LoopBuilder::kPostIncrement);
10026 10037
10038 HValue* backing_store = AddUncasted<HAdd>(
10039 Add<HConstant>(ExternalReference::fixed_typed_array_base_data_offset()),
10040 elements, Strength::WEAK, AddOfExternalAndTagged);
10041
10027 HValue* key = builder.BeginBody( 10042 HValue* key = builder.BeginBody(
10028 Add<HConstant>(static_cast<int32_t>(0)), 10043 Add<HConstant>(static_cast<int32_t>(0)),
10029 length, Token::LT); 10044 length, Token::LT);
10030 Add<HStoreKeyed>(elements, key, filler, fixed_elements_kind); 10045 Add<HStoreKeyed>(backing_store, key, filler, fixed_elements_kind);
10031 10046
10032 builder.EndBody(); 10047 builder.EndBody();
10033 } 10048 }
10034 return elements; 10049 return elements;
10035 } 10050 }
10036 10051
10037 10052
10038 void HOptimizedGraphBuilder::GenerateTypedArrayInitialize( 10053 void HOptimizedGraphBuilder::GenerateTypedArrayInitialize(
10039 CallRuntime* expr) { 10054 CallRuntime* expr) {
10040 ZoneList<Expression*>* arguments = expr->arguments(); 10055 ZoneList<Expression*>* arguments = expr->arguments();
(...skipping 3279 matching lines...) Expand 10 before | Expand all | Expand 10 after
13320 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13335 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13321 } 13336 }
13322 13337
13323 #ifdef DEBUG 13338 #ifdef DEBUG
13324 graph_->Verify(false); // No full verify. 13339 graph_->Verify(false); // No full verify.
13325 #endif 13340 #endif
13326 } 13341 }
13327 13342
13328 } // namespace internal 13343 } // namespace internal
13329 } // namespace v8 13344 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698