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

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

Issue 1318943005: Update range errors to agree on the numbers. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: More tests Created 5 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
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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 array.SetTypeArguments(element_type); // May be null. 131 array.SetTypeArguments(element_type); // May be null.
132 return; 132 return;
133 } 133 }
134 } 134 }
135 // Throw: new RangeError.range(length, 0, Array::kMaxElements, "length"); 135 // Throw: new RangeError.range(length, 0, Array::kMaxElements, "length");
136 const Array& args = Array::Handle(Array::New(4)); 136 const Array& args = Array::Handle(Array::New(4));
137 args.SetAt(0, length); 137 args.SetAt(0, length);
138 args.SetAt(1, Integer::Handle(Integer::New(0))); 138 args.SetAt(1, Integer::Handle(Integer::New(0)));
139 args.SetAt(2, Integer::Handle(Integer::New(Array::kMaxElements))); 139 args.SetAt(2, Integer::Handle(Integer::New(Array::kMaxElements)));
140 args.SetAt(3, Symbols::Length()); 140 args.SetAt(3, Symbols::Length());
141 Exceptions::ThrowByType(Exceptions::kRangeRange, args); 141 Exceptions::ThrowByType(Exceptions::kRange, args);
142 } 142 }
143 143
144 144
145 // Helper returning the token position of the Dart caller. 145 // Helper returning the token position of the Dart caller.
146 static intptr_t GetCallerLocation() { 146 static intptr_t GetCallerLocation() {
147 DartFrameIterator iterator; 147 DartFrameIterator iterator;
148 StackFrame* caller_frame = iterator.NextFrame(); 148 StackFrame* caller_frame = iterator.NextFrame();
149 ASSERT(caller_frame != NULL); 149 ASSERT(caller_frame != NULL);
150 return caller_frame->GetTokenPos(); 150 return caller_frame->GetTokenPos();
151 } 151 }
(...skipping 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after
1855 const intptr_t elm_size = old_data.ElementSizeInBytes(); 1855 const intptr_t elm_size = old_data.ElementSizeInBytes();
1856 const TypedData& new_data = 1856 const TypedData& new_data =
1857 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); 1857 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld));
1858 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); 1858 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size);
1859 typed_data_cell.SetAt(0, new_data); 1859 typed_data_cell.SetAt(0, new_data);
1860 arguments.SetReturn(new_data); 1860 arguments.SetReturn(new_data);
1861 } 1861 }
1862 1862
1863 1863
1864 } // namespace dart 1864 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698