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

Side by Side Diff: runtime/vm/flow_graph_builder.cc

Issue 10538064: Implement inlined LoadIndexed operation for arrays on x64. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.h » ('j') | runtime/vm/intermediate_language.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/flow_graph_builder.h" 5 #include "vm/flow_graph_builder.h"
6 6
7 #include "vm/ast_printer.h" 7 #include "vm/ast_printer.h"
8 #include "vm/bit_vector.h" 8 #include "vm/bit_vector.h"
9 #include "vm/code_descriptors.h" 9 #include "vm/code_descriptors.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after
1944 } 1944 }
1945 1945
1946 1946
1947 void EffectGraphVisitor::VisitLoadIndexedNode(LoadIndexedNode* node) { 1947 void EffectGraphVisitor::VisitLoadIndexedNode(LoadIndexedNode* node) {
1948 ValueGraphVisitor for_array(owner(), temp_index()); 1948 ValueGraphVisitor for_array(owner(), temp_index());
1949 node->array()->Visit(&for_array); 1949 node->array()->Visit(&for_array);
1950 Append(for_array); 1950 Append(for_array);
1951 ValueGraphVisitor for_index(owner(), for_array.temp_index()); 1951 ValueGraphVisitor for_index(owner(), for_array.temp_index());
1952 node->index_expr()->Visit(&for_index); 1952 node->index_expr()->Visit(&for_index);
1953 Append(for_index); 1953 Append(for_index);
1954 ZoneGrowableArray<Value*>* arguments = new ZoneGrowableArray<Value*>(2); 1954
1955 arguments->Add(for_array.value()); 1955 LoadIndexedComp* load = new LoadIndexedComp(
1956 arguments->Add(for_index.value()); 1956 node->token_index(),
1957 const String& name = 1957 owner()->try_index(),
1958 String::ZoneHandle(String::NewSymbol(Token::Str(Token::kINDEX))); 1958 for_array.value(),
1959 InstanceCallComp* call = new InstanceCallComp( 1959 for_index.value());
1960 node->token_index(), owner()->try_index(), name, 1960 ReturnComputation(load);
1961 arguments, Array::ZoneHandle(), 1);
1962 ReturnComputation(call);
1963 } 1961 }
1964 1962
1965 1963
1966 void EffectGraphVisitor::BuildStoreIndexedValues( 1964 void EffectGraphVisitor::BuildStoreIndexedValues(
1967 StoreIndexedNode* node, Value** array, Value** index, Value** value) { 1965 StoreIndexedNode* node, Value** array, Value** index, Value** value) {
1968 ValueGraphVisitor for_array(owner(), temp_index()); 1966 ValueGraphVisitor for_array(owner(), temp_index());
1969 node->array()->Visit(&for_array); 1967 node->array()->Visit(&for_array);
1970 Append(for_array); 1968 Append(for_array);
1971 ValueGraphVisitor for_index(owner(), for_array.temp_index()); 1969 ValueGraphVisitor for_index(owner(), for_array.temp_index());
1972 node->index_expr()->Visit(&for_index); 1970 node->index_expr()->Visit(&for_index);
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
2487 char* chars = reinterpret_cast<char*>( 2485 char* chars = reinterpret_cast<char*>(
2488 Isolate::Current()->current_zone()->Allocate(len)); 2486 Isolate::Current()->current_zone()->Allocate(len));
2489 OS::SNPrint(chars, len, kFormat, function_name, reason); 2487 OS::SNPrint(chars, len, kFormat, function_name, reason);
2490 const Error& error = Error::Handle( 2488 const Error& error = Error::Handle(
2491 LanguageError::New(String::Handle(String::New(chars)))); 2489 LanguageError::New(String::Handle(String::New(chars))));
2492 Isolate::Current()->long_jump_base()->Jump(1, error); 2490 Isolate::Current()->long_jump_base()->Jump(1, error);
2493 } 2491 }
2494 2492
2495 2493
2496 } // namespace dart 2494 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.h » ('j') | runtime/vm/intermediate_language.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698