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

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

Issue 2436893003: [stubs] Cleanup CSA::BitFieldDecode() and friends. (Closed)
Patch Set: Addressing comments Created 4 years, 2 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
« no previous file with comments | « src/builtins/builtins-object.cc ('k') | src/code-stub-assembler.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 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 a->Bind(&not_smi); 45 a->Bind(&not_smi);
46 a->Branch(a->WordEqual(a->LoadInstanceType(tagged), 46 a->Branch(a->WordEqual(a->LoadInstanceType(tagged),
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 = a->BitFieldDecode<JSArrayBuffer::IsShared>( 55 Node* is_buffer_shared =
56 a->LoadObjectField(array_buffer, JSArrayBuffer::kBitFieldSlot)); 56 a->IsSetWord32<JSArrayBuffer::IsShared>(a->LoadObjectField(
57 array_buffer, JSArrayBuffer::kBitFieldSlot, MachineType::Uint32()));
57 a->Branch(is_buffer_shared, &is_shared, &not_shared); 58 a->Branch(is_buffer_shared, &is_shared, &not_shared);
58 a->Bind(&not_shared); 59 a->Bind(&not_shared);
59 a->Goto(&invalid); 60 a->Goto(&invalid);
60 61
61 // 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.
62 a->Bind(&is_shared); 63 a->Bind(&is_shared);
63 Node* elements_instance_type = a->LoadInstanceType( 64 Node* elements_instance_type = a->LoadInstanceType(
64 a->LoadObjectField(tagged, JSObject::kElementsOffset)); 65 a->LoadObjectField(tagged, JSObject::kElementsOffset));
65 STATIC_ASSERT(FIXED_INT8_ARRAY_TYPE < FIXED_FLOAT32_ARRAY_TYPE); 66 STATIC_ASSERT(FIXED_INT8_ARRAY_TYPE < FIXED_FLOAT32_ARRAY_TYPE);
66 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
257 a->WordShl(index_word, 2), value_word32); 258 a->WordShl(index_word, 2), value_word32);
258 a->Return(value_integer); 259 a->Return(value_integer);
259 260
260 // This shouldn't happen, we've already validated the type. 261 // This shouldn't happen, we've already validated the type.
261 a->Bind(&other); 262 a->Bind(&other);
262 a->Return(a->Int32Constant(0)); 263 a->Return(a->Int32Constant(0));
263 } 264 }
264 265
265 } // namespace internal 266 } // namespace internal
266 } // namespace v8 267 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-object.cc ('k') | src/code-stub-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698