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

Side by Side Diff: src/objects.cc

Issue 1358423002: [es6] Introduce spec compliant IsConstructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix stupid fuzzer failure (constructor bit set on sloppy/strict arguments). Fix MIPS/MIPS64 typos, … Created 5 years, 3 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 | « src/objects.h ('k') | src/objects-debug.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 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 10701 matching lines...) Expand 10 before | Expand all | Expand 10 after
10712 JSObject::OptimizeAsPrototype(Handle<JSObject>::cast(value), 10712 JSObject::OptimizeAsPrototype(Handle<JSObject>::cast(value),
10713 FAST_PROTOTYPE); 10713 FAST_PROTOTYPE);
10714 } 10714 }
10715 } 10715 }
10716 isolate->heap()->ClearInstanceofCache(); 10716 isolate->heap()->ClearInstanceofCache();
10717 } 10717 }
10718 10718
10719 10719
10720 void JSFunction::SetPrototype(Handle<JSFunction> function, 10720 void JSFunction::SetPrototype(Handle<JSFunction> function,
10721 Handle<Object> value) { 10721 Handle<Object> value) {
10722 DCHECK(function->should_have_prototype()); 10722 DCHECK(function->IsConstructor());
10723 Handle<Object> construct_prototype = value; 10723 Handle<Object> construct_prototype = value;
10724 10724
10725 // If the value is not a JSReceiver, store the value in the map's 10725 // If the value is not a JSReceiver, store the value in the map's
10726 // constructor field so it can be accessed. Also, set the prototype 10726 // constructor field so it can be accessed. Also, set the prototype
10727 // used for constructing objects to the original object prototype. 10727 // used for constructing objects to the original object prototype.
10728 // See ECMA-262 13.2.2. 10728 // See ECMA-262 13.2.2.
10729 if (!value->IsJSReceiver()) { 10729 if (!value->IsJSReceiver()) {
10730 // Copy the map so this does not affect unrelated functions. 10730 // Copy the map so this does not affect unrelated functions.
10731 // Remove map transitions because they point to maps with a 10731 // Remove map transitions because they point to maps with a
10732 // different prototype. 10732 // different prototype.
(...skipping 6036 matching lines...) Expand 10 before | Expand all | Expand 10 after
16769 if (cell->value() != *new_value) { 16769 if (cell->value() != *new_value) {
16770 cell->set_value(*new_value); 16770 cell->set_value(*new_value);
16771 Isolate* isolate = cell->GetIsolate(); 16771 Isolate* isolate = cell->GetIsolate();
16772 cell->dependent_code()->DeoptimizeDependentCodeGroup( 16772 cell->dependent_code()->DeoptimizeDependentCodeGroup(
16773 isolate, DependentCode::kPropertyCellChangedGroup); 16773 isolate, DependentCode::kPropertyCellChangedGroup);
16774 } 16774 }
16775 } 16775 }
16776 16776
16777 } // namespace internal 16777 } // namespace internal
16778 } // namespace v8 16778 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698