OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/factory.h" | 5 #include "src/factory.h" |
6 | 6 |
7 #include "src/allocation-site-scopes.h" | 7 #include "src/allocation-site-scopes.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 1924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1935 | 1935 |
1936 Handle<JSDataView> Factory::NewJSDataView(Handle<JSArrayBuffer> buffer, | 1936 Handle<JSDataView> Factory::NewJSDataView(Handle<JSArrayBuffer> buffer, |
1937 size_t byte_offset, | 1937 size_t byte_offset, |
1938 size_t byte_length) { | 1938 size_t byte_length) { |
1939 Handle<JSDataView> obj = NewJSDataView(); | 1939 Handle<JSDataView> obj = NewJSDataView(); |
1940 SetupArrayBufferView(isolate(), obj, buffer, byte_offset, byte_length); | 1940 SetupArrayBufferView(isolate(), obj, buffer, byte_offset, byte_length); |
1941 return obj; | 1941 return obj; |
1942 } | 1942 } |
1943 | 1943 |
1944 | 1944 |
| 1945 // ES6 section 9.5.15 ProxyCreate (target, handler) |
1945 Handle<JSProxy> Factory::NewJSProxy(Handle<JSReceiver> target, | 1946 Handle<JSProxy> Factory::NewJSProxy(Handle<JSReceiver> target, |
1946 Handle<JSReceiver> handler) { | 1947 Handle<JSReceiver> handler) { |
1947 // Allocate the proxy object. | 1948 // Allocate the proxy object. |
1948 Handle<Map> map; | 1949 Handle<Map> map; |
1949 if (target->IsCallable()) { | 1950 if (target->IsCallable()) { |
1950 if (target->IsConstructor()) { | 1951 if (target->IsConstructor()) { |
1951 map = Handle<Map>(isolate()->proxy_constructor_map()); | 1952 map = Handle<Map>(isolate()->proxy_constructor_map()); |
1952 } else { | 1953 } else { |
1953 map = Handle<Map>(isolate()->proxy_callable_map()); | 1954 map = Handle<Map>(isolate()->proxy_callable_map()); |
1954 } | 1955 } |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2322 } | 2323 } |
2323 | 2324 |
2324 | 2325 |
2325 Handle<Object> Factory::ToBoolean(bool value) { | 2326 Handle<Object> Factory::ToBoolean(bool value) { |
2326 return value ? true_value() : false_value(); | 2327 return value ? true_value() : false_value(); |
2327 } | 2328 } |
2328 | 2329 |
2329 | 2330 |
2330 } // namespace internal | 2331 } // namespace internal |
2331 } // namespace v8 | 2332 } // namespace v8 |
OLD | NEW |