| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/assert.h" | 8 #include "vm/assert.h" |
| 9 #include "vm/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
| 10 #include "vm/bootstrap.h" | 10 #include "vm/bootstrap.h" |
| (...skipping 4409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4420 for (intptr_t i = 0; i < this->pointer_offsets_length(); i++) { | 4420 for (intptr_t i = 0; i < this->pointer_offsets_length(); i++) { |
| 4421 const intptr_t offset = this->GetPointerOffsetAt(i); | 4421 const intptr_t offset = this->GetPointerOffsetAt(i); |
| 4422 if ((start_offset <= offset) && (offset < end_offset)) { | 4422 if ((start_offset <= offset) && (offset < end_offset)) { |
| 4423 return false; | 4423 return false; |
| 4424 } | 4424 } |
| 4425 } | 4425 } |
| 4426 return true; | 4426 return true; |
| 4427 } | 4427 } |
| 4428 | 4428 |
| 4429 | 4429 |
| 4430 void Code::ExtractTypesAtIcCalls( | 4430 void Code::ExtractIcDataArraysAtCalls( |
| 4431 GrowableArray<intptr_t>* node_ids, | 4431 GrowableArray<intptr_t>* node_ids, |
| 4432 GrowableArray<ZoneGrowableArray<const Class*>*>* type_arrays) const { | 4432 GrowableArray<const Array*>* arrays) const { |
| 4433 ASSERT(node_ids != NULL); | 4433 ASSERT(node_ids != NULL); |
| 4434 ASSERT(type_arrays != NULL); | 4434 ASSERT(arrays != NULL); |
| 4435 const PcDescriptors& descriptors = | 4435 const PcDescriptors& descriptors = |
| 4436 PcDescriptors::Handle(this->pc_descriptors()); | 4436 PcDescriptors::Handle(this->pc_descriptors()); |
| 4437 for (intptr_t i = 0; i < descriptors.Length(); i++) { | 4437 for (intptr_t i = 0; i < descriptors.Length(); i++) { |
| 4438 if (descriptors.DescriptorKind(i) == PcDescriptors::kIcCall) { | 4438 if (descriptors.DescriptorKind(i) == PcDescriptors::kIcCall) { |
| 4439 ICData ic_data(Array::Handle( | 4439 node_ids->Add(descriptors.NodeId(i)); |
| 4440 arrays->Add(&Array::ZoneHandle( |
| 4440 CodePatcher::GetInstanceCallIcDataAt(descriptors.PC(i)))); | 4441 CodePatcher::GetInstanceCallIcDataAt(descriptors.PC(i)))); |
| 4441 ASSERT(ic_data.NumberOfArgumentsChecked() == 1); | |
| 4442 int len = ic_data.NumberOfChecks(); | |
| 4443 ZoneGrowableArray<const Class*>* types = | |
| 4444 new ZoneGrowableArray<const Class*>(); | |
| 4445 Function& target = Function::Handle(); | |
| 4446 for (intptr_t k = 0; k < len; k++) { | |
| 4447 GrowableArray<const Class*> classes; | |
| 4448 ic_data.GetCheckAt(k, &classes, &target); | |
| 4449 ASSERT(classes.length() == 1); | |
| 4450 types->Add(classes[0]); | |
| 4451 } | |
| 4452 node_ids->Add(descriptors.NodeId(i)); | |
| 4453 type_arrays->Add(types); | |
| 4454 } | 4442 } |
| 4455 } | 4443 } |
| 4456 } | 4444 } |
| 4457 | 4445 |
| 4458 | 4446 |
| 4459 RawContext* Context::New(intptr_t num_variables, Heap::Space space) { | 4447 RawContext* Context::New(intptr_t num_variables, Heap::Space space) { |
| 4460 ASSERT(num_variables >= 0); | 4448 ASSERT(num_variables >= 0); |
| 4461 | 4449 |
| 4462 const Class& context_class = Class::Handle(Object::context_class()); | 4450 const Class& context_class = Class::Handle(Object::context_class()); |
| 4463 Context& result = Context::Handle(); | 4451 Context& result = Context::Handle(); |
| (...skipping 2327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6791 const String& str = String::Handle(pattern()); | 6779 const String& str = String::Handle(pattern()); |
| 6792 const char* format = "JSRegExp: pattern=%s flags=%s"; | 6780 const char* format = "JSRegExp: pattern=%s flags=%s"; |
| 6793 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); | 6781 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); |
| 6794 char* chars = reinterpret_cast<char*>( | 6782 char* chars = reinterpret_cast<char*>( |
| 6795 Isolate::Current()->current_zone()->Allocate(len + 1)); | 6783 Isolate::Current()->current_zone()->Allocate(len + 1)); |
| 6796 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); | 6784 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); |
| 6797 return chars; | 6785 return chars; |
| 6798 } | 6786 } |
| 6799 | 6787 |
| 6800 } // namespace dart | 6788 } // namespace dart |
| OLD | NEW |