OLD | NEW |
---|---|
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/builtins/builtins-utils.h" | 5 #include "src/builtins/builtins-utils.h" |
6 #include "src/builtins/builtins.h" | 6 #include "src/builtins/builtins.h" |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stub-assembler.h" | 8 #include "src/code-stub-assembler.h" |
9 #include "src/counters.h" | 9 #include "src/counters.h" |
10 #include "src/keys.h" | 10 #include "src/keys.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 BUILTIN(ObjectDefineProperty) { | 72 BUILTIN(ObjectDefineProperty) { |
73 HandleScope scope(isolate); | 73 HandleScope scope(isolate); |
74 DCHECK_EQ(4, args.length()); | 74 DCHECK_EQ(4, args.length()); |
75 Handle<Object> target = args.at(1); | 75 Handle<Object> target = args.at(1); |
76 Handle<Object> key = args.at(2); | 76 Handle<Object> key = args.at(2); |
77 Handle<Object> attributes = args.at(3); | 77 Handle<Object> attributes = args.at(3); |
78 | 78 |
79 return JSReceiver::DefineProperty(isolate, target, key, attributes); | 79 return JSReceiver::DefineProperty(isolate, target, key, attributes); |
80 } | 80 } |
81 | 81 |
82 BUILTIN(ObjectDefinePropertyWithoutInterceptors) { | |
Franzi
2017/04/12 08:58:17
Do we need this builtin?
| |
83 HandleScope scope(isolate); | |
84 DCHECK_EQ(4, args.length()); | |
85 Handle<Object> target = args.at(1); | |
86 Handle<Object> key = args.at(2); | |
87 Handle<Object> attributes = args.at(3); | |
88 | |
89 return JSReceiver::DefinePropertyWithoutInterceptors(isolate, target, key, | |
90 attributes); | |
91 } | |
92 | |
82 namespace { | 93 namespace { |
83 | 94 |
84 template <AccessorComponent which_accessor> | 95 template <AccessorComponent which_accessor> |
85 Object* ObjectDefineAccessor(Isolate* isolate, Handle<Object> object, | 96 Object* ObjectDefineAccessor(Isolate* isolate, Handle<Object> object, |
86 Handle<Object> name, Handle<Object> accessor) { | 97 Handle<Object> name, Handle<Object> accessor) { |
87 // 1. Let O be ? ToObject(this value). | 98 // 1. Let O be ? ToObject(this value). |
88 Handle<JSReceiver> receiver; | 99 Handle<JSReceiver> receiver; |
89 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, receiver, | 100 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, receiver, |
90 Object::ConvertReceiver(isolate, object)); | 101 Object::ConvertReceiver(isolate, object)); |
91 // 2. If IsCallable(getter) is false, throw a TypeError exception. | 102 // 2. If IsCallable(getter) is false, throw a TypeError exception. |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
545 if (object->IsJSReceiver()) { | 556 if (object->IsJSReceiver()) { |
546 MAYBE_RETURN(JSReceiver::SetIntegrityLevel(Handle<JSReceiver>::cast(object), | 557 MAYBE_RETURN(JSReceiver::SetIntegrityLevel(Handle<JSReceiver>::cast(object), |
547 SEALED, Object::THROW_ON_ERROR), | 558 SEALED, Object::THROW_ON_ERROR), |
548 isolate->heap()->exception()); | 559 isolate->heap()->exception()); |
549 } | 560 } |
550 return *object; | 561 return *object; |
551 } | 562 } |
552 | 563 |
553 } // namespace internal | 564 } // namespace internal |
554 } // namespace v8 | 565 } // namespace v8 |
OLD | NEW |