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

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

Issue 1674383002: Keep a trail while checking upper bounds in the VM in order to properly handle (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address comments Created 4 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/flow_graph_builder.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/code_generator.h" 5 #include "vm/code_generator.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/ast.h" 8 #include "vm/ast.h"
9 #include "vm/code_patcher.h" 9 #include "vm/code_patcher.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 // Arg0: uninstantiated type. 198 // Arg0: uninstantiated type.
199 // Arg1: instantiator type arguments. 199 // Arg1: instantiator type arguments.
200 // Return value: instantiated type. 200 // Return value: instantiated type.
201 DEFINE_RUNTIME_ENTRY(InstantiateType, 2) { 201 DEFINE_RUNTIME_ENTRY(InstantiateType, 2) {
202 AbstractType& type = AbstractType::CheckedHandle(arguments.ArgAt(0)); 202 AbstractType& type = AbstractType::CheckedHandle(arguments.ArgAt(0));
203 const TypeArguments& instantiator = 203 const TypeArguments& instantiator =
204 TypeArguments::CheckedHandle(arguments.ArgAt(1)); 204 TypeArguments::CheckedHandle(arguments.ArgAt(1));
205 ASSERT(!type.IsNull() && !type.IsInstantiated()); 205 ASSERT(!type.IsNull() && !type.IsInstantiated());
206 ASSERT(instantiator.IsNull() || instantiator.IsInstantiated()); 206 ASSERT(instantiator.IsNull() || instantiator.IsInstantiated());
207 Error& bound_error = Error::Handle(); 207 Error& bound_error = Error::Handle();
208 type = type.InstantiateFrom(instantiator, &bound_error, NULL, Heap::kOld); 208 type =
209 type.InstantiateFrom(instantiator, &bound_error, NULL, NULL, Heap::kOld);
209 if (!bound_error.IsNull()) { 210 if (!bound_error.IsNull()) {
210 // Throw a dynamic type error. 211 // Throw a dynamic type error.
211 const TokenPosition location = GetCallerLocation(); 212 const TokenPosition location = GetCallerLocation();
212 String& bound_error_message = String::Handle( 213 String& bound_error_message = String::Handle(
213 String::New(bound_error.ToErrorCString())); 214 String::New(bound_error.ToErrorCString()));
214 Exceptions::CreateAndThrowTypeError( 215 Exceptions::CreateAndThrowTypeError(
215 location, Symbols::Empty(), Symbols::Empty(), 216 location, Symbols::Empty(), Symbols::Empty(),
216 Symbols::Empty(), bound_error_message); 217 Symbols::Empty(), bound_error_message);
217 UNREACHABLE(); 218 UNREACHABLE();
218 } 219 }
(...skipping 1679 matching lines...) Expand 10 before | Expand all | Expand 10 after
1898 const intptr_t elm_size = old_data.ElementSizeInBytes(); 1899 const intptr_t elm_size = old_data.ElementSizeInBytes();
1899 const TypedData& new_data = 1900 const TypedData& new_data =
1900 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); 1901 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld));
1901 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); 1902 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size);
1902 typed_data_cell.SetAt(0, new_data); 1903 typed_data_cell.SetAt(0, new_data);
1903 arguments.SetReturn(new_data); 1904 arguments.SetReturn(new_data);
1904 } 1905 }
1905 1906
1906 1907
1907 } // namespace dart 1908 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698