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

Side by Side Diff: src/builtins/builtins-sharedarraybuffer.cc

Issue 2470023003: Fix JSArrayBuffer is shared check for big endian. (Closed)
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/builtins/builtins.h" 5 #include "src/builtins/builtins.h"
6 #include "src/builtins/builtins-utils.h" 6 #include "src/builtins/builtins-utils.h"
7 7
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 a->Int32Constant(JS_TYPED_ARRAY_TYPE)), 47 a->Int32Constant(JS_TYPED_ARRAY_TYPE)),
48 &is_typed_array, &not_typed_array); 48 &is_typed_array, &not_typed_array);
49 a->Bind(&not_typed_array); 49 a->Bind(&not_typed_array);
50 a->Goto(&invalid); 50 a->Goto(&invalid);
51 51
52 // Fail if the array's JSArrayBuffer is not shared. 52 // Fail if the array's JSArrayBuffer is not shared.
53 a->Bind(&is_typed_array); 53 a->Bind(&is_typed_array);
54 Node* array_buffer = a->LoadObjectField(tagged, JSTypedArray::kBufferOffset); 54 Node* array_buffer = a->LoadObjectField(tagged, JSTypedArray::kBufferOffset);
55 Node* is_buffer_shared = 55 Node* is_buffer_shared =
56 a->IsSetWord32<JSArrayBuffer::IsShared>(a->LoadObjectField( 56 a->IsSetWord32<JSArrayBuffer::IsShared>(a->LoadObjectField(
57 array_buffer, JSArrayBuffer::kBitFieldSlot, MachineType::Uint32())); 57 array_buffer, JSArrayBuffer::kBitFieldOffset, MachineType::Uint32()));
58 a->Branch(is_buffer_shared, &is_shared, &not_shared); 58 a->Branch(is_buffer_shared, &is_shared, &not_shared);
59 a->Bind(&not_shared); 59 a->Bind(&not_shared);
60 a->Goto(&invalid); 60 a->Goto(&invalid);
61 61
62 // Fail if the array's element type is float32, float64 or clamped. 62 // Fail if the array's element type is float32, float64 or clamped.
63 a->Bind(&is_shared); 63 a->Bind(&is_shared);
64 Node* elements_instance_type = a->LoadInstanceType( 64 Node* elements_instance_type = a->LoadInstanceType(
65 a->LoadObjectField(tagged, JSObject::kElementsOffset)); 65 a->LoadObjectField(tagged, JSObject::kElementsOffset));
66 STATIC_ASSERT(FIXED_INT8_ARRAY_TYPE < FIXED_FLOAT32_ARRAY_TYPE); 66 STATIC_ASSERT(FIXED_INT8_ARRAY_TYPE < FIXED_FLOAT32_ARRAY_TYPE);
67 STATIC_ASSERT(FIXED_INT16_ARRAY_TYPE < FIXED_FLOAT32_ARRAY_TYPE); 67 STATIC_ASSERT(FIXED_INT16_ARRAY_TYPE < FIXED_FLOAT32_ARRAY_TYPE);
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 a->WordShl(index_word, 2), value_word32); 258 a->WordShl(index_word, 2), value_word32);
259 a->Return(value_integer); 259 a->Return(value_integer);
260 260
261 // This shouldn't happen, we've already validated the type. 261 // This shouldn't happen, we've already validated the type.
262 a->Bind(&other); 262 a->Bind(&other);
263 a->Return(a->Int32Constant(0)); 263 a->Return(a->Int32Constant(0));
264 } 264 }
265 265
266 } // namespace internal 266 } // namespace internal
267 } // namespace v8 267 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698