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

Side by Side Diff: src/code-stub-assembler.cc

Issue 2651673003: [csa] add utilities for printf-style debugging (Closed)
Patch Set: rename DebugPrint macro to Print Created 3 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/code-stub-assembler.h ('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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 #include "src/code-stub-assembler.h" 4 #include "src/code-stub-assembler.h"
5 #include "src/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/frames-inl.h" 6 #include "src/frames-inl.h"
7 #include "src/frames.h" 7 #include "src/frames.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 8380 matching lines...) Expand 10 before | Expand all | Expand 10 after
8391 StoreObjectFieldNoWriteBarrier( 8391 StoreObjectFieldNoWriteBarrier(
8392 result, PromiseReactionJobInfo::kDeferredOnRejectOffset, 8392 result, PromiseReactionJobInfo::kDeferredOnRejectOffset,
8393 deferred_on_reject); 8393 deferred_on_reject);
8394 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kDebugIdOffset, 8394 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kDebugIdOffset,
8395 SmiConstant(kDebugPromiseNoID)); 8395 SmiConstant(kDebugPromiseNoID));
8396 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kContextOffset, 8396 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kContextOffset,
8397 context); 8397 context);
8398 return result; 8398 return result;
8399 } 8399 }
8400 8400
8401 void CodeStubAssembler::Print(const char* s) {
8402 #ifdef DEBUG
8403 std::string formatted(s);
8404 formatted += "\n";
8405 Handle<String> string = isolate()->factory()->NewStringFromAsciiChecked(
8406 formatted.c_str(), TENURED);
8407 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), HeapConstant(string));
8408 #endif
8409 }
8410
8411 void CodeStubAssembler::Print(const char* prefix, Node* tagged_value) {
8412 #ifdef DEBUG
8413 if (prefix != nullptr) {
8414 std::string formatted(prefix);
8415 formatted += ": ";
8416 Handle<String> string = isolate()->factory()->NewStringFromAsciiChecked(
8417 formatted.c_str(), TENURED);
8418 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(),
8419 HeapConstant(string));
8420 }
8421 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), tagged_value);
caitp 2017/01/24 13:30:37 Is there any way to assert that the value outputs
8422 #endif
8423 }
8424
8401 } // namespace internal 8425 } // namespace internal
8402 } // namespace v8 8426 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stub-assembler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698