OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2530 // [column_offset]: script column offset in resource from where it was | 2530 // [column_offset]: script column offset in resource from where it was |
2531 // extracted. | 2531 // extracted. |
2532 DECL_ACCESSORS(column_offset, Smi) | 2532 DECL_ACCESSORS(column_offset, Smi) |
2533 | 2533 |
2534 // [wrapper]: the wrapper cache. | 2534 // [wrapper]: the wrapper cache. |
2535 DECL_ACCESSORS(wrapper, Proxy) | 2535 DECL_ACCESSORS(wrapper, Proxy) |
2536 | 2536 |
2537 // [type]: the script type. | 2537 // [type]: the script type. |
2538 DECL_ACCESSORS(type, Smi) | 2538 DECL_ACCESSORS(type, Smi) |
2539 | 2539 |
| 2540 // [line_ends]: array of line ends positions |
| 2541 DECL_ACCESSORS(line_ends, Object) |
| 2542 |
2540 static inline Script* cast(Object* obj); | 2543 static inline Script* cast(Object* obj); |
2541 | 2544 |
2542 #ifdef DEBUG | 2545 #ifdef DEBUG |
2543 void ScriptPrint(); | 2546 void ScriptPrint(); |
2544 void ScriptVerify(); | 2547 void ScriptVerify(); |
2545 #endif | 2548 #endif |
2546 | 2549 |
| 2550 void InitLineEnds(); |
| 2551 int GetLineNumber(int code_position); |
| 2552 |
2547 static const int kSourceOffset = HeapObject::kHeaderSize; | 2553 static const int kSourceOffset = HeapObject::kHeaderSize; |
2548 static const int kNameOffset = kSourceOffset + kPointerSize; | 2554 static const int kNameOffset = kSourceOffset + kPointerSize; |
2549 static const int kLineOffsetOffset = kNameOffset + kPointerSize; | 2555 static const int kLineOffsetOffset = kNameOffset + kPointerSize; |
2550 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize; | 2556 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize; |
2551 static const int kWrapperOffset = kColumnOffsetOffset + kPointerSize; | 2557 static const int kWrapperOffset = kColumnOffsetOffset + kPointerSize; |
2552 static const int kTypeOffset = kWrapperOffset + kPointerSize; | 2558 static const int kTypeOffset = kWrapperOffset + kPointerSize; |
2553 static const int kSize = kTypeOffset + kPointerSize; | 2559 static const int kLineEndsOffset = kTypeOffset + kPointerSize; |
| 2560 static const int kSize = kLineEndsOffset + kPointerSize; |
2554 | 2561 |
2555 private: | 2562 private: |
2556 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); | 2563 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); |
2557 }; | 2564 }; |
2558 | 2565 |
2559 | 2566 |
2560 // SharedFunctionInfo describes the JSFunction information that can be | 2567 // SharedFunctionInfo describes the JSFunction information that can be |
2561 // shared by multiple instances of the function. | 2568 // shared by multiple instances of the function. |
2562 class SharedFunctionInfo: public HeapObject { | 2569 class SharedFunctionInfo: public HeapObject { |
2563 public: | 2570 public: |
(...skipping 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4220 } else { | 4227 } else { |
4221 value &= ~(1 << bit_position); | 4228 value &= ~(1 << bit_position); |
4222 } | 4229 } |
4223 return value; | 4230 return value; |
4224 } | 4231 } |
4225 }; | 4232 }; |
4226 | 4233 |
4227 } } // namespace v8::internal | 4234 } } // namespace v8::internal |
4228 | 4235 |
4229 #endif // V8_OBJECTS_H_ | 4236 #endif // V8_OBJECTS_H_ |
OLD | NEW |