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

Side by Side Diff: src/bootstrapper.cc

Issue 18695004: Add internal fields to JSArrayBufferViews (JSTypedArray and JSDataView) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CR feedback Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « include/v8.h ('k') | src/objects.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1282 1282
1283 1283
1284 Handle<JSFunction> Genesis::InstallTypedArray( 1284 Handle<JSFunction> Genesis::InstallTypedArray(
1285 const char* name, ElementsKind elementsKind) { 1285 const char* name, ElementsKind elementsKind) {
1286 Handle<JSObject> global = Handle<JSObject>(native_context()->global_object()); 1286 Handle<JSObject> global = Handle<JSObject>(native_context()->global_object());
1287 Handle<JSFunction> result = InstallFunction(global, name, JS_TYPED_ARRAY_TYPE, 1287 Handle<JSFunction> result = InstallFunction(global, name, JS_TYPED_ARRAY_TYPE,
1288 JSTypedArray::kSize, isolate()->initial_object_prototype(), 1288 JSTypedArray::kSize, isolate()->initial_object_prototype(),
1289 Builtins::kIllegal, false, true); 1289 Builtins::kIllegal, false, true);
1290 1290
1291 Handle<Map> initial_map = isolate()->factory()->NewMap( 1291 Handle<Map> initial_map = isolate()->factory()->NewMap(
1292 JS_TYPED_ARRAY_TYPE, JSTypedArray::kSize, elementsKind); 1292 JS_TYPED_ARRAY_TYPE, JSTypedArray::kSizeWithInternalFields, elementsKind);
1293 result->set_initial_map(*initial_map); 1293 result->set_initial_map(*initial_map);
1294 initial_map->set_constructor(*result); 1294 initial_map->set_constructor(*result);
1295 return result; 1295 return result;
1296 } 1296 }
1297 1297
1298 1298
1299 void Genesis::InitializeExperimentalGlobal() { 1299 void Genesis::InitializeExperimentalGlobal() {
1300 Handle<JSObject> global = Handle<JSObject>(native_context()->global_object()); 1300 Handle<JSObject> global = Handle<JSObject>(native_context()->global_object());
1301 1301
1302 // TODO(mstarzinger): Move this into Genesis::InitializeGlobal once we no 1302 // TODO(mstarzinger): Move this into Genesis::InitializeGlobal once we no
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1366 Handle<JSFunction> double_fun = InstallTypedArray("Float64Array", 1366 Handle<JSFunction> double_fun = InstallTypedArray("Float64Array",
1367 EXTERNAL_DOUBLE_ELEMENTS); 1367 EXTERNAL_DOUBLE_ELEMENTS);
1368 native_context()->set_double_array_fun(*double_fun); 1368 native_context()->set_double_array_fun(*double_fun);
1369 Handle<JSFunction> uint8c_fun = InstallTypedArray("Uint8ClampedArray", 1369 Handle<JSFunction> uint8c_fun = InstallTypedArray("Uint8ClampedArray",
1370 EXTERNAL_PIXEL_ELEMENTS); 1370 EXTERNAL_PIXEL_ELEMENTS);
1371 native_context()->set_uint8c_array_fun(*uint8c_fun); 1371 native_context()->set_uint8c_array_fun(*uint8c_fun);
1372 1372
1373 Handle<JSFunction> data_view_fun = 1373 Handle<JSFunction> data_view_fun =
1374 InstallFunction( 1374 InstallFunction(
1375 global, "DataView", JS_DATA_VIEW_TYPE, 1375 global, "DataView", JS_DATA_VIEW_TYPE,
1376 JSDataView::kSize, 1376 JSDataView::kSizeWithInternalFields,
1377 isolate()->initial_object_prototype(), 1377 isolate()->initial_object_prototype(),
1378 Builtins::kIllegal, true, true); 1378 Builtins::kIllegal, true, true);
1379 native_context()->set_data_view_fun(*data_view_fun); 1379 native_context()->set_data_view_fun(*data_view_fun);
1380 } 1380 }
1381 1381
1382 if (FLAG_harmony_generators) { 1382 if (FLAG_harmony_generators) {
1383 // Create generator meta-objects and install them on the builtins object. 1383 // Create generator meta-objects and install them on the builtins object.
1384 Handle<JSObject> builtins(native_context()->builtins()); 1384 Handle<JSObject> builtins(native_context()->builtins());
1385 Handle<JSObject> generator_object_prototype = 1385 Handle<JSObject> generator_object_prototype =
1386 factory()->NewJSObject(isolate()->object_function(), TENURED); 1386 factory()->NewJSObject(isolate()->object_function(), TENURED);
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after
2665 return from + sizeof(NestingCounterType); 2665 return from + sizeof(NestingCounterType);
2666 } 2666 }
2667 2667
2668 2668
2669 // Called when the top-level V8 mutex is destroyed. 2669 // Called when the top-level V8 mutex is destroyed.
2670 void Bootstrapper::FreeThreadResources() { 2670 void Bootstrapper::FreeThreadResources() {
2671 ASSERT(!IsActive()); 2671 ASSERT(!IsActive());
2672 } 2672 }
2673 2673
2674 } } // namespace v8::internal 2674 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698