| 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 HandleScope scope(isolate); | 361 HandleScope scope(isolate); |
| 362 DCHECK_EQ(1, args.length()); | 362 DCHECK_EQ(1, args.length()); |
| 363 CONVERT_SMI_ARG_CHECKED(length, 0); | 363 CONVERT_SMI_ARG_CHECKED(length, 0); |
| 364 Handle<SeqTwoByteString> result; | 364 Handle<SeqTwoByteString> result; |
| 365 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 365 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 366 isolate, result, isolate->factory()->NewRawTwoByteString(length)); | 366 isolate, result, isolate->factory()->NewRawTwoByteString(length)); |
| 367 return *result; | 367 return *result; |
| 368 } | 368 } |
| 369 | 369 |
| 370 | 370 |
| 371 RUNTIME_FUNCTION(Runtime_MessageGetStartPosition) { | |
| 372 SealHandleScope shs(isolate); | |
| 373 DCHECK(args.length() == 1); | |
| 374 CONVERT_ARG_CHECKED(JSMessageObject, message, 0); | |
| 375 return Smi::FromInt(message->start_position()); | |
| 376 } | |
| 377 | |
| 378 | |
| 379 RUNTIME_FUNCTION(Runtime_MessageGetScript) { | |
| 380 SealHandleScope shs(isolate); | |
| 381 DCHECK(args.length() == 1); | |
| 382 CONVERT_ARG_CHECKED(JSMessageObject, message, 0); | |
| 383 return message->script(); | |
| 384 } | |
| 385 | |
| 386 | |
| 387 RUNTIME_FUNCTION(Runtime_IS_VAR) { | 371 RUNTIME_FUNCTION(Runtime_IS_VAR) { |
| 388 UNREACHABLE(); // implemented as macro in the parser | 372 UNREACHABLE(); // implemented as macro in the parser |
| 389 return NULL; | 373 return NULL; |
| 390 } | 374 } |
| 391 | 375 |
| 392 | 376 |
| 393 namespace { | 377 namespace { |
| 394 | 378 |
| 395 bool ComputeLocation(Isolate* isolate, MessageLocation* target) { | 379 bool ComputeLocation(Isolate* isolate, MessageLocation* target) { |
| 396 JavaScriptFrameIterator it(isolate); | 380 JavaScriptFrameIterator it(isolate); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 | 564 |
| 581 RUNTIME_FUNCTION(Runtime_Typeof) { | 565 RUNTIME_FUNCTION(Runtime_Typeof) { |
| 582 HandleScope scope(isolate); | 566 HandleScope scope(isolate); |
| 583 DCHECK_EQ(1, args.length()); | 567 DCHECK_EQ(1, args.length()); |
| 584 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); | 568 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
| 585 return *Object::TypeOf(isolate, object); | 569 return *Object::TypeOf(isolate, object); |
| 586 } | 570 } |
| 587 | 571 |
| 588 } // namespace internal | 572 } // namespace internal |
| 589 } // namespace v8 | 573 } // namespace v8 |
| OLD | NEW |