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

Side by Side Diff: src/bootstrapper.cc

Issue 8333019: Make bound functions have poisoned .caller and .arguments. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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
« no previous file with comments | « src/accessors.cc ('k') | src/ic.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 515
516 Handle<DescriptorArray> Genesis::ComputeStrictFunctionInstanceDescriptor( 516 Handle<DescriptorArray> Genesis::ComputeStrictFunctionInstanceDescriptor(
517 PrototypePropertyMode prototypeMode, 517 PrototypePropertyMode prototypeMode,
518 Handle<FixedArray> arguments, 518 Handle<FixedArray> arguments,
519 Handle<FixedArray> caller) { 519 Handle<FixedArray> caller) {
520 Handle<DescriptorArray> descriptors = 520 Handle<DescriptorArray> descriptors =
521 factory()->NewDescriptorArray(prototypeMode == DONT_ADD_PROTOTYPE 521 factory()->NewDescriptorArray(prototypeMode == DONT_ADD_PROTOTYPE
522 ? 4 522 ? 4
523 : 5); 523 : 5);
524 PropertyAttributes attributes = static_cast<PropertyAttributes>( 524 PropertyAttributes attributes = static_cast<PropertyAttributes>(
525 DONT_ENUM | DONT_DELETE | READ_ONLY); 525 DONT_ENUM | DONT_DELETE);
526 526
527 { // length 527 { // length
528 Handle<Foreign> foreign = factory()->NewForeign(&Accessors::FunctionLength); 528 Handle<Foreign> foreign = factory()->NewForeign(&Accessors::FunctionLength);
529 CallbacksDescriptor d(*factory()->length_symbol(), *foreign, attributes); 529 CallbacksDescriptor d(*factory()->length_symbol(), *foreign, attributes);
530 descriptors->Set(0, &d); 530 descriptors->Set(0, &d);
531 } 531 }
532 { // name 532 { // name
533 Handle<Foreign> foreign = factory()->NewForeign(&Accessors::FunctionName); 533 Handle<Foreign> foreign = factory()->NewForeign(&Accessors::FunctionName);
534 CallbacksDescriptor d(*factory()->name_symbol(), *foreign, attributes); 534 CallbacksDescriptor d(*factory()->name_symbol(), *foreign, attributes);
535 descriptors->Set(1, &d); 535 descriptors->Set(1, &d);
536 } 536 }
537 { // arguments 537 { // arguments
538 CallbacksDescriptor d(*factory()->arguments_symbol(), 538 CallbacksDescriptor d(*factory()->arguments_symbol(),
539 *arguments, 539 *arguments,
540 attributes); 540 attributes);
541 descriptors->Set(2, &d); 541 descriptors->Set(2, &d);
542 } 542 }
543 { // caller 543 { // caller
544 CallbacksDescriptor d(*factory()->caller_symbol(), *caller, attributes); 544 CallbacksDescriptor d(*factory()->caller_symbol(), *caller, attributes);
545 descriptors->Set(3, &d); 545 descriptors->Set(3, &d);
546 } 546 }
547 547
548 // prototype 548 // prototype
549 if (prototypeMode != DONT_ADD_PROTOTYPE) { 549 if (prototypeMode != DONT_ADD_PROTOTYPE) {
550 if (prototypeMode == ADD_WRITEABLE_PROTOTYPE) { 550 if (prototypeMode != ADD_WRITEABLE_PROTOTYPE) {
551 attributes = static_cast<PropertyAttributes>(attributes & ~READ_ONLY); 551 attributes = static_cast<PropertyAttributes>(attributes | READ_ONLY);
552 } 552 }
553 Handle<Foreign> foreign = 553 Handle<Foreign> foreign =
554 factory()->NewForeign(&Accessors::FunctionPrototype); 554 factory()->NewForeign(&Accessors::FunctionPrototype);
555 CallbacksDescriptor d(*factory()->prototype_symbol(), *foreign, attributes); 555 CallbacksDescriptor d(*factory()->prototype_symbol(), *foreign, attributes);
556 descriptors->Set(4, &d); 556 descriptors->Set(4, &d);
557 } 557 }
558 558
559 descriptors->Sort(); 559 descriptors->Sort();
560 return descriptors; 560 return descriptors;
561 } 561 }
(...skipping 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after
2265 return from + sizeof(NestingCounterType); 2265 return from + sizeof(NestingCounterType);
2266 } 2266 }
2267 2267
2268 2268
2269 // Called when the top-level V8 mutex is destroyed. 2269 // Called when the top-level V8 mutex is destroyed.
2270 void Bootstrapper::FreeThreadResources() { 2270 void Bootstrapper::FreeThreadResources() {
2271 ASSERT(!IsActive()); 2271 ASSERT(!IsActive());
2272 } 2272 }
2273 2273
2274 } } // namespace v8::internal 2274 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/accessors.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698