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

Side by Side Diff: src/api-natives.cc

Issue 1467473002: Install ConstructNonConstructable as construct stub for non-constructables. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/builtins.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/api-natives.h" 5 #include "src/api-natives.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/isolate-inl.h" 8 #include "src/isolate-inl.h"
9 #include "src/lookup.h" 9 #include "src/lookup.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 } 432 }
433 NeanderArray array(list); 433 NeanderArray array(list);
434 array.add(isolate, property); 434 array.add(isolate, property);
435 } 435 }
436 436
437 437
438 Handle<JSFunction> ApiNatives::CreateApiFunction( 438 Handle<JSFunction> ApiNatives::CreateApiFunction(
439 Isolate* isolate, Handle<FunctionTemplateInfo> obj, 439 Isolate* isolate, Handle<FunctionTemplateInfo> obj,
440 Handle<Object> prototype, ApiInstanceType instance_type) { 440 Handle<Object> prototype, ApiInstanceType instance_type) {
441 Handle<Code> code = isolate->builtins()->HandleApiCall(); 441 Handle<Code> code = isolate->builtins()->HandleApiCall();
442 Handle<Code> construct_stub = isolate->builtins()->JSConstructStubApi(); 442 Handle<Code> construct_stub =
443 prototype.is_null() ? isolate->builtins()->ConstructedNonConstructable()
444 : isolate->builtins()->JSConstructStubApi();
443 445
444 obj->set_instantiated(true); 446 obj->set_instantiated(true);
445 Handle<JSFunction> result; 447 Handle<JSFunction> result;
446 if (obj->remove_prototype()) { 448 if (obj->remove_prototype()) {
447 result = isolate->factory()->NewFunctionWithoutPrototype( 449 result = isolate->factory()->NewFunctionWithoutPrototype(
448 isolate->factory()->empty_string(), code); 450 isolate->factory()->empty_string(), code);
449 } else { 451 } else {
450 int internal_field_count = 0; 452 int internal_field_count = 0;
451 if (!obj->instance_template()->IsUndefined()) { 453 if (!obj->instance_template()->IsUndefined()) {
452 Handle<ObjectTemplateInfo> instance_template = Handle<ObjectTemplateInfo>( 454 Handle<ObjectTemplateInfo> instance_template = Handle<ObjectTemplateInfo>(
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i))); 610 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i)));
609 JSObject::SetAccessor(result, accessor).Assert(); 611 JSObject::SetAccessor(result, accessor).Assert();
610 } 612 }
611 613
612 DCHECK(result->shared()->IsApiFunction()); 614 DCHECK(result->shared()->IsApiFunction());
613 return result; 615 return result;
614 } 616 }
615 617
616 } // namespace internal 618 } // namespace internal
617 } // namespace v8 619 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | src/builtins.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698