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 "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/become.h" | 10 #include "vm/become.h" |
(...skipping 8798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8809 UNREACHABLE(); | 8809 UNREACHABLE(); |
8810 return NULL; | 8810 return NULL; |
8811 } | 8811 } |
8812 | 8812 |
8813 | 8813 |
8814 void Script::set_url(const String& value) const { | 8814 void Script::set_url(const String& value) const { |
8815 StorePointer(&raw_ptr()->url_, value.raw()); | 8815 StorePointer(&raw_ptr()->url_, value.raw()); |
8816 } | 8816 } |
8817 | 8817 |
8818 | 8818 |
| 8819 void Script::set_resolved_url(const String& value) const { |
| 8820 StorePointer(&raw_ptr()->resolved_url_, value.raw()); |
| 8821 } |
| 8822 |
| 8823 |
8819 void Script::set_source(const String& value) const { | 8824 void Script::set_source(const String& value) const { |
8820 StorePointer(&raw_ptr()->source_, value.raw()); | 8825 StorePointer(&raw_ptr()->source_, value.raw()); |
8821 } | 8826 } |
8822 | 8827 |
8823 | 8828 |
8824 void Script::set_kind(RawScript::Kind value) const { | 8829 void Script::set_kind(RawScript::Kind value) const { |
8825 StoreNonPointer(&raw_ptr()->kind_, value); | 8830 StoreNonPointer(&raw_ptr()->kind_, value); |
8826 } | 8831 } |
8827 | 8832 |
8828 | 8833 |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9071 RawObject* raw = Object::Allocate(Script::kClassId, | 9076 RawObject* raw = Object::Allocate(Script::kClassId, |
9072 Script::InstanceSize(), | 9077 Script::InstanceSize(), |
9073 Heap::kOld); | 9078 Heap::kOld); |
9074 return reinterpret_cast<RawScript*>(raw); | 9079 return reinterpret_cast<RawScript*>(raw); |
9075 } | 9080 } |
9076 | 9081 |
9077 | 9082 |
9078 RawScript* Script::New(const String& url, | 9083 RawScript* Script::New(const String& url, |
9079 const String& source, | 9084 const String& source, |
9080 RawScript::Kind kind) { | 9085 RawScript::Kind kind) { |
| 9086 return Script::New(url, url, source, kind); |
| 9087 } |
| 9088 |
| 9089 |
| 9090 RawScript* Script::New(const String& url, |
| 9091 const String& resolved_url, |
| 9092 const String& source, |
| 9093 RawScript::Kind kind) { |
9081 Thread* thread = Thread::Current(); | 9094 Thread* thread = Thread::Current(); |
9082 Zone* zone = thread->zone(); | 9095 Zone* zone = thread->zone(); |
9083 const Script& result = Script::Handle(zone, Script::New()); | 9096 const Script& result = Script::Handle(zone, Script::New()); |
9084 result.set_url(String::Handle(zone, Symbols::New(thread, url))); | 9097 result.set_url(String::Handle(zone, Symbols::New(thread, url))); |
| 9098 result.set_resolved_url( |
| 9099 String::Handle(zone, Symbols::New(thread, resolved_url))); |
9085 result.set_source(source); | 9100 result.set_source(source); |
9086 result.set_kind(kind); | 9101 result.set_kind(kind); |
9087 result.set_load_timestamp(FLAG_remove_script_timestamps_for_test | 9102 result.set_load_timestamp(FLAG_remove_script_timestamps_for_test |
9088 ? 0 : OS::GetCurrentTimeMillis()); | 9103 ? 0 : OS::GetCurrentTimeMillis()); |
9089 result.SetLocationOffset(0, 0); | 9104 result.SetLocationOffset(0, 0); |
9090 return result.raw(); | 9105 return result.raw(); |
9091 } | 9106 } |
9092 | 9107 |
9093 | 9108 |
9094 const char* Script::ToCString() const { | 9109 const char* Script::ToCString() const { |
(...skipping 13606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22701 return UserTag::null(); | 22716 return UserTag::null(); |
22702 } | 22717 } |
22703 | 22718 |
22704 | 22719 |
22705 const char* UserTag::ToCString() const { | 22720 const char* UserTag::ToCString() const { |
22706 const String& tag_label = String::Handle(label()); | 22721 const String& tag_label = String::Handle(label()); |
22707 return tag_label.ToCString(); | 22722 return tag_label.ToCString(); |
22708 } | 22723 } |
22709 | 22724 |
22710 } // namespace dart | 22725 } // namespace dart |
OLD | NEW |