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

Side by Side Diff: src/factory.cc

Issue 15943002: v8 typed arrays: add DataView type (Closed)
Patch Set: v8 typed arrays: add DataView type, v2 Created 7 years, 6 months 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
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 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 Handle<JSArrayBuffer> Factory::NewJSArrayBuffer() { 1057 Handle<JSArrayBuffer> Factory::NewJSArrayBuffer() {
1058 JSFunction* array_buffer_fun = 1058 JSFunction* array_buffer_fun =
1059 isolate()->context()->native_context()->array_buffer_fun(); 1059 isolate()->context()->native_context()->array_buffer_fun();
1060 CALL_HEAP_FUNCTION( 1060 CALL_HEAP_FUNCTION(
1061 isolate(), 1061 isolate(),
1062 isolate()->heap()->AllocateJSObject(array_buffer_fun), 1062 isolate()->heap()->AllocateJSObject(array_buffer_fun),
1063 JSArrayBuffer); 1063 JSArrayBuffer);
1064 } 1064 }
1065 1065
1066 1066
1067 Handle<JSDataView> Factory::NewJSDataView() {
1068 JSFunction* data_view_fun =
1069 isolate()->context()->native_context()->data_view_fun();
1070 CALL_HEAP_FUNCTION(
1071 isolate(),
1072 isolate()->heap()->AllocateJSObject(data_view_fun),
1073 JSDataView);
1074 }
1075
1076
1067 Handle<JSTypedArray> Factory::NewJSTypedArray(ExternalArrayType type) { 1077 Handle<JSTypedArray> Factory::NewJSTypedArray(ExternalArrayType type) {
1068 JSFunction* typed_array_fun; 1078 JSFunction* typed_array_fun;
1069 Context* native_context = isolate()->context()->native_context(); 1079 Context* native_context = isolate()->context()->native_context();
1070 switch (type) { 1080 switch (type) {
1071 case kExternalUnsignedByteArray: 1081 case kExternalUnsignedByteArray:
1072 typed_array_fun = native_context->uint8_array_fun(); 1082 typed_array_fun = native_context->uint8_array_fun();
1073 break; 1083 break;
1074 1084
1075 case kExternalByteArray: 1085 case kExternalByteArray:
1076 typed_array_fun = native_context->int8_array_fun(); 1086 typed_array_fun = native_context->int8_array_fun();
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1556 return Handle<Object>::null(); 1566 return Handle<Object>::null();
1557 } 1567 }
1558 1568
1559 1569
1560 Handle<Object> Factory::ToBoolean(bool value) { 1570 Handle<Object> Factory::ToBoolean(bool value) {
1561 return value ? true_value() : false_value(); 1571 return value ? true_value() : false_value();
1562 } 1572 }
1563 1573
1564 1574
1565 } } // namespace v8::internal 1575 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698