OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 stream->Add("InstanceofStub%s%s%s", | 240 stream->Add("InstanceofStub%s%s%s", |
241 args, | 241 args, |
242 inline_check, | 242 inline_check, |
243 return_true_false_object); | 243 return_true_false_object); |
244 } | 244 } |
245 | 245 |
246 | 246 |
247 void KeyedLoadElementStub::Generate(MacroAssembler* masm) { | 247 void KeyedLoadElementStub::Generate(MacroAssembler* masm) { |
248 switch (elements_kind_) { | 248 switch (elements_kind_) { |
249 case FAST_ELEMENTS: | 249 case FAST_ELEMENTS: |
| 250 case FAST_SMI_ONLY_ELEMENTS: |
250 KeyedLoadStubCompiler::GenerateLoadFastElement(masm); | 251 KeyedLoadStubCompiler::GenerateLoadFastElement(masm); |
251 break; | 252 break; |
252 case FAST_DOUBLE_ELEMENTS: | 253 case FAST_DOUBLE_ELEMENTS: |
253 KeyedLoadStubCompiler::GenerateLoadFastDoubleElement(masm); | 254 KeyedLoadStubCompiler::GenerateLoadFastDoubleElement(masm); |
254 break; | 255 break; |
255 case EXTERNAL_BYTE_ELEMENTS: | 256 case EXTERNAL_BYTE_ELEMENTS: |
256 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: | 257 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: |
257 case EXTERNAL_SHORT_ELEMENTS: | 258 case EXTERNAL_SHORT_ELEMENTS: |
258 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: | 259 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: |
259 case EXTERNAL_INT_ELEMENTS: | 260 case EXTERNAL_INT_ELEMENTS: |
260 case EXTERNAL_UNSIGNED_INT_ELEMENTS: | 261 case EXTERNAL_UNSIGNED_INT_ELEMENTS: |
261 case EXTERNAL_FLOAT_ELEMENTS: | 262 case EXTERNAL_FLOAT_ELEMENTS: |
262 case EXTERNAL_DOUBLE_ELEMENTS: | 263 case EXTERNAL_DOUBLE_ELEMENTS: |
263 case EXTERNAL_PIXEL_ELEMENTS: | 264 case EXTERNAL_PIXEL_ELEMENTS: |
264 KeyedLoadStubCompiler::GenerateLoadExternalArray(masm, elements_kind_); | 265 KeyedLoadStubCompiler::GenerateLoadExternalArray(masm, elements_kind_); |
265 break; | 266 break; |
266 case DICTIONARY_ELEMENTS: | 267 case DICTIONARY_ELEMENTS: |
267 KeyedLoadStubCompiler::GenerateLoadDictionaryElement(masm); | 268 KeyedLoadStubCompiler::GenerateLoadDictionaryElement(masm); |
268 break; | 269 break; |
269 case NON_STRICT_ARGUMENTS_ELEMENTS: | 270 case NON_STRICT_ARGUMENTS_ELEMENTS: |
270 UNREACHABLE(); | 271 UNREACHABLE(); |
271 break; | 272 break; |
272 } | 273 } |
273 } | 274 } |
274 | 275 |
275 | 276 |
276 void KeyedStoreElementStub::Generate(MacroAssembler* masm) { | 277 void KeyedStoreElementStub::Generate(MacroAssembler* masm) { |
277 switch (elements_kind_) { | 278 switch (elements_kind_) { |
278 case FAST_ELEMENTS: | 279 case FAST_ELEMENTS: |
279 KeyedStoreStubCompiler::GenerateStoreFastElement(masm, is_js_array_); | 280 case FAST_SMI_ONLY_ELEMENTS: { |
| 281 KeyedStoreStubCompiler::StoreObjectAction store_object_action = |
| 282 elements_kind_ == FAST_SMI_ONLY_ELEMENTS |
| 283 ? KeyedStoreStubCompiler::kObjectStoreForcesGeneric |
| 284 : KeyedStoreStubCompiler::kObjectStoreCausesWriteBarrier; |
| 285 KeyedStoreStubCompiler::GenerateStoreFastElement(masm, |
| 286 is_js_array_, |
| 287 store_object_action); |
| 288 } |
280 break; | 289 break; |
281 case FAST_DOUBLE_ELEMENTS: | 290 case FAST_DOUBLE_ELEMENTS: |
282 KeyedStoreStubCompiler::GenerateStoreFastDoubleElement(masm, | 291 KeyedStoreStubCompiler::GenerateStoreFastDoubleElement(masm, |
283 is_js_array_); | 292 is_js_array_); |
284 break; | 293 break; |
285 case EXTERNAL_BYTE_ELEMENTS: | 294 case EXTERNAL_BYTE_ELEMENTS: |
286 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: | 295 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: |
287 case EXTERNAL_SHORT_ELEMENTS: | 296 case EXTERNAL_SHORT_ELEMENTS: |
288 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: | 297 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: |
289 case EXTERNAL_INT_ELEMENTS: | 298 case EXTERNAL_INT_ELEMENTS: |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 } | 412 } |
404 | 413 |
405 | 414 |
406 bool ToBooleanStub::Types::CanBeUndetectable() const { | 415 bool ToBooleanStub::Types::CanBeUndetectable() const { |
407 return Contains(ToBooleanStub::SPEC_OBJECT) | 416 return Contains(ToBooleanStub::SPEC_OBJECT) |
408 || Contains(ToBooleanStub::STRING); | 417 || Contains(ToBooleanStub::STRING); |
409 } | 418 } |
410 | 419 |
411 | 420 |
412 } } // namespace v8::internal | 421 } } // namespace v8::internal |
OLD | NEW |