Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: runtime/vm/object.cc

Issue 11282003: Trace when disabling optimized code (--trace-disabling-optimized-code) (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/compiler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 25 matching lines...) Expand all
36 namespace dart { 36 namespace dart {
37 37
38 DEFINE_FLAG(bool, generate_gdb_symbols, false, 38 DEFINE_FLAG(bool, generate_gdb_symbols, false,
39 "Generate symbols of generated dart functions for debugging with GDB"); 39 "Generate symbols of generated dart functions for debugging with GDB");
40 DEFINE_FLAG(bool, reject_named_argument_as_positional, true, 40 DEFINE_FLAG(bool, reject_named_argument_as_positional, true,
41 "Enforce new rules for optional parameters and disallow passing of named " 41 "Enforce new rules for optional parameters and disallow passing of named "
42 "arguments to optional positional formal parameters"); 42 "arguments to optional positional formal parameters");
43 DEFINE_FLAG(bool, show_internal_names, false, 43 DEFINE_FLAG(bool, show_internal_names, false,
44 "Show names of internal classes (e.g. \"OneByteString\") in error messages " 44 "Show names of internal classes (e.g. \"OneByteString\") in error messages "
45 "instead of showing the corresponding interface names (e.g. \"String\")"); 45 "instead of showing the corresponding interface names (e.g. \"String\")");
46 DEFINE_FLAG(bool, trace_disabling_optimized_code, false,
47 "Trace disabling optimized code.");
46 DECLARE_FLAG(bool, trace_compiler); 48 DECLARE_FLAG(bool, trace_compiler);
47 DECLARE_FLAG(bool, eliminate_type_checks); 49 DECLARE_FLAG(bool, eliminate_type_checks);
48 DECLARE_FLAG(bool, enable_type_checks); 50 DECLARE_FLAG(bool, enable_type_checks);
49 51
50 static const char* kGetterPrefix = "get:"; 52 static const char* kGetterPrefix = "get:";
51 static const intptr_t kGetterPrefixLength = strlen(kGetterPrefix); 53 static const intptr_t kGetterPrefixLength = strlen(kGetterPrefix);
52 static const char* kSetterPrefix = "set:"; 54 static const char* kSetterPrefix = "set:";
53 static const intptr_t kSetterPrefixLength = strlen(kSetterPrefix); 55 static const intptr_t kSetterPrefixLength = strlen(kSetterPrefix);
54 56
55 cpp_vtable Object::handle_vtable_ = 0; 57 cpp_vtable Object::handle_vtable_ = 0;
(...skipping 2954 matching lines...) Expand 10 before | Expand all | Expand 10 after
3010 void Function::SetCode(const Code& value) const { 3012 void Function::SetCode(const Code& value) const {
3011 StorePointer(&raw_ptr()->code_, value.raw()); 3013 StorePointer(&raw_ptr()->code_, value.raw());
3012 ASSERT(Function::Handle(value.function()).IsNull() || 3014 ASSERT(Function::Handle(value.function()).IsNull() ||
3013 (value.function() == this->raw())); 3015 (value.function() == this->raw()));
3014 value.set_function(*this); 3016 value.set_function(*this);
3015 } 3017 }
3016 3018
3017 3019
3018 void Function::SwitchToUnoptimizedCode() const { 3020 void Function::SwitchToUnoptimizedCode() const {
3019 ASSERT(HasOptimizedCode()); 3021 ASSERT(HasOptimizedCode());
3022 const Code& current_code = Code::Handle(CurrentCode());
3023 if (FLAG_trace_disabling_optimized_code) {
3024 OS::Print("Disabling optimized code: '%s' entry: %#"Px"\n",
3025 ToFullyQualifiedCString(),
3026 current_code.EntryPoint());
3027 }
3020 // Patch entry of the optimized code. 3028 // Patch entry of the optimized code.
3021 CodePatcher::PatchEntry(Code::Handle(CurrentCode())); 3029 CodePatcher::PatchEntry(current_code);
3022 // Use previously compiled unoptimized code. 3030 // Use previously compiled unoptimized code.
3023 SetCode(Code::Handle(unoptimized_code())); 3031 SetCode(Code::Handle(unoptimized_code()));
3024 CodePatcher::RestoreEntry(Code::Handle(unoptimized_code())); 3032 CodePatcher::RestoreEntry(Code::Handle(unoptimized_code()));
3025 } 3033 }
3026 3034
3027 3035
3028 void Function::set_unoptimized_code(const Code& value) const { 3036 void Function::set_unoptimized_code(const Code& value) const {
3029 StorePointer(&raw_ptr()->unoptimized_code_, value.raw()); 3037 StorePointer(&raw_ptr()->unoptimized_code_, value.raw());
3030 } 3038 }
3031 3039
(...skipping 9184 matching lines...) Expand 10 before | Expand all | Expand 10 after
12216 } 12224 }
12217 return result.raw(); 12225 return result.raw();
12218 } 12226 }
12219 12227
12220 12228
12221 const char* WeakProperty::ToCString() const { 12229 const char* WeakProperty::ToCString() const {
12222 return "_WeakProperty"; 12230 return "_WeakProperty";
12223 } 12231 }
12224 12232
12225 } // namespace dart 12233 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698