| 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 6403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6414 bool Array::Equals(const Instance& other) const { | 6414 bool Array::Equals(const Instance& other) const { |
| 6415 if (this->raw() == other.raw()) { | 6415 if (this->raw() == other.raw()) { |
| 6416 // Both handles point to the same raw instance. | 6416 // Both handles point to the same raw instance. |
| 6417 return true; | 6417 return true; |
| 6418 } | 6418 } |
| 6419 | 6419 |
| 6420 if (!other.IsArray() || other.IsNull()) { | 6420 if (!other.IsArray() || other.IsNull()) { |
| 6421 return false; | 6421 return false; |
| 6422 } | 6422 } |
| 6423 | 6423 |
| 6424 // Must have the same type. |
| 6425 if (GetTypeArguments() != other.GetTypeArguments()) { |
| 6426 return false; |
| 6427 } |
| 6428 |
| 6424 Array& other_arr = Array::Handle(); | 6429 Array& other_arr = Array::Handle(); |
| 6425 other_arr ^= other.raw(); | 6430 other_arr ^= other.raw(); |
| 6426 | 6431 |
| 6427 intptr_t len = this->Length(); | 6432 intptr_t len = this->Length(); |
| 6428 if (len != other_arr.Length()) { | 6433 if (len != other_arr.Length()) { |
| 6429 return false; | 6434 return false; |
| 6430 } | 6435 } |
| 6431 | 6436 |
| 6432 for (intptr_t i = 0; i < len; i++) { | 6437 for (intptr_t i = 0; i < len; i++) { |
| 6433 if (this->At(i) != other_arr.At(i)) { | 6438 if (this->At(i) != other_arr.At(i)) { |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6805 const String& str = String::Handle(pattern()); | 6810 const String& str = String::Handle(pattern()); |
| 6806 const char* format = "JSRegExp: pattern=%s flags=%s"; | 6811 const char* format = "JSRegExp: pattern=%s flags=%s"; |
| 6807 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); | 6812 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); |
| 6808 char* chars = reinterpret_cast<char*>( | 6813 char* chars = reinterpret_cast<char*>( |
| 6809 Isolate::Current()->current_zone()->Allocate(len + 1)); | 6814 Isolate::Current()->current_zone()->Allocate(len + 1)); |
| 6810 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); | 6815 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); |
| 6811 return chars; | 6816 return chars; |
| 6812 } | 6817 } |
| 6813 | 6818 |
| 6814 } // namespace dart | 6819 } // namespace dart |
| OLD | NEW |