OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
(...skipping 6418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6429 // [type]: the script type. | 6429 // [type]: the script type. |
6430 DECL_INT_ACCESSORS(type) | 6430 DECL_INT_ACCESSORS(type) |
6431 | 6431 |
6432 // [line_ends]: FixedArray of line ends positions. | 6432 // [line_ends]: FixedArray of line ends positions. |
6433 DECL_ACCESSORS(line_ends, Object) | 6433 DECL_ACCESSORS(line_ends, Object) |
6434 | 6434 |
6435 // [eval_from_shared]: for eval scripts the shared function info for the | 6435 // [eval_from_shared]: for eval scripts the shared function info for the |
6436 // function from which eval was called. | 6436 // function from which eval was called. |
6437 DECL_ACCESSORS(eval_from_shared, Object) | 6437 DECL_ACCESSORS(eval_from_shared, Object) |
6438 | 6438 |
6439 // [eval_from_position]: the source position in the code for the | 6439 // [eval_from_position]: the source position in the code for the function |
6440 // function from which eval was called. | 6440 // from which eval was called, as positive integer. Or the code offset in the |
| 6441 // code from which eval was called, as negative integer. |
6441 DECL_INT_ACCESSORS(eval_from_position) | 6442 DECL_INT_ACCESSORS(eval_from_position) |
6442 | 6443 |
6443 // [shared_function_infos]: weak fixed array containing all shared | 6444 // [shared_function_infos]: weak fixed array containing all shared |
6444 // function infos created from this script. | 6445 // function infos created from this script. |
6445 DECL_ACCESSORS(shared_function_infos, Object) | 6446 DECL_ACCESSORS(shared_function_infos, Object) |
6446 | 6447 |
6447 // [flags]: Holds an exciting bitfield. | 6448 // [flags]: Holds an exciting bitfield. |
6448 DECL_INT_ACCESSORS(flags) | 6449 DECL_INT_ACCESSORS(flags) |
6449 | 6450 |
6450 // [source_url]: sourceURL from magic comment | 6451 // [source_url]: sourceURL from magic comment |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6483 // Convert code offset into column number. | 6484 // Convert code offset into column number. |
6484 static int GetColumnNumber(Handle<Script> script, int code_offset); | 6485 static int GetColumnNumber(Handle<Script> script, int code_offset); |
6485 | 6486 |
6486 // Convert code offset into (zero-based) line number. | 6487 // Convert code offset into (zero-based) line number. |
6487 // The non-handlified version does not allocate, but may be much slower. | 6488 // The non-handlified version does not allocate, but may be much slower. |
6488 static int GetLineNumber(Handle<Script> script, int code_offset); | 6489 static int GetLineNumber(Handle<Script> script, int code_offset); |
6489 int GetLineNumber(int code_pos); | 6490 int GetLineNumber(int code_pos); |
6490 | 6491 |
6491 static Handle<Object> GetNameOrSourceURL(Handle<Script> script); | 6492 static Handle<Object> GetNameOrSourceURL(Handle<Script> script); |
6492 | 6493 |
| 6494 // Set eval origin for stack trace formatting. |
| 6495 static void SetEvalOrigin(Handle<Script> script, |
| 6496 Handle<SharedFunctionInfo> outer, |
| 6497 int eval_position); |
| 6498 // Retrieve source position from where eval was called. |
| 6499 int GetEvalPosition(); |
| 6500 |
6493 // Init line_ends array with source code positions of line ends. | 6501 // Init line_ends array with source code positions of line ends. |
6494 static void InitLineEnds(Handle<Script> script); | 6502 static void InitLineEnds(Handle<Script> script); |
6495 | 6503 |
6496 // Get the JS object wrapping the given script; create it if none exists. | 6504 // Get the JS object wrapping the given script; create it if none exists. |
6497 static Handle<JSObject> GetWrapper(Handle<Script> script); | 6505 static Handle<JSObject> GetWrapper(Handle<Script> script); |
6498 | 6506 |
6499 // Look through the list of existing shared function infos to find one | 6507 // Look through the list of existing shared function infos to find one |
6500 // that matches the function literal. Return empty handle if not found. | 6508 // that matches the function literal. Return empty handle if not found. |
6501 MaybeHandle<SharedFunctionInfo> FindSharedFunctionInfo(FunctionLiteral* fun); | 6509 MaybeHandle<SharedFunctionInfo> FindSharedFunctionInfo(FunctionLiteral* fun); |
6502 | 6510 |
(...skipping 4292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10795 } | 10803 } |
10796 return value; | 10804 return value; |
10797 } | 10805 } |
10798 }; | 10806 }; |
10799 | 10807 |
10800 | 10808 |
10801 } // NOLINT, false-positive due to second-order macros. | 10809 } // NOLINT, false-positive due to second-order macros. |
10802 } // NOLINT, false-positive due to second-order macros. | 10810 } // NOLINT, false-positive due to second-order macros. |
10803 | 10811 |
10804 #endif // V8_OBJECTS_H_ | 10812 #endif // V8_OBJECTS_H_ |
OLD | NEW |