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

Side by Side Diff: src/accessors.cc

Issue 551189: Propagate receiver from initial call site to code generator. (Closed)
Patch Set: Created 10 years, 11 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
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | src/compiler.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 486
487 Object* Accessors::FunctionGetLength(Object* object, void*) { 487 Object* Accessors::FunctionGetLength(Object* object, void*) {
488 bool found_it = false; 488 bool found_it = false;
489 JSFunction* function = FindInPrototypeChain<JSFunction>(object, &found_it); 489 JSFunction* function = FindInPrototypeChain<JSFunction>(object, &found_it);
490 if (!found_it) return Smi::FromInt(0); 490 if (!found_it) return Smi::FromInt(0);
491 // Check if already compiled. 491 // Check if already compiled.
492 if (!function->is_compiled()) { 492 if (!function->is_compiled()) {
493 // If the function isn't compiled yet, the length is not computed 493 // If the function isn't compiled yet, the length is not computed
494 // correctly yet. Compile it now and return the right length. 494 // correctly yet. Compile it now and return the right length.
495 HandleScope scope; 495 HandleScope scope;
496 Handle<JSFunction> function_handle(function); 496 Handle<SharedFunctionInfo> shared(function->shared());
497 if (!CompileLazy(function_handle, KEEP_EXCEPTION)) { 497 if (!CompileLazyShared(shared, KEEP_EXCEPTION)) {
498 return Failure::Exception(); 498 return Failure::Exception();
499 } 499 }
500 return Smi::FromInt(function_handle->shared()->length()); 500 return Smi::FromInt(shared->length());
501 } else { 501 } else {
502 return Smi::FromInt(function->shared()->length()); 502 return Smi::FromInt(function->shared()->length());
503 } 503 }
504 } 504 }
505 505
506 506
507 const AccessorDescriptor Accessors::FunctionLength = { 507 const AccessorDescriptor Accessors::FunctionLength = {
508 FunctionGetLength, 508 FunctionGetLength,
509 ReadOnlySetAccessor, 509 ReadOnlySetAccessor,
510 0 510 0
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 } 686 }
687 687
688 688
689 const AccessorDescriptor Accessors::ObjectPrototype = { 689 const AccessorDescriptor Accessors::ObjectPrototype = {
690 ObjectGetPrototype, 690 ObjectGetPrototype,
691 ObjectSetPrototype, 691 ObjectSetPrototype,
692 0 692 0
693 }; 693 };
694 694
695 } } // namespace v8::internal 695 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | src/compiler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698