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/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 6667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6678 intptr_t count = 0; | 6678 intptr_t count = 0; |
6679 for (intptr_t i = 0; i < deopt_id_to_ic_data.length(); i++) { | 6679 for (intptr_t i = 0; i < deopt_id_to_ic_data.length(); i++) { |
6680 if (deopt_id_to_ic_data[i] != NULL) { | 6680 if (deopt_id_to_ic_data[i] != NULL) { |
6681 count++; | 6681 count++; |
6682 } | 6682 } |
6683 } | 6683 } |
6684 if (count == 0) { | 6684 if (count == 0) { |
6685 set_ic_data_array(Object::empty_array()); | 6685 set_ic_data_array(Object::empty_array()); |
6686 } else { | 6686 } else { |
6687 const Array& a = Array::Handle(Array::New(count, Heap::kOld)); | 6687 const Array& a = Array::Handle(Array::New(count, Heap::kOld)); |
| 6688 INC_STAT(Isolate::Current(), total_code_size, count * sizeof(uword)); |
6688 count = 0; | 6689 count = 0; |
6689 for (intptr_t i = 0; i < deopt_id_to_ic_data.length(); i++) { | 6690 for (intptr_t i = 0; i < deopt_id_to_ic_data.length(); i++) { |
6690 if (deopt_id_to_ic_data[i] != NULL) { | 6691 if (deopt_id_to_ic_data[i] != NULL) { |
6691 a.SetAt(count++, *deopt_id_to_ic_data[i]); | 6692 a.SetAt(count++, *deopt_id_to_ic_data[i]); |
6692 } | 6693 } |
6693 } | 6694 } |
6694 set_ic_data_array(a); | 6695 set_ic_data_array(a); |
6695 } | 6696 } |
6696 } | 6697 } |
6697 | 6698 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6968 return "RedirectionData class"; | 6969 return "RedirectionData class"; |
6969 } | 6970 } |
6970 | 6971 |
6971 | 6972 |
6972 void RedirectionData::PrintJSONImpl(JSONStream* stream, bool ref) const { | 6973 void RedirectionData::PrintJSONImpl(JSONStream* stream, bool ref) const { |
6973 Object::PrintJSONImpl(stream, ref); | 6974 Object::PrintJSONImpl(stream, ref); |
6974 } | 6975 } |
6975 | 6976 |
6976 | 6977 |
6977 RawString* Field::GetterName(const String& field_name) { | 6978 RawString* Field::GetterName(const String& field_name) { |
6978 CompilerStats::make_accessor_name++; | |
6979 return String::Concat(Symbols::GetterPrefix(), field_name); | 6979 return String::Concat(Symbols::GetterPrefix(), field_name); |
6980 } | 6980 } |
6981 | 6981 |
6982 | 6982 |
6983 RawString* Field::GetterSymbol(const String& field_name) { | 6983 RawString* Field::GetterSymbol(const String& field_name) { |
6984 return Symbols::FromConcat(Symbols::GetterPrefix(), field_name); | 6984 return Symbols::FromConcat(Symbols::GetterPrefix(), field_name); |
6985 } | 6985 } |
6986 | 6986 |
6987 | 6987 |
6988 RawString* Field::SetterName(const String& field_name) { | 6988 RawString* Field::SetterName(const String& field_name) { |
6989 CompilerStats::make_accessor_name++; | |
6990 return String::Concat(Symbols::SetterPrefix(), field_name); | 6989 return String::Concat(Symbols::SetterPrefix(), field_name); |
6991 } | 6990 } |
6992 | 6991 |
6993 | 6992 |
6994 RawString* Field::SetterSymbol(const String& field_name) { | 6993 RawString* Field::SetterSymbol(const String& field_name) { |
6995 return Symbols::FromConcat(Symbols::SetterPrefix(), field_name); | 6994 return Symbols::FromConcat(Symbols::SetterPrefix(), field_name); |
6996 } | 6995 } |
6997 | 6996 |
6998 | 6997 |
6999 RawString* Field::NameFromGetter(const String& getter_name) { | 6998 RawString* Field::NameFromGetter(const String& getter_name) { |
7000 CompilerStats::make_field_name++; | |
7001 return String::SubString(getter_name, strlen(kGetterPrefix)); | 6999 return String::SubString(getter_name, strlen(kGetterPrefix)); |
7002 } | 7000 } |
7003 | 7001 |
7004 | 7002 |
7005 RawString* Field::NameFromSetter(const String& setter_name) { | 7003 RawString* Field::NameFromSetter(const String& setter_name) { |
7006 CompilerStats::make_field_name++; | |
7007 return String::SubString(setter_name, strlen(kSetterPrefix)); | 7004 return String::SubString(setter_name, strlen(kSetterPrefix)); |
7008 } | 7005 } |
7009 | 7006 |
7010 | 7007 |
7011 bool Field::IsGetterName(const String& function_name) { | 7008 bool Field::IsGetterName(const String& function_name) { |
7012 return function_name.StartsWith(Symbols::GetterPrefix()); | 7009 return function_name.StartsWith(Symbols::GetterPrefix()); |
7013 } | 7010 } |
7014 | 7011 |
7015 | 7012 |
7016 bool Field::IsSetterName(const String& function_name) { | 7013 bool Field::IsSetterName(const String& function_name) { |
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7940 uint8_t* buffer_; | 7937 uint8_t* buffer_; |
7941 WriteStream stream_; | 7938 WriteStream stream_; |
7942 CompressedTokenMap tokens_; | 7939 CompressedTokenMap tokens_; |
7943 | 7940 |
7944 DISALLOW_COPY_AND_ASSIGN(CompressedTokenStreamData); | 7941 DISALLOW_COPY_AND_ASSIGN(CompressedTokenStreamData); |
7945 }; | 7942 }; |
7946 | 7943 |
7947 | 7944 |
7948 RawTokenStream* TokenStream::New(const Scanner::GrowableTokenStream& tokens, | 7945 RawTokenStream* TokenStream::New(const Scanner::GrowableTokenStream& tokens, |
7949 const String& private_key) { | 7946 const String& private_key) { |
| 7947 Isolate* isolate = Isolate::Current(); |
7950 // Copy the relevant data out of the scanner into a compressed stream of | 7948 // Copy the relevant data out of the scanner into a compressed stream of |
7951 // tokens. | 7949 // tokens. |
7952 CompressedTokenStreamData data; | 7950 CompressedTokenStreamData data; |
7953 intptr_t len = tokens.length(); | 7951 intptr_t len = tokens.length(); |
7954 for (intptr_t i = 0; i < len; i++) { | 7952 for (intptr_t i = 0; i < len; i++) { |
7955 Scanner::TokenDescriptor token = tokens[i]; | 7953 Scanner::TokenDescriptor token = tokens[i]; |
7956 if (token.kind == Token::kIDENT) { // Identifier token. | 7954 if (token.kind == Token::kIDENT) { // Identifier token. |
7957 if (FLAG_compiler_stats) { | 7955 if (FLAG_compiler_stats) { |
7958 CompilerStats::num_ident_tokens_total += 1; | 7956 INC_STAT(isolate, num_ident_tokens_total, 1); |
7959 } | 7957 } |
7960 data.AddIdentToken(token.literal); | 7958 data.AddIdentToken(token.literal); |
7961 } else if (Token::NeedsLiteralToken(token.kind)) { // Literal token. | 7959 } else if (Token::NeedsLiteralToken(token.kind)) { // Literal token. |
7962 if (FLAG_compiler_stats) { | 7960 if (FLAG_compiler_stats) { |
7963 CompilerStats::num_literal_tokens_total += 1; | 7961 INC_STAT(isolate, num_literal_tokens_total, 1); |
7964 } | 7962 } |
7965 data.AddLiteralToken(token); | 7963 data.AddLiteralToken(token); |
7966 } else { // Keyword, pseudo keyword etc. | 7964 } else { // Keyword, pseudo keyword etc. |
7967 ASSERT(token.kind < Token::kNumTokens); | 7965 ASSERT(token.kind < Token::kNumTokens); |
7968 data.AddSimpleToken(token.kind); | 7966 data.AddSimpleToken(token.kind); |
7969 } | 7967 } |
7970 } | 7968 } |
7971 if (FLAG_compiler_stats) { | 7969 INC_STAT(isolate, num_tokens_total, len); |
7972 CompilerStats::num_tokens_total += len; | |
7973 } | |
7974 data.AddSimpleToken(Token::kEOS); // End of stream. | 7970 data.AddSimpleToken(Token::kEOS); // End of stream. |
7975 | 7971 |
7976 // Create and setup the token stream object. | 7972 // Create and setup the token stream object. |
7977 const ExternalTypedData& stream = ExternalTypedData::Handle( | 7973 const ExternalTypedData& stream = ExternalTypedData::Handle( |
| 7974 isolate, |
7978 ExternalTypedData::New(kExternalTypedDataUint8ArrayCid, | 7975 ExternalTypedData::New(kExternalTypedDataUint8ArrayCid, |
7979 data.GetStream(), data.Length(), Heap::kOld)); | 7976 data.GetStream(), data.Length(), Heap::kOld)); |
7980 stream.AddFinalizer(data.GetStream(), DataFinalizer); | 7977 stream.AddFinalizer(data.GetStream(), DataFinalizer); |
7981 const TokenStream& result = TokenStream::Handle(New()); | 7978 const TokenStream& result = TokenStream::Handle(isolate, New()); |
7982 result.SetPrivateKey(private_key); | 7979 result.SetPrivateKey(private_key); |
7983 const Array& token_objects = Array::Handle(data.MakeTokenObjectsArray()); | 7980 const Array& token_objects = |
| 7981 Array::Handle(isolate, data.MakeTokenObjectsArray()); |
7984 { | 7982 { |
7985 NoSafepointScope no_safepoint; | 7983 NoSafepointScope no_safepoint; |
7986 result.SetStream(stream); | 7984 result.SetStream(stream); |
7987 result.SetTokenObjects(token_objects); | 7985 result.SetTokenObjects(token_objects); |
7988 } | 7986 } |
7989 return result.raw(); | 7987 return result.raw(); |
7990 } | 7988 } |
7991 | 7989 |
7992 | 7990 |
7993 const char* TokenStream::ToCString() const { | 7991 const char* TokenStream::ToCString() const { |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8294 | 8292 |
8295 void Script::Tokenize(const String& private_key) const { | 8293 void Script::Tokenize(const String& private_key) const { |
8296 Isolate* isolate = Isolate::Current(); | 8294 Isolate* isolate = Isolate::Current(); |
8297 const TokenStream& tkns = TokenStream::Handle(isolate, tokens()); | 8295 const TokenStream& tkns = TokenStream::Handle(isolate, tokens()); |
8298 if (!tkns.IsNull()) { | 8296 if (!tkns.IsNull()) { |
8299 // Already tokenized. | 8297 // Already tokenized. |
8300 return; | 8298 return; |
8301 } | 8299 } |
8302 // Get the source, scan and allocate the token stream. | 8300 // Get the source, scan and allocate the token stream. |
8303 VMTagScope tagScope(isolate, VMTag::kCompileScannerTagId); | 8301 VMTagScope tagScope(isolate, VMTag::kCompileScannerTagId); |
8304 TimerScope timer(FLAG_compiler_stats, &CompilerStats::scanner_timer); | 8302 CSTAT_TIMER_SCOPE(isolate, scanner_timer); |
8305 const String& src = String::Handle(isolate, Source()); | 8303 const String& src = String::Handle(isolate, Source()); |
8306 Scanner scanner(src, private_key); | 8304 Scanner scanner(src, private_key); |
8307 set_tokens(TokenStream::Handle(isolate, | 8305 set_tokens(TokenStream::Handle(isolate, |
8308 TokenStream::New(scanner.GetStream(), | 8306 TokenStream::New(scanner.GetStream(), |
8309 private_key))); | 8307 private_key))); |
8310 if (FLAG_compiler_stats) { | 8308 INC_STAT(isolate, src_length, src.Length()); |
8311 CompilerStats::src_length += src.Length(); | |
8312 } | |
8313 } | 8309 } |
8314 | 8310 |
8315 | 8311 |
8316 void Script::SetLocationOffset(intptr_t line_offset, | 8312 void Script::SetLocationOffset(intptr_t line_offset, |
8317 intptr_t col_offset) const { | 8313 intptr_t col_offset) const { |
8318 ASSERT(line_offset >= 0); | 8314 ASSERT(line_offset >= 0); |
8319 ASSERT(col_offset >= 0); | 8315 ASSERT(col_offset >= 0); |
8320 StoreNonPointer(&raw_ptr()->line_offset_, line_offset); | 8316 StoreNonPointer(&raw_ptr()->line_offset_, line_offset); |
8321 StoreNonPointer(&raw_ptr()->col_offset_, col_offset); | 8317 StoreNonPointer(&raw_ptr()->col_offset_, col_offset); |
8322 } | 8318 } |
(...skipping 2284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10607 NoSafepointScope no_safepoint; | 10603 NoSafepointScope no_safepoint; |
10608 uint8_t* data = UnsafeMutableNonPointer(&raw_ptr()->data()[0]); | 10604 uint8_t* data = UnsafeMutableNonPointer(&raw_ptr()->data()[0]); |
10609 for (intptr_t i = 0; i < delta_encoded_data->length(); ++i) { | 10605 for (intptr_t i = 0; i < delta_encoded_data->length(); ++i) { |
10610 data[i] = (*delta_encoded_data)[i]; | 10606 data[i] = (*delta_encoded_data)[i]; |
10611 } | 10607 } |
10612 } | 10608 } |
10613 | 10609 |
10614 | 10610 |
10615 RawPcDescriptors* PcDescriptors::New(GrowableArray<uint8_t>* data) { | 10611 RawPcDescriptors* PcDescriptors::New(GrowableArray<uint8_t>* data) { |
10616 ASSERT(Object::pc_descriptors_class() != Class::null()); | 10612 ASSERT(Object::pc_descriptors_class() != Class::null()); |
10617 PcDescriptors& result = PcDescriptors::Handle(); | 10613 Isolate* isolate = Isolate::Current(); |
| 10614 PcDescriptors& result = PcDescriptors::Handle(isolate); |
10618 { | 10615 { |
10619 uword size = PcDescriptors::InstanceSize(data->length()); | 10616 uword size = PcDescriptors::InstanceSize(data->length()); |
10620 RawObject* raw = Object::Allocate(PcDescriptors::kClassId, | 10617 RawObject* raw = Object::Allocate(PcDescriptors::kClassId, |
10621 size, | 10618 size, |
10622 Heap::kOld); | 10619 Heap::kOld); |
| 10620 INC_STAT(isolate, total_code_size, size); |
| 10621 INC_STAT(isolate, pc_desc_size, size); |
10623 NoSafepointScope no_safepoint; | 10622 NoSafepointScope no_safepoint; |
10624 result ^= raw; | 10623 result ^= raw; |
10625 result.SetLength(data->length()); | 10624 result.SetLength(data->length()); |
10626 result.CopyData(data); | 10625 result.CopyData(data); |
10627 } | 10626 } |
10628 return result.raw(); | 10627 return result.raw(); |
10629 } | 10628 } |
10630 | 10629 |
10631 | 10630 |
10632 const char* PcDescriptors::KindAsStr(RawPcDescriptors::Kind kind) { | 10631 const char* PcDescriptors::KindAsStr(RawPcDescriptors::Kind kind) { |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11032 FATAL2("Fatal error in LocalVarDescriptors::New: " | 11031 FATAL2("Fatal error in LocalVarDescriptors::New: " |
11033 "invalid num_variables %" Pd ". Maximum is: %d\n", | 11032 "invalid num_variables %" Pd ". Maximum is: %d\n", |
11034 num_variables, RawLocalVarDescriptors::kMaxIndex); | 11033 num_variables, RawLocalVarDescriptors::kMaxIndex); |
11035 } | 11034 } |
11036 LocalVarDescriptors& result = LocalVarDescriptors::Handle(); | 11035 LocalVarDescriptors& result = LocalVarDescriptors::Handle(); |
11037 { | 11036 { |
11038 uword size = LocalVarDescriptors::InstanceSize(num_variables); | 11037 uword size = LocalVarDescriptors::InstanceSize(num_variables); |
11039 RawObject* raw = Object::Allocate(LocalVarDescriptors::kClassId, | 11038 RawObject* raw = Object::Allocate(LocalVarDescriptors::kClassId, |
11040 size, | 11039 size, |
11041 Heap::kOld); | 11040 Heap::kOld); |
| 11041 INC_STAT(Isolate::Current(), total_code_size, size); |
| 11042 INC_STAT(Isolate::Current(), vardesc_size, size); |
11042 NoSafepointScope no_safepoint; | 11043 NoSafepointScope no_safepoint; |
11043 result ^= raw; | 11044 result ^= raw; |
11044 result.StoreNonPointer(&result.raw_ptr()->num_entries_, num_variables); | 11045 result.StoreNonPointer(&result.raw_ptr()->num_entries_, num_variables); |
11045 } | 11046 } |
11046 return result.raw(); | 11047 return result.raw(); |
11047 } | 11048 } |
11048 | 11049 |
11049 | 11050 |
11050 intptr_t LocalVarDescriptors::Length() const { | 11051 intptr_t LocalVarDescriptors::Length() const { |
11051 return raw_ptr()->num_entries_; | 11052 return raw_ptr()->num_entries_; |
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12104 | 12105 |
12105 | 12106 |
12106 void Code::set_is_alive(bool value) const { | 12107 void Code::set_is_alive(bool value) const { |
12107 set_state_bits(AliveBit::update(value, raw_ptr()->state_bits_)); | 12108 set_state_bits(AliveBit::update(value, raw_ptr()->state_bits_)); |
12108 } | 12109 } |
12109 | 12110 |
12110 | 12111 |
12111 void Code::set_stackmaps(const Array& maps) const { | 12112 void Code::set_stackmaps(const Array& maps) const { |
12112 ASSERT(maps.IsOld()); | 12113 ASSERT(maps.IsOld()); |
12113 StorePointer(&raw_ptr()->stackmaps_, maps.raw()); | 12114 StorePointer(&raw_ptr()->stackmaps_, maps.raw()); |
| 12115 INC_STAT(Isolate::Current(), |
| 12116 total_code_size, |
| 12117 maps.IsNull() ? 0 : maps.Length() * sizeof(uword)); |
12114 } | 12118 } |
12115 | 12119 |
12116 | 12120 |
12117 void Code::set_deopt_info_array(const Array& array) const { | 12121 void Code::set_deopt_info_array(const Array& array) const { |
12118 ASSERT(array.IsOld()); | 12122 ASSERT(array.IsOld()); |
12119 StorePointer(&raw_ptr()->deopt_info_array_, array.raw()); | 12123 StorePointer(&raw_ptr()->deopt_info_array_, array.raw()); |
12120 } | 12124 } |
12121 | 12125 |
12122 | 12126 |
12123 void Code::set_static_calls_target_table(const Array& value) const { | 12127 void Code::set_static_calls_target_table(const Array& value) const { |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12322 bool optimized) { | 12326 bool optimized) { |
12323 ASSERT(assembler != NULL); | 12327 ASSERT(assembler != NULL); |
12324 | 12328 |
12325 // Allocate the Code and Instructions objects. Code is allocated first | 12329 // Allocate the Code and Instructions objects. Code is allocated first |
12326 // because a GC during allocation of the code will leave the instruction | 12330 // because a GC during allocation of the code will leave the instruction |
12327 // pages read-only. | 12331 // pages read-only. |
12328 intptr_t pointer_offset_count = assembler->CountPointerOffsets(); | 12332 intptr_t pointer_offset_count = assembler->CountPointerOffsets(); |
12329 Code& code = Code::ZoneHandle(Code::New(pointer_offset_count)); | 12333 Code& code = Code::ZoneHandle(Code::New(pointer_offset_count)); |
12330 Instructions& instrs = | 12334 Instructions& instrs = |
12331 Instructions::ZoneHandle(Instructions::New(assembler->CodeSize())); | 12335 Instructions::ZoneHandle(Instructions::New(assembler->CodeSize())); |
| 12336 INC_STAT(Isolate::Current(), total_instr_size, assembler->CodeSize()); |
| 12337 INC_STAT(Isolate::Current(), total_code_size, assembler->CodeSize()); |
12332 | 12338 |
12333 // Copy the instructions into the instruction area and apply all fixups. | 12339 // Copy the instructions into the instruction area and apply all fixups. |
12334 // Embedded pointers are still in handles at this point. | 12340 // Embedded pointers are still in handles at this point. |
12335 MemoryRegion region(reinterpret_cast<void*>(instrs.EntryPoint()), | 12341 MemoryRegion region(reinterpret_cast<void*>(instrs.EntryPoint()), |
12336 instrs.size()); | 12342 instrs.size()); |
12337 assembler->FinalizeInstructions(region); | 12343 assembler->FinalizeInstructions(region); |
12338 VerifiedMemory::Accept(region.start(), region.size()); | 12344 VerifiedMemory::Accept(region.start(), region.size()); |
12339 CPU::FlushICache(instrs.EntryPoint(), instrs.size()); | 12345 CPU::FlushICache(instrs.EntryPoint(), instrs.size()); |
12340 | 12346 |
12341 code.set_compile_timestamp(OS::GetCurrentTimeMicros()); | 12347 code.set_compile_timestamp(OS::GetCurrentTimeMicros()); |
(...skipping 24 matching lines...) Expand all Loading... |
12366 // Hook up Code and Instructions objects. | 12372 // Hook up Code and Instructions objects. |
12367 instrs.set_code(code.raw()); | 12373 instrs.set_code(code.raw()); |
12368 code.set_instructions(instrs.raw()); | 12374 code.set_instructions(instrs.raw()); |
12369 code.set_is_alive(true); | 12375 code.set_is_alive(true); |
12370 | 12376 |
12371 // Set object pool in Instructions object. | 12377 // Set object pool in Instructions object. |
12372 const GrowableObjectArray& object_pool = assembler->object_pool_data(); | 12378 const GrowableObjectArray& object_pool = assembler->object_pool_data(); |
12373 if (object_pool.IsNull()) { | 12379 if (object_pool.IsNull()) { |
12374 instrs.set_object_pool(Object::empty_array().raw()); | 12380 instrs.set_object_pool(Object::empty_array().raw()); |
12375 } else { | 12381 } else { |
| 12382 INC_STAT(Isolate::Current(), |
| 12383 total_code_size, object_pool.Length() * sizeof(uintptr_t)); |
12376 // TODO(regis): Once MakeArray takes a Heap::Space argument, call it here | 12384 // TODO(regis): Once MakeArray takes a Heap::Space argument, call it here |
12377 // with Heap::kOld and change the ARM and MIPS assemblers to work with a | 12385 // with Heap::kOld and change the ARM and MIPS assemblers to work with a |
12378 // GrowableObjectArray in new space. | 12386 // GrowableObjectArray in new space. |
12379 instrs.set_object_pool(Array::MakeArray(object_pool)); | 12387 instrs.set_object_pool(Array::MakeArray(object_pool)); |
12380 } | 12388 } |
12381 if (FLAG_write_protect_code) { | 12389 if (FLAG_write_protect_code) { |
12382 uword address = RawObject::ToAddr(instrs.raw()); | 12390 uword address = RawObject::ToAddr(instrs.raw()); |
12383 bool status = VirtualMemory::Protect( | 12391 bool status = VirtualMemory::Protect( |
12384 reinterpret_cast<void*>(address), | 12392 reinterpret_cast<void*>(address), |
12385 instrs.raw()->Size(), | 12393 instrs.raw()->Size(), |
12386 VirtualMemory::kReadExecute); | 12394 VirtualMemory::kReadExecute); |
12387 ASSERT(status); | 12395 ASSERT(status); |
12388 } | 12396 } |
12389 } | 12397 } |
12390 code.set_comments(assembler->GetCodeComments()); | 12398 code.set_comments(assembler->GetCodeComments()); |
| 12399 INC_STAT(Isolate::Current(), |
| 12400 total_code_size, code.comments().comments_.Length()); |
12391 return code.raw(); | 12401 return code.raw(); |
12392 } | 12402 } |
12393 | 12403 |
12394 | 12404 |
12395 RawCode* Code::FinalizeCode(const Function& function, | 12405 RawCode* Code::FinalizeCode(const Function& function, |
12396 Assembler* assembler, | 12406 Assembler* assembler, |
12397 bool optimized) { | 12407 bool optimized) { |
12398 // Calling ToLibNamePrefixedQualifiedCString is very expensive, | 12408 // Calling ToLibNamePrefixedQualifiedCString is very expensive, |
12399 // try to avoid it. | 12409 // try to avoid it. |
12400 if (CodeObservers::AreActive()) { | 12410 if (CodeObservers::AreActive()) { |
(...skipping 8358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20759 return tag_label.ToCString(); | 20769 return tag_label.ToCString(); |
20760 } | 20770 } |
20761 | 20771 |
20762 | 20772 |
20763 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 20773 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
20764 Instance::PrintJSONImpl(stream, ref); | 20774 Instance::PrintJSONImpl(stream, ref); |
20765 } | 20775 } |
20766 | 20776 |
20767 | 20777 |
20768 } // namespace dart | 20778 } // namespace dart |
OLD | NEW |