OLD | NEW |
---|---|
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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
431 info->set_property_accessors(*list); | 431 info->set_property_accessors(*list); |
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; |
442 if (obj->call_code()->IsCallHandlerInfo() && | |
443 !handle(CallHandlerInfo::cast(obj->call_code())) | |
Toon Verwaest
2015/11/18 08:51:46
Why is this wrapped in a handle before calling fas
epertoso
2015/11/20 15:27:13
Removed.
| |
444 ->fast_handler() | |
445 ->IsUndefined()) { | |
vogelheim
2015/11/18 17:30:05
nitpick: Why !..->IsUndefined(), instead of ...->I
epertoso
2015/11/20 15:27:13
Done.
| |
446 code = isolate->builtins()->HandleFastApiCall(); | |
447 } else { | |
448 code = isolate->builtins()->HandleApiCall(); | |
449 } | |
442 Handle<Code> construct_stub = isolate->builtins()->JSConstructStubApi(); | 450 Handle<Code> construct_stub = isolate->builtins()->JSConstructStubApi(); |
443 | 451 |
444 obj->set_instantiated(true); | 452 obj->set_instantiated(true); |
445 Handle<JSFunction> result; | 453 Handle<JSFunction> result; |
446 if (obj->remove_prototype()) { | 454 if (obj->remove_prototype()) { |
447 result = isolate->factory()->NewFunctionWithoutPrototype( | 455 result = isolate->factory()->NewFunctionWithoutPrototype( |
448 isolate->factory()->empty_string(), code); | 456 isolate->factory()->empty_string(), code); |
449 } else { | 457 } else { |
450 int internal_field_count = 0; | 458 int internal_field_count = 0; |
451 if (!obj->instance_template()->IsUndefined()) { | 459 if (!obj->instance_template()->IsUndefined()) { |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
608 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i))); | 616 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i))); |
609 JSObject::SetAccessor(result, accessor).Assert(); | 617 JSObject::SetAccessor(result, accessor).Assert(); |
610 } | 618 } |
611 | 619 |
612 DCHECK(result->shared()->IsApiFunction()); | 620 DCHECK(result->shared()->IsApiFunction()); |
613 return result; | 621 return result; |
614 } | 622 } |
615 | 623 |
616 } // namespace internal | 624 } // namespace internal |
617 } // namespace v8 | 625 } // namespace v8 |
OLD | NEW |