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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 12473002: Complete implementation of bounds checking in the vm, by introducing a vm object (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/heap_profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 19513)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -1062,13 +1062,17 @@
// instantiated).
result = new ConstantInstr(negate_result ? Bool::True() : Bool::False());
} else {
- if (literal_value.IsInstanceOf(type, TypeArguments::Handle(), NULL)) {
+ Error& malformed_error = Error::Handle();
+ if (literal_value.IsInstanceOf(type,
+ TypeArguments::Handle(),
+ &malformed_error)) {
result = new ConstantInstr(negate_result ?
Bool::False() : Bool::True());
} else {
result = new ConstantInstr(negate_result ?
Bool::True() : Bool::False());
}
+ ASSERT(malformed_error.IsNull());
}
ReturnDefinition(result);
return;
@@ -1927,18 +1931,13 @@
requires_type_arguments &&
!node->type_arguments().IsNull() &&
!node->type_arguments().IsInstantiated() &&
- !node->type_arguments().IsWithinBoundsOf(cls,
- node->type_arguments(),
- NULL)) {
+ node->type_arguments().IsBounded()) {
Value* type_arguments = NULL;
Value* instantiator = NULL;
BuildConstructorTypeArguments(node, &type_arguments, &instantiator, NULL);
// The uninstantiated type arguments cannot be verified to be within their
// bounds at compile time, so verify them at runtime.
- // Although the type arguments may be uninstantiated at compile time, they
- // may represent the identity vector and may be replaced by the instantiated
- // type arguments of the instantiator at run time.
allocate_comp = new AllocateObjectWithBoundsCheckInstr(node,
type_arguments,
instantiator);
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/heap_profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698