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

Side by Side Diff: src/hydrogen.h

Issue 14576005: Adapt hydrogen-based Array constructor to also support InternalArray and function call (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Adapt to bugfix for 244461 Created 7 years, 6 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 | « src/code-stubs-hydrogen.cc ('k') | src/hydrogen.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 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 void BuildNewSpaceArrayCheck(HValue* length, 1228 void BuildNewSpaceArrayCheck(HValue* length,
1229 ElementsKind kind); 1229 ElementsKind kind);
1230 1230
1231 class JSArrayBuilder { 1231 class JSArrayBuilder {
1232 public: 1232 public:
1233 JSArrayBuilder(HGraphBuilder* builder, 1233 JSArrayBuilder(HGraphBuilder* builder,
1234 ElementsKind kind, 1234 ElementsKind kind,
1235 HValue* allocation_site_payload, 1235 HValue* allocation_site_payload,
1236 AllocationSiteMode mode); 1236 AllocationSiteMode mode);
1237 1237
1238 JSArrayBuilder(HGraphBuilder* builder,
1239 ElementsKind kind,
1240 HValue* constructor_function);
1241
1238 HValue* AllocateEmptyArray(); 1242 HValue* AllocateEmptyArray();
1239 HValue* AllocateArray(HValue* capacity, HValue* length_field, 1243 HValue* AllocateArray(HValue* capacity, HValue* length_field,
1240 bool fill_with_hole); 1244 bool fill_with_hole);
1241 HValue* GetElementsLocation() { return elements_location_; } 1245 HValue* GetElementsLocation() { return elements_location_; }
1242 1246
1243 private: 1247 private:
1244 Zone* zone() const { return builder_->zone(); } 1248 Zone* zone() const { return builder_->zone(); }
1245 int elements_size() const { 1249 int elements_size() const {
1246 return IsFastDoubleElementsKind(kind_) ? kDoubleSize : kPointerSize; 1250 return IsFastDoubleElementsKind(kind_) ? kDoubleSize : kPointerSize;
1247 } 1251 }
1248 HInstruction* AddInstruction(HInstruction* instr) { 1252 HInstruction* AddInstruction(HInstruction* instr) {
1249 return builder_->AddInstruction(instr); 1253 return builder_->AddInstruction(instr);
1250 } 1254 }
1251 HGraphBuilder* builder() { return builder_; } 1255 HGraphBuilder* builder() { return builder_; }
1252 HGraph* graph() { return builder_->graph(); } 1256 HGraph* graph() { return builder_->graph(); }
1253 int initial_capacity() { 1257 int initial_capacity() {
1254 STATIC_ASSERT(JSArray::kPreallocatedArrayElements > 0); 1258 STATIC_ASSERT(JSArray::kPreallocatedArrayElements > 0);
1255 return JSArray::kPreallocatedArrayElements; 1259 return JSArray::kPreallocatedArrayElements;
1256 } 1260 }
1257 1261
1258 HValue* EmitMapCode(HValue* context); 1262 HValue* EmitMapCode(HValue* context);
1263 HValue* EmitInternalMapCode();
1259 HValue* EstablishEmptyArrayAllocationSize(); 1264 HValue* EstablishEmptyArrayAllocationSize();
1260 HValue* EstablishAllocationSize(HValue* length_node); 1265 HValue* EstablishAllocationSize(HValue* length_node);
1261 HValue* AllocateArray(HValue* size_in_bytes, HValue* capacity, 1266 HValue* AllocateArray(HValue* size_in_bytes, HValue* capacity,
1262 HValue* length_field, bool fill_with_hole); 1267 HValue* length_field, bool fill_with_hole);
1263 1268
1264 HGraphBuilder* builder_; 1269 HGraphBuilder* builder_;
1265 ElementsKind kind_; 1270 ElementsKind kind_;
1266 AllocationSiteMode mode_; 1271 AllocationSiteMode mode_;
1267 HValue* allocation_site_payload_; 1272 HValue* allocation_site_payload_;
1273 HValue* constructor_function_;
1268 HInnerAllocatedObject* elements_location_; 1274 HInnerAllocatedObject* elements_location_;
1269 }; 1275 };
1270 1276
1271 HValue* BuildAllocateElements(HValue* context, 1277 HValue* BuildAllocateElements(HValue* context,
1272 ElementsKind kind, 1278 ElementsKind kind,
1273 HValue* capacity); 1279 HValue* capacity);
1274 1280
1275 void BuildInitializeElementsHeader(HValue* elements, 1281 void BuildInitializeElementsHeader(HValue* elements,
1276 ElementsKind kind, 1282 ElementsKind kind,
1277 HValue* capacity); 1283 HValue* capacity);
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
1950 EmbeddedVector<char, 64> filename_; 1956 EmbeddedVector<char, 64> filename_;
1951 HeapStringAllocator string_allocator_; 1957 HeapStringAllocator string_allocator_;
1952 StringStream trace_; 1958 StringStream trace_;
1953 int indent_; 1959 int indent_;
1954 }; 1960 };
1955 1961
1956 1962
1957 } } // namespace v8::internal 1963 } } // namespace v8::internal
1958 1964
1959 #endif // V8_HYDROGEN_H_ 1965 #endif // V8_HYDROGEN_H_
OLDNEW
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698