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

Side by Side Diff: src/factory.cc

Issue 1417063011: [runtime] support new Proxy() instead of Proxy.create and install getPrototypeOf trap (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: removing unreachable code 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 | « src/factory.h ('k') | src/heap/heap.h » ('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 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 1919 matching lines...) Expand 10 before | Expand all | Expand 10 after
1930 Handle<JSDataView> Factory::NewJSDataView(Handle<JSArrayBuffer> buffer, 1930 Handle<JSDataView> Factory::NewJSDataView(Handle<JSArrayBuffer> buffer,
1931 size_t byte_offset, 1931 size_t byte_offset,
1932 size_t byte_length) { 1932 size_t byte_length) {
1933 Handle<JSDataView> obj = NewJSDataView(); 1933 Handle<JSDataView> obj = NewJSDataView();
1934 SetupArrayBufferView(isolate(), obj, buffer, byte_offset, byte_length); 1934 SetupArrayBufferView(isolate(), obj, buffer, byte_offset, byte_length);
1935 return obj; 1935 return obj;
1936 } 1936 }
1937 1937
1938 1938
1939 Handle<JSProxy> Factory::NewJSProxy(Handle<JSReceiver> target, 1939 Handle<JSProxy> Factory::NewJSProxy(Handle<JSReceiver> target,
1940 Handle<JSReceiver> handler, 1940 Handle<JSReceiver> handler) {
1941 Handle<Object> prototype) {
1942 // Allocate map. 1941 // Allocate map.
1943 // TODO(rossberg): Once we optimize proxies, think about a scheme to share 1942 // TODO(rossberg): Once we optimize proxies, think about a scheme to share
1944 // maps. Will probably depend on the identity of the handler object, too. 1943 // maps. Will probably depend on the identity of the handler object, too.
1945 Handle<Map> map = NewMap(JS_PROXY_TYPE, JSProxy::kSize); 1944 Handle<Map> map = NewMap(JS_PROXY_TYPE, JSProxy::kSize);
1946 Map::SetPrototype(map, prototype); 1945 Map::SetPrototype(map, null_value());
1947 1946
1948 // Allocate the proxy object. 1947 // Allocate the proxy object.
1949 Handle<JSProxy> result = New<JSProxy>(map, NEW_SPACE); 1948 Handle<JSProxy> result = New<JSProxy>(map, NEW_SPACE);
1950 result->set_target(*target); 1949 result->set_target(*target);
1951 result->set_handler(*handler); 1950 result->set_handler(*handler);
1952 result->set_hash(*undefined_value(), SKIP_WRITE_BARRIER); 1951 result->set_hash(*undefined_value(), SKIP_WRITE_BARRIER);
1953 return result; 1952 return result;
1954 } 1953 }
1955 1954
1956 1955
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
2335 } 2334 }
2336 2335
2337 2336
2338 Handle<Object> Factory::ToBoolean(bool value) { 2337 Handle<Object> Factory::ToBoolean(bool value) {
2339 return value ? true_value() : false_value(); 2338 return value ? true_value() : false_value();
2340 } 2339 }
2341 2340
2342 2341
2343 } // namespace internal 2342 } // namespace internal
2344 } // namespace v8 2343 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698