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 4588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4599 void LocalVarDescriptors::GetRange(intptr_t var_index, | 4599 void LocalVarDescriptors::GetRange(intptr_t var_index, |
4600 intptr_t* begin_token_pos, | 4600 intptr_t* begin_token_pos, |
4601 intptr_t* end_token_pos) const { | 4601 intptr_t* end_token_pos) const { |
4602 ASSERT(var_index < Length()); | 4602 ASSERT(var_index < Length()); |
4603 RawLocalVarDescriptors::VarInfo *info = &raw_ptr()->data_[var_index]; | 4603 RawLocalVarDescriptors::VarInfo *info = &raw_ptr()->data_[var_index]; |
4604 *begin_token_pos = info->begin_pos; | 4604 *begin_token_pos = info->begin_pos; |
4605 *end_token_pos = info->end_pos; | 4605 *end_token_pos = info->end_pos; |
4606 } | 4606 } |
4607 | 4607 |
4608 | 4608 |
| 4609 intptr_t LocalVarDescriptors::GetSlotIndex(intptr_t var_index) const { |
| 4610 ASSERT(var_index < Length()); |
| 4611 RawLocalVarDescriptors::VarInfo *info = &raw_ptr()->data_[var_index]; |
| 4612 return info->index; |
| 4613 } |
| 4614 |
| 4615 |
4609 void LocalVarDescriptors::SetVar(intptr_t var_index, | 4616 void LocalVarDescriptors::SetVar(intptr_t var_index, |
4610 const String& name, | 4617 const String& name, |
4611 intptr_t stack_slot, | 4618 intptr_t stack_slot, |
4612 intptr_t begin_pos, | 4619 intptr_t begin_pos, |
4613 intptr_t end_pos) const { | 4620 intptr_t end_pos) const { |
4614 ASSERT(var_index < Length()); | 4621 ASSERT(var_index < Length()); |
4615 const Array& names = Array::Handle(raw_ptr()->names_); | 4622 const Array& names = Array::Handle(raw_ptr()->names_); |
4616 ASSERT(Length() == names.Length()); | 4623 ASSERT(Length() == names.Length()); |
4617 names.SetAt(var_index, name); | 4624 names.SetAt(var_index, name); |
4618 RawLocalVarDescriptors::VarInfo *info = &raw_ptr()->data_[var_index]; | 4625 RawLocalVarDescriptors::VarInfo *info = &raw_ptr()->data_[var_index]; |
(...skipping 2864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7483 const String& str = String::Handle(pattern()); | 7490 const String& str = String::Handle(pattern()); |
7484 const char* format = "JSRegExp: pattern=%s flags=%s"; | 7491 const char* format = "JSRegExp: pattern=%s flags=%s"; |
7485 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); | 7492 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); |
7486 char* chars = reinterpret_cast<char*>( | 7493 char* chars = reinterpret_cast<char*>( |
7487 Isolate::Current()->current_zone()->Allocate(len + 1)); | 7494 Isolate::Current()->current_zone()->Allocate(len + 1)); |
7488 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); | 7495 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); |
7489 return chars; | 7496 return chars; |
7490 } | 7497 } |
7491 | 7498 |
7492 } // namespace dart | 7499 } // namespace dart |
OLD | NEW |