Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: src/accessors.cc

Issue 111001: Added context information to scripts (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 301
302 302
303 const AccessorDescriptor Accessors::ScriptLineEnds = { 303 const AccessorDescriptor Accessors::ScriptLineEnds = {
304 ScriptGetLineEnds, 304 ScriptGetLineEnds,
305 IllegalSetter, 305 IllegalSetter,
306 0 306 0
307 }; 307 };
308 308
309 309
310 // 310 //
311 // Accessors::ScriptGetContextData
312 //
313
314
315 Object* Accessors::ScriptGetContextData(Object* object, void*) {
316 HandleScope scope;
317 Handle<Script> script(Script::cast(JSValue::cast(object)->value()));
318 return script->context_data();
319 }
320
321
322 const AccessorDescriptor Accessors::ScriptContextData = {
323 ScriptGetContextData,
324 IllegalSetter,
325 0
326 };
327
328
329 //
311 // Accessors::FunctionPrototype 330 // Accessors::FunctionPrototype
312 // 331 //
313 332
314 333
315 Object* Accessors::FunctionGetPrototype(Object* object, void*) { 334 Object* Accessors::FunctionGetPrototype(Object* object, void*) {
316 bool found_it = false; 335 bool found_it = false;
317 JSFunction* function = FindInPrototypeChain<JSFunction>(object, &found_it); 336 JSFunction* function = FindInPrototypeChain<JSFunction>(object, &found_it);
318 if (!found_it) return Heap::undefined_value(); 337 if (!found_it) return Heap::undefined_value();
319 if (!function->has_prototype()) { 338 if (!function->has_prototype()) {
320 Object* prototype = Heap::AllocateFunctionPrototype(function); 339 Object* prototype = Heap::AllocateFunctionPrototype(function);
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 } 576 }
558 577
559 578
560 const AccessorDescriptor Accessors::ObjectPrototype = { 579 const AccessorDescriptor Accessors::ObjectPrototype = {
561 ObjectGetPrototype, 580 ObjectGetPrototype,
562 ObjectSetPrototype, 581 ObjectSetPrototype,
563 0 582 0
564 }; 583 };
565 584
566 } } // namespace v8::internal 585 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/accessors.h ('k') | src/bootstrapper.cc » ('j') | src/mirror-delay.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698