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

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

Issue 10908214: Revert "Whenever possible use length passed to the List constructor for bounds checks instead of lo… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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/intermediate_language.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/code_descriptors.h" 8 #include "vm/code_descriptors.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/flags.h" 10 #include "vm/flags.h"
(...skipping 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after
1680 node->type_arguments())); 1680 node->type_arguments()));
1681 arguments->Add(push_type_arguments); 1681 arguments->Add(push_type_arguments);
1682 ASSERT(arguments->length() == 1); 1682 ASSERT(arguments->length() == 1);
1683 BuildPushArguments(*node->arguments(), arguments); 1683 BuildPushArguments(*node->arguments(), arguments);
1684 StaticCallInstr* call = 1684 StaticCallInstr* call =
1685 new StaticCallInstr(node->token_pos(), 1685 new StaticCallInstr(node->token_pos(),
1686 node->constructor(), 1686 node->constructor(),
1687 node->arguments()->names(), 1687 node->arguments()->names(),
1688 arguments); 1688 arguments);
1689 // List factories return kArrayCid or kGrowableObjectArrayCid. 1689 // List factories return kArrayCid or kGrowableObjectArrayCid.
1690 const intptr_t result_cid = GetResultCidOfConstructor(node); 1690 call->set_result_cid(GetResultCidOfConstructor(node));
1691 call->set_result_cid(result_cid);
1692 call->set_is_known_constructor(result_cid != kDynamicCid);
1693 ReturnDefinition(call); 1691 ReturnDefinition(call);
1694 return; 1692 return;
1695 } 1693 }
1696 // t_n contains the allocated and initialized object. 1694 // t_n contains the allocated and initialized object.
1697 // t_n <- AllocateObject(class) 1695 // t_n <- AllocateObject(class)
1698 // t_n+1 <- ctor-arg 1696 // t_n+1 <- ctor-arg
1699 // t_n+2... <- constructor arguments start here 1697 // t_n+2... <- constructor arguments start here
1700 // StaticCall(constructor, t_n+1, t_n+2, ...) 1698 // StaticCall(constructor, t_n+1, t_n+2, ...)
1701 // No need to preserve allocated value (simpler than in ValueGraphVisitor). 1699 // No need to preserve allocated value (simpler than in ValueGraphVisitor).
1702 Value* allocated_value = BuildObjectAllocation(node); 1700 Value* allocated_value = BuildObjectAllocation(node);
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after
2632 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 2630 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
2633 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 2631 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
2634 OS::SNPrint(chars, len, kFormat, function_name, reason); 2632 OS::SNPrint(chars, len, kFormat, function_name, reason);
2635 const Error& error = Error::Handle( 2633 const Error& error = Error::Handle(
2636 LanguageError::New(String::Handle(String::New(chars)))); 2634 LanguageError::New(String::Handle(String::New(chars))));
2637 Isolate::Current()->long_jump_base()->Jump(1, error); 2635 Isolate::Current()->long_jump_base()->Jump(1, error);
2638 } 2636 }
2639 2637
2640 2638
2641 } // namespace dart 2639 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('j') | runtime/vm/intermediate_language.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698