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

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

Issue 10835034: Fix an off-by-one error in the stack frame iteration. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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
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/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 7095 matching lines...) Expand 10 before | Expand all | Expand 10 after
7106 node_ids->Add(node_id); 7106 node_ids->Add(node_id);
7107 ic_data_obj = CodePatcher::GetInstanceCallIcDataAt(descriptors.PC(i)); 7107 ic_data_obj = CodePatcher::GetInstanceCallIcDataAt(descriptors.PC(i));
7108 ic_data_objs.Add(ic_data_obj); 7108 ic_data_objs.Add(ic_data_obj);
7109 } 7109 }
7110 } 7110 }
7111 return max_id; 7111 return max_id;
7112 } 7112 }
7113 7113
7114 7114
7115 RawStackmap* Code::GetStackmap(uword pc, Array* maps, Stackmap* map) const { 7115 RawStackmap* Code::GetStackmap(uword pc, Array* maps, Stackmap* map) const {
7116 // This code is used only during iterating frames during a GC and hence 7116 // This code is used during iterating frames during a GC and hence it
7117 // it should not in turn start a GC. 7117 // should not in turn start a GC.
7118 NoGCScope no_gc; 7118 NoGCScope no_gc;
7119 if (stackmaps() == Array::null()) { 7119 if (stackmaps() == Array::null()) {
7120 // No stack maps are present in the code object which means this 7120 // No stack maps are present in the code object which means this
7121 // frame relies on tagged pointers. 7121 // frame relies on tagged pointers.
7122 return Stackmap::null(); 7122 return Stackmap::null();
7123 } 7123 }
7124 // A stack map is present in the code object, use the stack map to visit 7124 // A stack map is present in the code object, use the stack map to visit
7125 // frame slots which are marked as having objects. 7125 // frame slots which are marked as having objects.
7126 *maps = stackmaps(); 7126 *maps = stackmaps();
7127 *map = Stackmap::null(); 7127 *map = Stackmap::null();
(...skipping 3723 matching lines...) Expand 10 before | Expand all | Expand 10 after
10851 const String& str = String::Handle(pattern()); 10851 const String& str = String::Handle(pattern());
10852 const char* format = "JSRegExp: pattern=%s flags=%s"; 10852 const char* format = "JSRegExp: pattern=%s flags=%s";
10853 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); 10853 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags());
10854 char* chars = reinterpret_cast<char*>( 10854 char* chars = reinterpret_cast<char*>(
10855 Isolate::Current()->current_zone()->Allocate(len + 1)); 10855 Isolate::Current()->current_zone()->Allocate(len + 1));
10856 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); 10856 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags());
10857 return chars; 10857 return chars;
10858 } 10858 }
10859 10859
10860 } // namespace dart 10860 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698