OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 | 4 |
5 #include "src/debug/debug.h" | 5 #include "src/debug/debug.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 2322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2333 summary.function()->PrintName(); | 2333 summary.function()->PrintName(); |
2334 PrintF("'.\n"); | 2334 PrintF("'.\n"); |
2335 if (script_obj->IsScript()) { | 2335 if (script_obj->IsScript()) { |
2336 Handle<Script> script = Handle<Script>::cast(script_obj); | 2336 Handle<Script> script = Handle<Script>::cast(script_obj); |
2337 Handle<String> source(String::cast(script->source())); | 2337 Handle<String> source(String::cast(script->source())); |
2338 Script::InitLineEnds(script); | 2338 Script::InitLineEnds(script); |
2339 int line = Script::GetLineNumber(script, source_position); | 2339 int line = Script::GetLineNumber(script, source_position); |
2340 int column = Script::GetColumnNumber(script, source_position); | 2340 int column = Script::GetColumnNumber(script, source_position); |
2341 Handle<FixedArray> line_ends(FixedArray::cast(script->line_ends())); | 2341 Handle<FixedArray> line_ends(FixedArray::cast(script->line_ends())); |
2342 int line_start = | 2342 int line_start = |
2343 line == 0 ? 0 : Smi::cast(line_ends->get(line - 1))->value(); | 2343 line == 0 ? 0 : Smi::cast(line_ends->get(line - 1))->value() + 1; |
2344 int line_end = Smi::cast(line_ends->get(line))->value(); | 2344 int line_end = Smi::cast(line_ends->get(line))->value(); |
2345 DisallowHeapAllocation no_gc; | 2345 DisallowHeapAllocation no_gc; |
2346 String::FlatContent content = source->GetFlatContent(); | 2346 String::FlatContent content = source->GetFlatContent(); |
2347 if (content.IsOneByte()) { | 2347 if (content.IsOneByte()) { |
2348 PrintF("[debug] %.*s\n", line_end - line_start, | 2348 PrintF("[debug] %.*s\n", line_end - line_start, |
2349 content.ToOneByteVector().start() + line_start); | 2349 content.ToOneByteVector().start() + line_start); |
2350 PrintF("[debug] "); | 2350 PrintF("[debug] "); |
2351 for (int i = 0; i < column; i++) PrintF(" "); | 2351 for (int i = 0; i < column; i++) PrintF(" "); |
2352 PrintF("^\n"); | 2352 PrintF("^\n"); |
2353 } else { | 2353 } else { |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2659 } | 2659 } |
2660 | 2660 |
2661 | 2661 |
2662 void LockingCommandMessageQueue::Clear() { | 2662 void LockingCommandMessageQueue::Clear() { |
2663 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 2663 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
2664 queue_.Clear(); | 2664 queue_.Clear(); |
2665 } | 2665 } |
2666 | 2666 |
2667 } // namespace internal | 2667 } // namespace internal |
2668 } // namespace v8 | 2668 } // namespace v8 |
OLD | NEW |