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

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: Rebase Created 5 years 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/arm/builtins-arm.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 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
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; 441 Handle<Code> code;
442 if (obj->call_code()->IsCallHandlerInfo() && 442 if (obj->call_code()->IsCallHandlerInfo() &&
443 CallHandlerInfo::cast(obj->call_code())->fast_handler()->IsCode()) { 443 CallHandlerInfo::cast(obj->call_code())->fast_handler()->IsCode()) {
444 code = isolate->builtins()->HandleFastApiCall(); 444 code = isolate->builtins()->HandleFastApiCall();
445 } else { 445 } else {
446 code = isolate->builtins()->HandleApiCall(); 446 code = isolate->builtins()->HandleApiCall();
447 } 447 }
448 Handle<Code> construct_stub = isolate->builtins()->JSConstructStubApi(); 448 Handle<Code> construct_stub =
449 prototype.is_null() ? isolate->builtins()->ConstructedNonConstructable()
450 : isolate->builtins()->JSConstructStubApi();
449 451
450 obj->set_instantiated(true); 452 obj->set_instantiated(true);
451 Handle<JSFunction> result; 453 Handle<JSFunction> result;
452 if (obj->remove_prototype()) { 454 if (obj->remove_prototype()) {
453 result = isolate->factory()->NewFunctionWithoutPrototype( 455 result = isolate->factory()->NewFunctionWithoutPrototype(
454 isolate->factory()->empty_string(), code); 456 isolate->factory()->empty_string(), code);
455 } else { 457 } else {
456 int internal_field_count = 0; 458 int internal_field_count = 0;
457 if (!obj->instance_template()->IsUndefined()) { 459 if (!obj->instance_template()->IsUndefined()) {
458 Handle<ObjectTemplateInfo> instance_template = Handle<ObjectTemplateInfo>( 460 Handle<ObjectTemplateInfo> instance_template = Handle<ObjectTemplateInfo>(
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i))); 616 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i)));
615 JSObject::SetAccessor(result, accessor).Assert(); 617 JSObject::SetAccessor(result, accessor).Assert();
616 } 618 }
617 619
618 DCHECK(result->shared()->IsApiFunction()); 620 DCHECK(result->shared()->IsApiFunction());
619 return result; 621 return result;
620 } 622 }
621 623
622 } // namespace internal 624 } // namespace internal
623 } // namespace v8 625 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/arm/builtins-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698