OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/deoptimizer.h" | 8 #include "src/deoptimizer.h" |
9 #include "src/full-codegen.h" | 9 #include "src/full-codegen.h" |
10 #include "src/natives.h" | 10 #include "src/natives.h" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 RUNTIME_FUNCTION(Runtime_GetV8Version) { | 369 RUNTIME_FUNCTION(Runtime_GetV8Version) { |
370 HandleScope scope(isolate); | 370 HandleScope scope(isolate); |
371 DCHECK(args.length() == 0); | 371 DCHECK(args.length() == 0); |
372 | 372 |
373 const char* version_string = v8::V8::GetVersion(); | 373 const char* version_string = v8::V8::GetVersion(); |
374 | 374 |
375 return *isolate->factory()->NewStringFromAsciiChecked(version_string); | 375 return *isolate->factory()->NewStringFromAsciiChecked(version_string); |
376 } | 376 } |
377 | 377 |
378 | 378 |
| 379 RUNTIME_FUNCTION(Runtime_DisassembleFunction) { |
| 380 HandleScope scope(isolate); |
| 381 #ifdef DEBUG |
| 382 DCHECK(args.length() == 1); |
| 383 // Get the function and make sure it is compiled. |
| 384 CONVERT_ARG_HANDLE_CHECKED(JSFunction, func, 0); |
| 385 if (!Compiler::EnsureCompiled(func, KEEP_EXCEPTION)) { |
| 386 return isolate->heap()->exception(); |
| 387 } |
| 388 OFStream os(stdout); |
| 389 func->code()->Print(os); |
| 390 os << std::endl; |
| 391 #endif // DEBUG |
| 392 return isolate->heap()->undefined_value(); |
| 393 } |
| 394 |
| 395 |
379 static int StackSize(Isolate* isolate) { | 396 static int StackSize(Isolate* isolate) { |
380 int n = 0; | 397 int n = 0; |
381 for (JavaScriptFrameIterator it(isolate); !it.done(); it.Advance()) n++; | 398 for (JavaScriptFrameIterator it(isolate); !it.done(); it.Advance()) n++; |
382 return n; | 399 return n; |
383 } | 400 } |
384 | 401 |
385 | 402 |
386 static void PrintTransition(Isolate* isolate, Object* result) { | 403 static void PrintTransition(Isolate* isolate, Object* result) { |
387 // indentation | 404 // indentation |
388 { | 405 { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \ | 484 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \ |
468 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ | 485 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ |
469 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \ | 486 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \ |
470 } | 487 } |
471 | 488 |
472 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION) | 489 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION) |
473 | 490 |
474 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION | 491 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION |
475 } | 492 } |
476 } // namespace v8::internal | 493 } // namespace v8::internal |
OLD | NEW |