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

Side by Side Diff: src/execution.cc

Issue 165126: Merge r2642 to branches/1.1 (Closed) Base URL: http://v8.googlecode.com/svn/branches/1.1/
Patch Set: '' Created 11 years, 4 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/api.cc ('k') | no next file » | no next file with comments »
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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 Handle<Code> code; 72 Handle<Code> code;
73 if (construct) { 73 if (construct) {
74 JSConstructEntryStub stub; 74 JSConstructEntryStub stub;
75 code = stub.GetCode(); 75 code = stub.GetCode();
76 } else { 76 } else {
77 JSEntryStub stub; 77 JSEntryStub stub;
78 code = stub.GetCode(); 78 code = stub.GetCode();
79 } 79 }
80 80
81 // Convert calls on global objects to be calls on the global
82 // receiver instead to avoid having a 'this' pointer which refers
83 // directly to a global object.
84 if (receiver->IsGlobalObject()) {
85 Handle<GlobalObject> global = Handle<GlobalObject>::cast(receiver);
86 receiver = Handle<JSObject>(global->global_receiver());
87 }
88
81 { 89 {
82 // Save and restore context around invocation and block the 90 // Save and restore context around invocation and block the
83 // allocation of handles without explicit handle scopes. 91 // allocation of handles without explicit handle scopes.
84 SaveContext save; 92 SaveContext save;
85 NoHandleAllocation na; 93 NoHandleAllocation na;
86 JSEntryFunction entry = FUNCTION_CAST<JSEntryFunction>(code->entry()); 94 JSEntryFunction entry = FUNCTION_CAST<JSEntryFunction>(code->entry());
87 95
88 // Call the function through the right JS entry stub. 96 // Call the function through the right JS entry stub.
89 value = CALL_GENERATED_CODE(entry, func->code()->entry(), *func, 97 value = CALL_GENERATED_CODE(entry, func->code()->entry(), *func,
90 *receiver, argc, args); 98 *receiver, argc, args);
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 // All allocation spaces other than NEW_SPACE have the same effect. 636 // All allocation spaces other than NEW_SPACE have the same effect.
629 Heap::CollectGarbage(0, OLD_DATA_SPACE); 637 Heap::CollectGarbage(0, OLD_DATA_SPACE);
630 return v8::Undefined(); 638 return v8::Undefined();
631 } 639 }
632 640
633 641
634 static GCExtension kGCExtension; 642 static GCExtension kGCExtension;
635 v8::DeclareExtension kGCExtensionDeclaration(&kGCExtension); 643 v8::DeclareExtension kGCExtensionDeclaration(&kGCExtension);
636 644
637 } } // namespace v8::internal 645 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698