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

Side by Side Diff: src/objects.cc

Issue 1381543005: [cross-context] create new function prototypes in the context of the function (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: removing unused code Created 5 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
« no previous file with comments | « no previous file | test/mjsunit/cross-realm-filtering.js » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 10806 matching lines...) Expand 10 before | Expand all | Expand 10 after
10817 // Copy the map so this does not affect unrelated functions. 10817 // Copy the map so this does not affect unrelated functions.
10818 // Remove map transitions because they point to maps with a 10818 // Remove map transitions because they point to maps with a
10819 // different prototype. 10819 // different prototype.
10820 Handle<Map> new_map = Map::Copy(handle(function->map()), "SetPrototype"); 10820 Handle<Map> new_map = Map::Copy(handle(function->map()), "SetPrototype");
10821 10821
10822 JSObject::MigrateToMap(function, new_map); 10822 JSObject::MigrateToMap(function, new_map);
10823 new_map->SetConstructor(*value); 10823 new_map->SetConstructor(*value);
10824 new_map->set_non_instance_prototype(true); 10824 new_map->set_non_instance_prototype(true);
10825 Isolate* isolate = new_map->GetIsolate(); 10825 Isolate* isolate = new_map->GetIsolate();
10826 construct_prototype = handle( 10826 construct_prototype = handle(
10827 isolate->context()->native_context()->initial_object_prototype(), 10827 function->context()->native_context()->initial_object_prototype(),
10828 isolate); 10828 isolate);
10829 } else { 10829 } else {
10830 function->map()->set_non_instance_prototype(false); 10830 function->map()->set_non_instance_prototype(false);
10831 } 10831 }
10832 10832
10833 return SetInstancePrototype(function, construct_prototype); 10833 return SetInstancePrototype(function, construct_prototype);
10834 } 10834 }
10835 10835
10836 10836
10837 bool JSFunction::RemovePrototype() { 10837 bool JSFunction::RemovePrototype() {
(...skipping 6017 matching lines...) Expand 10 before | Expand all | Expand 10 after
16855 if (cell->value() != *new_value) { 16855 if (cell->value() != *new_value) {
16856 cell->set_value(*new_value); 16856 cell->set_value(*new_value);
16857 Isolate* isolate = cell->GetIsolate(); 16857 Isolate* isolate = cell->GetIsolate();
16858 cell->dependent_code()->DeoptimizeDependentCodeGroup( 16858 cell->dependent_code()->DeoptimizeDependentCodeGroup(
16859 isolate, DependentCode::kPropertyCellChangedGroup); 16859 isolate, DependentCode::kPropertyCellChangedGroup);
16860 } 16860 }
16861 } 16861 }
16862 16862
16863 } // namespace internal 16863 } // namespace internal
16864 } // namespace v8 16864 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/cross-realm-filtering.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698