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

Side by Side Diff: src/stub-cache.cc

Issue 434074: Include getters and setters callbacks invocations in CPU profiler log. (Closed)
Patch Set: Comments addressed Created 11 years 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
« no previous file with comments | « src/log.cc ('k') | test/cctest/test-log.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 ASSERT(fun != NULL); 743 ASSERT(fun != NULL);
744 CustomArguments custom_args(callback->data(), 744 CustomArguments custom_args(callback->data(),
745 JSObject::cast(args[0]), 745 JSObject::cast(args[0]),
746 JSObject::cast(args[1])); 746 JSObject::cast(args[1]));
747 v8::AccessorInfo info(custom_args.end()); 747 v8::AccessorInfo info(custom_args.end());
748 HandleScope scope; 748 HandleScope scope;
749 v8::Handle<v8::Value> result; 749 v8::Handle<v8::Value> result;
750 { 750 {
751 // Leaving JavaScript. 751 // Leaving JavaScript.
752 VMState state(EXTERNAL); 752 VMState state(EXTERNAL);
753 #ifdef ENABLE_LOGGING_AND_PROFILING
754 state.set_external_callback(getter_address);
755 #endif
753 result = fun(v8::Utils::ToLocal(args.at<String>(4)), info); 756 result = fun(v8::Utils::ToLocal(args.at<String>(4)), info);
754 } 757 }
755 RETURN_IF_SCHEDULED_EXCEPTION(); 758 RETURN_IF_SCHEDULED_EXCEPTION();
756 if (result.IsEmpty()) return Heap::undefined_value(); 759 if (result.IsEmpty()) return Heap::undefined_value();
757 return *v8::Utils::OpenHandle(*result); 760 return *v8::Utils::OpenHandle(*result);
758 } 761 }
759 762
760 763
761 Object* StoreCallbackProperty(Arguments args) { 764 Object* StoreCallbackProperty(Arguments args) {
762 JSObject* recv = JSObject::cast(args[0]); 765 JSObject* recv = JSObject::cast(args[0]);
763 AccessorInfo* callback = AccessorInfo::cast(args[1]); 766 AccessorInfo* callback = AccessorInfo::cast(args[1]);
764 Address setter_address = v8::ToCData<Address>(callback->setter()); 767 Address setter_address = v8::ToCData<Address>(callback->setter());
765 v8::AccessorSetter fun = FUNCTION_CAST<v8::AccessorSetter>(setter_address); 768 v8::AccessorSetter fun = FUNCTION_CAST<v8::AccessorSetter>(setter_address);
766 ASSERT(fun != NULL); 769 ASSERT(fun != NULL);
767 Handle<String> name = args.at<String>(2); 770 Handle<String> name = args.at<String>(2);
768 Handle<Object> value = args.at<Object>(3); 771 Handle<Object> value = args.at<Object>(3);
769 HandleScope scope; 772 HandleScope scope;
770 LOG(ApiNamedPropertyAccess("store", recv, *name)); 773 LOG(ApiNamedPropertyAccess("store", recv, *name));
771 CustomArguments custom_args(callback->data(), recv, recv); 774 CustomArguments custom_args(callback->data(), recv, recv);
772 v8::AccessorInfo info(custom_args.end()); 775 v8::AccessorInfo info(custom_args.end());
773 { 776 {
774 // Leaving JavaScript. 777 // Leaving JavaScript.
775 VMState state(EXTERNAL); 778 VMState state(EXTERNAL);
779 #ifdef ENABLE_LOGGING_AND_PROFILING
780 state.set_external_callback(setter_address);
781 #endif
776 fun(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), info); 782 fun(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), info);
777 } 783 }
778 RETURN_IF_SCHEDULED_EXCEPTION(); 784 RETURN_IF_SCHEDULED_EXCEPTION();
779 return *value; 785 return *value;
780 } 786 }
781 787
782 /** 788 /**
783 * Attempts to load a property with an interceptor (which must be present), 789 * Attempts to load a property with an interceptor (which must be present),
784 * but doesn't search the prototype chain. 790 * but doesn't search the prototype chain.
785 * 791 *
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 if (!result->IsFailure()) { 1099 if (!result->IsFailure()) {
1094 Code* code = Code::cast(result); 1100 Code* code = Code::cast(result);
1095 USE(code); 1101 USE(code);
1096 LOG(CodeCreateEvent(Logger::STUB_TAG, code, "ConstructStub")); 1102 LOG(CodeCreateEvent(Logger::STUB_TAG, code, "ConstructStub"));
1097 } 1103 }
1098 return result; 1104 return result;
1099 } 1105 }
1100 1106
1101 1107
1102 } } // namespace v8::internal 1108 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/log.cc ('k') | test/cctest/test-log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698