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

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

Issue 562333004: Recognize Bigint setters and getters. This code will be removed when/if we change the fields to be … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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/flow_graph_optimizer.cc » ('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 (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 "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "vm/ast_printer.h" 8 #include "vm/ast_printer.h"
9 #include "vm/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 3257 matching lines...) Expand 10 before | Expand all | Expand 10 after
3268 node->scope()->LookupVariable(Symbols::TypeArgumentsParameter(), 3268 node->scope()->LookupVariable(Symbols::TypeArgumentsParameter(),
3269 true); 3269 true);
3270 Value* element_type = Bind(new(I) LoadLocalInstr(*type_args_parameter)); 3270 Value* element_type = Bind(new(I) LoadLocalInstr(*type_args_parameter));
3271 LocalVariable* length_parameter = 3271 LocalVariable* length_parameter =
3272 node->scope()->LookupVariable(Symbols::Length(), true); 3272 node->scope()->LookupVariable(Symbols::Length(), true);
3273 Value* length = Bind(new(I) LoadLocalInstr(*length_parameter)); 3273 Value* length = Bind(new(I) LoadLocalInstr(*length_parameter));
3274 CreateArrayInstr* create_array = 3274 CreateArrayInstr* create_array =
3275 new CreateArrayInstr(node->token_pos(), element_type, length); 3275 new CreateArrayInstr(node->token_pos(), element_type, length);
3276 return ReturnDefinition(create_array); 3276 return ReturnDefinition(create_array);
3277 } 3277 }
3278 case MethodRecognizer::kBigint_getDigits: {
3279 Value* receiver = Bind(BuildLoadThisVar(node->scope()));
3280 LoadFieldInstr* load = new(I) LoadFieldInstr(
3281 receiver,
3282 Bigint::digits_offset(),
3283 Type::ZoneHandle(I, Type::DynamicType()),
3284 node->token_pos());
3285 // TODO(srdjan): Make this kTypedDataUint32ArrayCid.
3286 load->set_result_cid(kDynamicCid);
regis 2014/09/11 22:33:30 Why can't you do it now?
srdjan 2014/09/11 22:44:20 I must keep the type (passed to LoadFieldInstr) an
Florian Schneider 2014/09/12 09:17:39 I think it should just work to set result_cid, but
srdjan 2014/09/12 15:29:35 Currently it throws an NPE. Will investigate in ne
srdjan 2014/09/18 16:12:54 It throws an NPE because it is sometimes NULL and
3287 load->set_recognized_kind(kind);
3288 return ReturnDefinition(load);
3289 }
3290 case MethodRecognizer::kBigint_getUsed: {
3291 Value* receiver = Bind(BuildLoadThisVar(node->scope()));
3292 LoadFieldInstr* load = new(I) LoadFieldInstr(
3293 receiver,
3294 Bigint::used_offset(),
3295 Type::ZoneHandle(I, Type::SmiType()),
3296 node->token_pos());
3297 load->set_result_cid(kSmiCid);
3298 load->set_recognized_kind(kind);
3299 return ReturnDefinition(load);
3300 }
3301 case MethodRecognizer::kBigint_getNeg: {
3302 Value* receiver = Bind(BuildLoadThisVar(node->scope()));
3303 LoadFieldInstr* load = new(I) LoadFieldInstr(
3304 receiver,
3305 Bigint::neg_offset(),
3306 Type::ZoneHandle(I, Type::BoolType()),
3307 node->token_pos());
3308 load->set_result_cid(kBoolCid);
3309 load->set_recognized_kind(kind);
3310 return ReturnDefinition(load);
3311 }
3278 default: 3312 default:
3279 break; 3313 break;
3280 } 3314 }
3281 } 3315 }
3282 InlineBailout("EffectGraphVisitor::VisitNativeBodyNode"); 3316 InlineBailout("EffectGraphVisitor::VisitNativeBodyNode");
3283 NativeCallInstr* native_call = new(I) NativeCallInstr(node); 3317 NativeCallInstr* native_call = new(I) NativeCallInstr(node);
3284 ReturnDefinition(native_call); 3318 ReturnDefinition(native_call);
3285 } 3319 }
3286 3320
3287 3321
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
4223 Report::MessageF(Report::kBailout, 4257 Report::MessageF(Report::kBailout,
4224 Script::Handle(function.script()), 4258 Script::Handle(function.script()),
4225 function.token_pos(), 4259 function.token_pos(),
4226 "FlowGraphBuilder Bailout: %s %s", 4260 "FlowGraphBuilder Bailout: %s %s",
4227 String::Handle(function.name()).ToCString(), 4261 String::Handle(function.name()).ToCString(),
4228 reason); 4262 reason);
4229 UNREACHABLE(); 4263 UNREACHABLE();
4230 } 4264 }
4231 4265
4232 } // namespace dart 4266 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698