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

Side by Side Diff: src/codegen-ia32.cc

Issue 16537: Runtime logging (Closed)
Patch Set: Created 11 years, 11 months 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/codegen-ia32.h ('k') | src/jsregexp.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-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 2882 matching lines...) Expand 10 before | Expand all | Expand 10 after
2893 2893
2894 void CodeGenerator::GenerateIsSmi(ZoneList<Expression*>* args) { 2894 void CodeGenerator::GenerateIsSmi(ZoneList<Expression*>* args) {
2895 ASSERT(args->length() == 1); 2895 ASSERT(args->length() == 1);
2896 Load(args->at(0)); 2896 Load(args->at(0));
2897 frame_->Pop(eax); 2897 frame_->Pop(eax);
2898 __ test(eax, Immediate(kSmiTagMask)); 2898 __ test(eax, Immediate(kSmiTagMask));
2899 cc_reg_ = zero; 2899 cc_reg_ = zero;
2900 } 2900 }
2901 2901
2902 2902
2903 void CodeGenerator::GenerateLog(ZoneList<Expression*>* args) {
2904 // Conditionally generate a log call.
Mads Ager (chromium) 2009/01/06 13:08:43 Could you add this comment to the ARM code as well
Christian Plesner Hansen 2009/01/06 13:23:56 I've added a comment in the arm version that says
2905 // Args:
2906 // 0 (literal string): The type of logging (corresponds to the flags).
2907 // This is used to determine whether or not to generate the log call.
2908 // 1 (string): Format string. Access the string at argument index 2
2909 // with '%2s' (see Logger::LogRuntime for all the formats).
2910 // 2 (array): Arguments to the format string.
2911 ASSERT_EQ(args->length(), 3);
2912 if (ShouldGenerateLog(args->at(0))) {
2913 Load(args->at(1));
2914 Load(args->at(2));
2915 __ CallRuntime(Runtime::kLog, 2);
2916 }
2917 // Finally, we're expected to leave a value on the top of the stack.
2918 frame_->Push(Immediate(Factory::undefined_value()));
2919 }
2920
2921
2903 void CodeGenerator::GenerateIsNonNegativeSmi(ZoneList<Expression*>* args) { 2922 void CodeGenerator::GenerateIsNonNegativeSmi(ZoneList<Expression*>* args) {
2904 ASSERT(args->length() == 1); 2923 ASSERT(args->length() == 1);
2905 Load(args->at(0)); 2924 Load(args->at(0));
2906 frame_->Pop(eax); 2925 frame_->Pop(eax);
2907 __ test(eax, Immediate(kSmiTagMask | 0x80000000)); 2926 __ test(eax, Immediate(kSmiTagMask | 0x80000000));
2908 cc_reg_ = zero; 2927 cc_reg_ = zero;
2909 } 2928 }
2910 2929
2911 2930
2912 // This generates code that performs a charCodeAt() call or returns 2931 // This generates code that performs a charCodeAt() call or returns
(...skipping 2364 matching lines...) Expand 10 before | Expand all | Expand 10 after
5277 5296
5278 // Slow-case: Go through the JavaScript implementation. 5297 // Slow-case: Go through the JavaScript implementation.
5279 __ bind(&slow); 5298 __ bind(&slow);
5280 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); 5299 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION);
5281 } 5300 }
5282 5301
5283 5302
5284 #undef __ 5303 #undef __
5285 5304
5286 } } // namespace v8::internal 5305 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/codegen-ia32.h ('k') | src/jsregexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698