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

Side by Side Diff: src/runtime.cc

Issue 230023002: Merged r20315 into 3.25 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.25
Patch Set: Fixed version and rebased. Created 6 years, 8 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 | « no previous file | src/version.cc » ('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 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 CONVERT_ARG_HANDLE_CHECKED(Object, byte_length_object, 4); 959 CONVERT_ARG_HANDLE_CHECKED(Object, byte_length_object, 4);
960 960
961 ASSERT(holder->GetInternalFieldCount() == 961 ASSERT(holder->GetInternalFieldCount() ==
962 v8::ArrayBufferView::kInternalFieldCount); 962 v8::ArrayBufferView::kInternalFieldCount);
963 for (int i = 0; i < v8::ArrayBufferView::kInternalFieldCount; i++) { 963 for (int i = 0; i < v8::ArrayBufferView::kInternalFieldCount; i++) {
964 holder->SetInternalField(i, Smi::FromInt(0)); 964 holder->SetInternalField(i, Smi::FromInt(0));
965 } 965 }
966 966
967 ExternalArrayType array_type = kExternalInt8Array; // Bogus initialization. 967 ExternalArrayType array_type = kExternalInt8Array; // Bogus initialization.
968 size_t element_size = 1; // Bogus initialization. 968 size_t element_size = 1; // Bogus initialization.
969 ElementsKind external_elements_kind = EXTERNAL_INT8_ELEMENTS; 969 ElementsKind external_elements_kind =
970 ElementsKind fixed_elements_kind = INT8_ELEMENTS; 970 EXTERNAL_INT8_ELEMENTS; // Bogus initialization.
971 ElementsKind fixed_elements_kind = INT8_ELEMENTS; // Bogus initialization.
971 Runtime::ArrayIdToTypeAndSize(arrayId, 972 Runtime::ArrayIdToTypeAndSize(arrayId,
972 &array_type, 973 &array_type,
973 &external_elements_kind, 974 &external_elements_kind,
974 &fixed_elements_kind, 975 &fixed_elements_kind,
975 &element_size); 976 &element_size);
976 977
977 holder->set_byte_offset(*byte_offset_object); 978 holder->set_byte_offset(*byte_offset_object);
978 holder->set_byte_length(*byte_length_object); 979 holder->set_byte_length(*byte_length_object);
979 980
980 size_t byte_offset = NumberToSize(isolate, *byte_offset_object); 981 size_t byte_offset = NumberToSize(isolate, *byte_offset_object);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 CONVERT_ARG_HANDLE_CHECKED(Object, length_obj, 3); 1038 CONVERT_ARG_HANDLE_CHECKED(Object, length_obj, 3);
1038 1039
1039 ASSERT(holder->GetInternalFieldCount() == 1040 ASSERT(holder->GetInternalFieldCount() ==
1040 v8::ArrayBufferView::kInternalFieldCount); 1041 v8::ArrayBufferView::kInternalFieldCount);
1041 for (int i = 0; i < v8::ArrayBufferView::kInternalFieldCount; i++) { 1042 for (int i = 0; i < v8::ArrayBufferView::kInternalFieldCount; i++) {
1042 holder->SetInternalField(i, Smi::FromInt(0)); 1043 holder->SetInternalField(i, Smi::FromInt(0));
1043 } 1044 }
1044 1045
1045 ExternalArrayType array_type = kExternalInt8Array; // Bogus initialization. 1046 ExternalArrayType array_type = kExternalInt8Array; // Bogus initialization.
1046 size_t element_size = 1; // Bogus initialization. 1047 size_t element_size = 1; // Bogus initialization.
1047 ElementsKind external_elements_kind; 1048 ElementsKind external_elements_kind =
1048 ElementsKind fixed_elements_kind; 1049 EXTERNAL_INT8_ELEMENTS; // Bogus intialization.
1050 ElementsKind fixed_elements_kind = INT8_ELEMENTS; // Bogus initialization.
1049 Runtime::ArrayIdToTypeAndSize(arrayId, 1051 Runtime::ArrayIdToTypeAndSize(arrayId,
1050 &array_type, 1052 &array_type,
1051 &external_elements_kind, 1053 &external_elements_kind,
1052 &fixed_elements_kind, 1054 &fixed_elements_kind,
1053 &element_size); 1055 &element_size);
1054 1056
1055 Handle<JSArrayBuffer> buffer = isolate->factory()->NewJSArrayBuffer(); 1057 Handle<JSArrayBuffer> buffer = isolate->factory()->NewJSArrayBuffer();
1056 if (source->IsJSTypedArray() && 1058 if (source->IsJSTypedArray() &&
1057 JSTypedArray::cast(*source)->type() == array_type) { 1059 JSTypedArray::cast(*source)->type() == array_type) {
1058 length_obj = Handle<Object>(JSTypedArray::cast(*source)->length(), isolate); 1060 length_obj = Handle<Object>(JSTypedArray::cast(*source)->length(), isolate);
(...skipping 14191 matching lines...) Expand 10 before | Expand all | Expand 10 after
15250 // Handle last resort GC and make sure to allow future allocations 15252 // Handle last resort GC and make sure to allow future allocations
15251 // to grow the heap without causing GCs (if possible). 15253 // to grow the heap without causing GCs (if possible).
15252 isolate->counters()->gc_last_resort_from_js()->Increment(); 15254 isolate->counters()->gc_last_resort_from_js()->Increment();
15253 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 15255 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
15254 "Runtime::PerformGC"); 15256 "Runtime::PerformGC");
15255 } 15257 }
15256 } 15258 }
15257 15259
15258 15260
15259 } } // namespace v8::internal 15261 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698