| OLD | NEW |
| 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 "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
| 10 #include "vm/bootstrap.h" | 10 #include "vm/bootstrap.h" |
| (...skipping 6200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6211 for (intptr_t i = 0; i < this->pointer_offsets_length(); i++) { | 6211 for (intptr_t i = 0; i < this->pointer_offsets_length(); i++) { |
| 6212 const intptr_t offset = this->GetPointerOffsetAt(i); | 6212 const intptr_t offset = this->GetPointerOffsetAt(i); |
| 6213 if ((start_offset <= offset) && (offset < end_offset)) { | 6213 if ((start_offset <= offset) && (offset < end_offset)) { |
| 6214 return false; | 6214 return false; |
| 6215 } | 6215 } |
| 6216 } | 6216 } |
| 6217 return true; | 6217 return true; |
| 6218 } | 6218 } |
| 6219 | 6219 |
| 6220 | 6220 |
| 6221 void Code::ExtractIcDataArraysAtCalls( | 6221 intptr_t Code::ExtractIcDataArraysAtCalls( |
| 6222 GrowableArray<intptr_t>* node_ids, | 6222 GrowableArray<intptr_t>* node_ids, |
| 6223 const GrowableObjectArray& ic_data_objs) const { | 6223 const GrowableObjectArray& ic_data_objs) const { |
| 6224 ASSERT(node_ids != NULL); | 6224 ASSERT(node_ids != NULL); |
| 6225 ASSERT(!ic_data_objs.IsNull()); | 6225 ASSERT(!ic_data_objs.IsNull()); |
| 6226 const PcDescriptors& descriptors = | 6226 const PcDescriptors& descriptors = |
| 6227 PcDescriptors::Handle(this->pc_descriptors()); | 6227 PcDescriptors::Handle(this->pc_descriptors()); |
| 6228 ICData& ic_data_obj = ICData::Handle(); | 6228 ICData& ic_data_obj = ICData::Handle(); |
| 6229 intptr_t max_id = -1; |
| 6229 for (intptr_t i = 0; i < descriptors.Length(); i++) { | 6230 for (intptr_t i = 0; i < descriptors.Length(); i++) { |
| 6230 if (descriptors.DescriptorKind(i) == PcDescriptors::kIcCall) { | 6231 if (descriptors.DescriptorKind(i) == PcDescriptors::kIcCall) { |
| 6231 node_ids->Add(descriptors.NodeId(i)); | 6232 intptr_t node_id = descriptors.NodeId(i); |
| 6233 if (node_id > max_id) { |
| 6234 max_id = node_id; |
| 6235 } |
| 6236 node_ids->Add(node_id); |
| 6232 ic_data_obj = CodePatcher::GetInstanceCallIcDataAt(descriptors.PC(i)); | 6237 ic_data_obj = CodePatcher::GetInstanceCallIcDataAt(descriptors.PC(i)); |
| 6233 ic_data_objs.Add(ic_data_obj); | 6238 ic_data_objs.Add(ic_data_obj); |
| 6234 } | 6239 } |
| 6235 } | 6240 } |
| 6241 return max_id; |
| 6236 } | 6242 } |
| 6237 | 6243 |
| 6238 | 6244 |
| 6239 RawStackmap* Code::GetStackmap(uword pc, Array* maps, Stackmap* map) const { | 6245 RawStackmap* Code::GetStackmap(uword pc, Array* maps, Stackmap* map) const { |
| 6240 // This code is used only during iterating frames during a GC and hence | 6246 // This code is used only during iterating frames during a GC and hence |
| 6241 // it should not in turn start a GC. | 6247 // it should not in turn start a GC. |
| 6242 NoGCScope no_gc; | 6248 NoGCScope no_gc; |
| 6243 if (stackmaps() == Array::null()) { | 6249 if (stackmaps() == Array::null()) { |
| 6244 // No stack maps are present in the code object which means this | 6250 // No stack maps are present in the code object which means this |
| 6245 // frame relies on tagged pointers. | 6251 // frame relies on tagged pointers. |
| (...skipping 3649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9895 const String& str = String::Handle(pattern()); | 9901 const String& str = String::Handle(pattern()); |
| 9896 const char* format = "JSRegExp: pattern=%s flags=%s"; | 9902 const char* format = "JSRegExp: pattern=%s flags=%s"; |
| 9897 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); | 9903 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); |
| 9898 char* chars = reinterpret_cast<char*>( | 9904 char* chars = reinterpret_cast<char*>( |
| 9899 Isolate::Current()->current_zone()->Allocate(len + 1)); | 9905 Isolate::Current()->current_zone()->Allocate(len + 1)); |
| 9900 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); | 9906 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); |
| 9901 return chars; | 9907 return chars; |
| 9902 } | 9908 } |
| 9903 | 9909 |
| 9904 } // namespace dart | 9910 } // namespace dart |
| OLD | NEW |