Chromium Code Reviews

Side by Side Diff: src/factory.cc

Issue 13958007: First cut at API for ES6 ArrayBuffers (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: added delete[] Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1026 matching lines...)
1037 void Factory::EnsureCanContainElements(Handle<JSArray> array, 1037 void Factory::EnsureCanContainElements(Handle<JSArray> array,
1038 Handle<FixedArrayBase> elements, 1038 Handle<FixedArrayBase> elements,
1039 uint32_t length, 1039 uint32_t length,
1040 EnsureElementsMode mode) { 1040 EnsureElementsMode mode) {
1041 CALL_HEAP_FUNCTION_VOID( 1041 CALL_HEAP_FUNCTION_VOID(
1042 isolate(), 1042 isolate(),
1043 array->EnsureCanContainElements(*elements, length, mode)); 1043 array->EnsureCanContainElements(*elements, length, mode));
1044 } 1044 }
1045 1045
1046 1046
1047 Handle<JSArrayBuffer> Factory::NewJSArrayBuffer() {
1048 JSFunction* array_buffer_fun =
1049 isolate()->context()->native_context()->array_buffer_fun();
1050 CALL_HEAP_FUNCTION(
1051 isolate(),
1052 isolate()->heap()->AllocateJSObject(array_buffer_fun),
1053 JSArrayBuffer);
1054 }
1055
1056
1047 Handle<JSProxy> Factory::NewJSProxy(Handle<Object> handler, 1057 Handle<JSProxy> Factory::NewJSProxy(Handle<Object> handler,
1048 Handle<Object> prototype) { 1058 Handle<Object> prototype) {
1049 CALL_HEAP_FUNCTION( 1059 CALL_HEAP_FUNCTION(
1050 isolate(), 1060 isolate(),
1051 isolate()->heap()->AllocateJSProxy(*handler, *prototype), 1061 isolate()->heap()->AllocateJSProxy(*handler, *prototype),
1052 JSProxy); 1062 JSProxy);
1053 } 1063 }
1054 1064
1055 1065
1056 void Factory::BecomeJSObject(Handle<JSReceiver> object) { 1066 void Factory::BecomeJSObject(Handle<JSReceiver> object) {
(...skipping 427 matching lines...)
1484 return Handle<Object>::null(); 1494 return Handle<Object>::null();
1485 } 1495 }
1486 1496
1487 1497
1488 Handle<Object> Factory::ToBoolean(bool value) { 1498 Handle<Object> Factory::ToBoolean(bool value) {
1489 return value ? true_value() : false_value(); 1499 return value ? true_value() : false_value();
1490 } 1500 }
1491 1501
1492 1502
1493 } } // namespace v8::internal 1503 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine