| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 | 245 |
| 246 | 246 |
| 247 const AccessorDescriptor Accessors::ScriptType = { | 247 const AccessorDescriptor Accessors::ScriptType = { |
| 248 ScriptGetType, | 248 ScriptGetType, |
| 249 IllegalSetter, | 249 IllegalSetter, |
| 250 0 | 250 0 |
| 251 }; | 251 }; |
| 252 | 252 |
| 253 | 253 |
| 254 // | 254 // |
| 255 // Accessors::ScriptGetLineEnds |
| 256 // |
| 257 |
| 258 |
| 259 Object* Accessors::ScriptGetLineEnds(Object* object, void*) { |
| 260 Object* script = JSValue::cast(object)->value(); |
| 261 Script::cast(script)->InitLineEnds(); |
| 262 return Script::cast(script)->line_ends(); |
| 263 } |
| 264 |
| 265 |
| 266 const AccessorDescriptor Accessors::ScriptLineEnds = { |
| 267 ScriptGetLineEnds, |
| 268 IllegalSetter, |
| 269 0 |
| 270 }; |
| 271 |
| 272 |
| 273 // |
| 255 // Accessors::FunctionPrototype | 274 // Accessors::FunctionPrototype |
| 256 // | 275 // |
| 257 | 276 |
| 258 | 277 |
| 259 Object* Accessors::FunctionGetPrototype(Object* object, void*) { | 278 Object* Accessors::FunctionGetPrototype(Object* object, void*) { |
| 260 bool found_it = false; | 279 bool found_it = false; |
| 261 JSFunction* function = FindInPrototypeChain<JSFunction>(object, &found_it); | 280 JSFunction* function = FindInPrototypeChain<JSFunction>(object, &found_it); |
| 262 if (!found_it) return Heap::undefined_value(); | 281 if (!found_it) return Heap::undefined_value(); |
| 263 if (!function->has_prototype()) { | 282 if (!function->has_prototype()) { |
| 264 Object* prototype = Heap::AllocateFunctionPrototype(function); | 283 Object* prototype = Heap::AllocateFunctionPrototype(function); |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 } | 520 } |
| 502 | 521 |
| 503 | 522 |
| 504 const AccessorDescriptor Accessors::ObjectPrototype = { | 523 const AccessorDescriptor Accessors::ObjectPrototype = { |
| 505 ObjectGetPrototype, | 524 ObjectGetPrototype, |
| 506 ObjectSetPrototype, | 525 ObjectSetPrototype, |
| 507 0 | 526 0 |
| 508 }; | 527 }; |
| 509 | 528 |
| 510 } } // namespace v8::internal | 529 } } // namespace v8::internal |
| OLD | NEW |