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

Side by Side Diff: src/code-stub-assembler.cc

Issue 2680153005: [builtins] Array.prototype.filter implemented as a TurboFan code stub. (Closed)
Patch Set: Code comments. Created 3 years, 9 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 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 #include "src/code-stub-assembler.h" 4 #include "src/code-stub-assembler.h"
5 #include "src/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/frames-inl.h" 6 #include "src/frames-inl.h"
7 #include "src/frames.h" 7 #include "src/frames.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 8062 matching lines...) Expand 10 before | Expand all | Expand 10 after
8073 Heap::kEmptyFixedArrayRootIndex); 8073 Heap::kEmptyFixedArrayRootIndex);
8074 StoreObjectFieldNoWriteBarrier(iterator, 8074 StoreObjectFieldNoWriteBarrier(iterator,
8075 JSArrayIterator::kIteratedObjectOffset, array); 8075 JSArrayIterator::kIteratedObjectOffset, array);
8076 StoreObjectFieldNoWriteBarrier(iterator, JSArrayIterator::kNextIndexOffset, 8076 StoreObjectFieldNoWriteBarrier(iterator, JSArrayIterator::kNextIndexOffset,
8077 SmiConstant(Smi::FromInt(0))); 8077 SmiConstant(Smi::FromInt(0)));
8078 StoreObjectFieldNoWriteBarrier( 8078 StoreObjectFieldNoWriteBarrier(
8079 iterator, JSArrayIterator::kIteratedObjectMapOffset, array_map); 8079 iterator, JSArrayIterator::kIteratedObjectMapOffset, array_map);
8080 return iterator; 8080 return iterator;
8081 } 8081 }
8082 8082
8083 Node* CodeStubAssembler::ArraySpeciesCreate(Node* context, Node* originalArray,
8084 Node* len) {
8085 // TODO(mvstanton): Install a fast path as well, which avoids the runtime
8086 // call.
8087 Node* constructor =
8088 CallRuntime(Runtime::kArraySpeciesConstructor, context, originalArray);
8089 return ConstructJS(CodeFactory::Construct(isolate()), context, constructor,
8090 len);
8091 }
8092
8083 Node* CodeStubAssembler::IsDetachedBuffer(Node* buffer) { 8093 Node* CodeStubAssembler::IsDetachedBuffer(Node* buffer) {
8084 CSA_ASSERT(this, HasInstanceType(buffer, JS_ARRAY_BUFFER_TYPE)); 8094 CSA_ASSERT(this, HasInstanceType(buffer, JS_ARRAY_BUFFER_TYPE));
8085 8095
8086 Node* buffer_bit_field = LoadObjectField( 8096 Node* buffer_bit_field = LoadObjectField(
8087 buffer, JSArrayBuffer::kBitFieldOffset, MachineType::Uint32()); 8097 buffer, JSArrayBuffer::kBitFieldOffset, MachineType::Uint32());
8088 return IsSetWord32<JSArrayBuffer::WasNeutered>(buffer_bit_field); 8098 return IsSetWord32<JSArrayBuffer::WasNeutered>(buffer_bit_field);
8089 } 8099 }
8090 8100
8091 CodeStubArguments::CodeStubArguments(CodeStubAssembler* assembler, Node* argc, 8101 CodeStubArguments::CodeStubArguments(CodeStubAssembler* assembler, Node* argc,
8092 Node* fp, 8102 Node* fp,
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
8277 formatted.c_str(), TENURED); 8287 formatted.c_str(), TENURED);
8278 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), 8288 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(),
8279 HeapConstant(string)); 8289 HeapConstant(string));
8280 } 8290 }
8281 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); 8291 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value);
8282 #endif 8292 #endif
8283 } 8293 }
8284 8294
8285 } // namespace internal 8295 } // namespace internal
8286 } // namespace v8 8296 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698