OLD | NEW |
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 11 matching lines...) Expand all Loading... |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_CODE_STUBS_H_ | 28 #ifndef V8_CODE_STUBS_H_ |
29 #define V8_CODE_STUBS_H_ | 29 #define V8_CODE_STUBS_H_ |
30 | 30 |
31 #include "allocation.h" | 31 #include "allocation.h" |
| 32 #include "assembler.h" |
32 #include "globals.h" | 33 #include "globals.h" |
33 #include "codegen.h" | 34 #include "codegen.h" |
34 | 35 |
35 namespace v8 { | 36 namespace v8 { |
36 namespace internal { | 37 namespace internal { |
37 | 38 |
38 // List of code stubs used on all platforms. | 39 // List of code stubs used on all platforms. |
39 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \ | 40 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \ |
40 V(CallFunction) \ | 41 V(CallFunction) \ |
41 V(CallConstruct) \ | 42 V(CallConstruct) \ |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 virtual int GetStubFlags() { return -1; } | 254 virtual int GetStubFlags() { return -1; } |
254 | 255 |
255 protected: | 256 protected: |
256 // Generates the assembler code for the stub. | 257 // Generates the assembler code for the stub. |
257 virtual void Generate(MacroAssembler* masm) = 0; | 258 virtual void Generate(MacroAssembler* masm) = 0; |
258 }; | 259 }; |
259 | 260 |
260 | 261 |
261 enum StubFunctionMode { NOT_JS_FUNCTION_STUB_MODE, JS_FUNCTION_STUB_MODE }; | 262 enum StubFunctionMode { NOT_JS_FUNCTION_STUB_MODE, JS_FUNCTION_STUB_MODE }; |
262 | 263 |
| 264 |
263 struct CodeStubInterfaceDescriptor { | 265 struct CodeStubInterfaceDescriptor { |
264 CodeStubInterfaceDescriptor() | 266 CodeStubInterfaceDescriptor(); |
265 : register_param_count_(-1), | |
266 stack_parameter_count_(NULL), | |
267 function_mode_(NOT_JS_FUNCTION_STUB_MODE), | |
268 register_params_(NULL) { } | |
269 int register_param_count_; | 267 int register_param_count_; |
270 const Register* stack_parameter_count_; | 268 const Register* stack_parameter_count_; |
271 StubFunctionMode function_mode_; | 269 StubFunctionMode function_mode_; |
272 Register* register_params_; | 270 Register* register_params_; |
273 Address deoptimization_handler_; | 271 Address deoptimization_handler_; |
| 272 ExternalReference miss_handler_; |
274 | 273 |
275 int environment_length() const { | 274 int environment_length() const { |
276 if (stack_parameter_count_ != NULL) { | 275 if (stack_parameter_count_ != NULL) { |
277 return register_param_count_ + 1; | 276 return register_param_count_ + 1; |
278 } | 277 } |
279 return register_param_count_; | 278 return register_param_count_; |
280 } | 279 } |
281 }; | 280 }; |
282 | 281 |
283 | 282 |
284 class HydrogenCodeStub : public CodeStub { | 283 class HydrogenCodeStub : public CodeStub { |
285 public: | 284 public: |
286 // Retrieve the code for the stub. Generate the code if needed. | 285 enum InitializationState { |
287 virtual Handle<Code> GenerateCode() = 0; | 286 CODE_STUB_IS_NOT_MISS, |
| 287 CODE_STUB_IS_MISS |
| 288 }; |
| 289 |
| 290 explicit HydrogenCodeStub(InitializationState state) { |
| 291 is_miss_ = (state == CODE_STUB_IS_MISS); |
| 292 } |
288 | 293 |
289 virtual Code::Kind GetCodeKind() const { return Code::STUB; } | 294 virtual Code::Kind GetCodeKind() const { return Code::STUB; } |
290 | 295 |
291 CodeStubInterfaceDescriptor* GetInterfaceDescriptor(Isolate* isolate) { | 296 CodeStubInterfaceDescriptor* GetInterfaceDescriptor(Isolate* isolate) { |
292 return isolate->code_stub_interface_descriptor(MajorKey()); | 297 return isolate->code_stub_interface_descriptor(MajorKey()); |
293 } | 298 } |
294 | 299 |
| 300 bool IsMiss() { return is_miss_; } |
| 301 |
| 302 template<class SubClass> |
| 303 static Handle<Code> GetUninitialized(Isolate* isolate) { |
| 304 SubClass::GenerateAheadOfTime(isolate); |
| 305 return SubClass().GetCode(isolate); |
| 306 } |
| 307 |
295 virtual void InitializeInterfaceDescriptor( | 308 virtual void InitializeInterfaceDescriptor( |
296 Isolate* isolate, | 309 Isolate* isolate, |
297 CodeStubInterfaceDescriptor* descriptor) = 0; | 310 CodeStubInterfaceDescriptor* descriptor) = 0; |
| 311 |
| 312 // Retrieve the code for the stub. Generate the code if needed. |
| 313 virtual Handle<Code> GenerateCode() = 0; |
| 314 |
| 315 virtual int NotMissMinorKey() = 0; |
| 316 |
| 317 Handle<Code> GenerateLightweightMissCode(Isolate* isolate); |
| 318 |
| 319 private: |
| 320 class MinorKeyBits: public BitField<int, 0, kStubMinorKeyBits - 1> {}; |
| 321 class IsMissBits: public BitField<bool, kStubMinorKeyBits - 1, 1> {}; |
| 322 |
| 323 void GenerateLightweightMiss(MacroAssembler* masm); |
| 324 virtual int MinorKey() { |
| 325 return IsMissBits::encode(is_miss_) | |
| 326 MinorKeyBits::encode(NotMissMinorKey()); |
| 327 } |
| 328 |
| 329 bool is_miss_; |
298 }; | 330 }; |
299 | 331 |
300 | 332 |
301 // Helper interface to prepare to/restore after making runtime calls. | 333 // Helper interface to prepare to/restore after making runtime calls. |
302 class RuntimeCallHelper { | 334 class RuntimeCallHelper { |
303 public: | 335 public: |
304 virtual ~RuntimeCallHelper() {} | 336 virtual ~RuntimeCallHelper() {} |
305 | 337 |
306 virtual void BeforeCall(MacroAssembler* masm) const = 0; | 338 virtual void BeforeCall(MacroAssembler* masm) const = 0; |
307 | 339 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 COPY_ON_WRITE_ELEMENTS, | 492 COPY_ON_WRITE_ELEMENTS, |
461 CLONE_ANY_ELEMENTS, | 493 CLONE_ANY_ELEMENTS, |
462 LAST_CLONE_MODE = CLONE_ANY_ELEMENTS | 494 LAST_CLONE_MODE = CLONE_ANY_ELEMENTS |
463 }; | 495 }; |
464 | 496 |
465 static const int kFastCloneModeCount = LAST_CLONE_MODE + 1; | 497 static const int kFastCloneModeCount = LAST_CLONE_MODE + 1; |
466 | 498 |
467 FastCloneShallowArrayStub(Mode mode, | 499 FastCloneShallowArrayStub(Mode mode, |
468 AllocationSiteMode allocation_site_mode, | 500 AllocationSiteMode allocation_site_mode, |
469 int length) | 501 int length) |
470 : mode_(mode), | 502 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS), |
| 503 mode_(mode), |
471 allocation_site_mode_(allocation_site_mode), | 504 allocation_site_mode_(allocation_site_mode), |
472 length_((mode == COPY_ON_WRITE_ELEMENTS) ? 0 : length) { | 505 length_((mode == COPY_ON_WRITE_ELEMENTS) ? 0 : length) { |
473 ASSERT_GE(length_, 0); | 506 ASSERT_GE(length_, 0); |
474 ASSERT_LE(length_, kMaximumClonedLength); | 507 ASSERT_LE(length_, kMaximumClonedLength); |
475 } | 508 } |
476 | 509 |
477 Mode mode() const { return mode_; } | 510 Mode mode() const { return mode_; } |
478 int length() const { return length_; } | 511 int length() const { return length_; } |
479 AllocationSiteMode allocation_site_mode() const { | 512 AllocationSiteMode allocation_site_mode() const { |
480 return allocation_site_mode_; | 513 return allocation_site_mode_; |
(...skipping 25 matching lines...) Expand all Loading... |
506 int length_; | 539 int length_; |
507 | 540 |
508 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; | 541 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; |
509 class ModeBits: public BitField<Mode, 1, 4> {}; | 542 class ModeBits: public BitField<Mode, 1, 4> {}; |
510 class LengthBits: public BitField<int, 5, 4> {}; | 543 class LengthBits: public BitField<int, 5, 4> {}; |
511 // Ensure data fits within available bits. | 544 // Ensure data fits within available bits. |
512 STATIC_ASSERT(LAST_ALLOCATION_SITE_MODE == 1); | 545 STATIC_ASSERT(LAST_ALLOCATION_SITE_MODE == 1); |
513 STATIC_ASSERT(kFastCloneModeCount < 16); | 546 STATIC_ASSERT(kFastCloneModeCount < 16); |
514 STATIC_ASSERT(kMaximumClonedLength < 16); | 547 STATIC_ASSERT(kMaximumClonedLength < 16); |
515 Major MajorKey() { return FastCloneShallowArray; } | 548 Major MajorKey() { return FastCloneShallowArray; } |
516 int MinorKey() { | 549 int NotMissMinorKey() { |
517 return AllocationSiteModeBits::encode(allocation_site_mode_) | 550 return AllocationSiteModeBits::encode(allocation_site_mode_) |
518 | ModeBits::encode(mode_) | 551 | ModeBits::encode(mode_) |
519 | LengthBits::encode(length_); | 552 | LengthBits::encode(length_); |
520 } | 553 } |
521 }; | 554 }; |
522 | 555 |
523 | 556 |
524 class FastCloneShallowObjectStub : public HydrogenCodeStub { | 557 class FastCloneShallowObjectStub : public HydrogenCodeStub { |
525 public: | 558 public: |
526 // Maximum number of properties in copied object. | 559 // Maximum number of properties in copied object. |
527 static const int kMaximumClonedProperties = 6; | 560 static const int kMaximumClonedProperties = 6; |
528 | 561 |
529 explicit FastCloneShallowObjectStub(int length) : length_(length) { | 562 explicit FastCloneShallowObjectStub(int length) |
| 563 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS), |
| 564 length_(length) { |
530 ASSERT_GE(length_, 0); | 565 ASSERT_GE(length_, 0); |
531 ASSERT_LE(length_, kMaximumClonedProperties); | 566 ASSERT_LE(length_, kMaximumClonedProperties); |
532 } | 567 } |
533 | 568 |
534 int length() const { return length_; } | 569 int length() const { return length_; } |
535 | 570 |
536 virtual Handle<Code> GenerateCode(); | 571 virtual Handle<Code> GenerateCode(); |
537 | 572 |
538 virtual void InitializeInterfaceDescriptor( | 573 virtual void InitializeInterfaceDescriptor( |
539 Isolate* isolate, | 574 Isolate* isolate, |
540 CodeStubInterfaceDescriptor* descriptor); | 575 CodeStubInterfaceDescriptor* descriptor); |
541 | 576 |
542 private: | 577 private: |
543 int length_; | 578 int length_; |
544 | 579 |
545 Major MajorKey() { return FastCloneShallowObject; } | 580 Major MajorKey() { return FastCloneShallowObject; } |
546 int MinorKey() { return length_; } | 581 int NotMissMinorKey() { return length_; } |
547 | 582 |
548 DISALLOW_COPY_AND_ASSIGN(FastCloneShallowObjectStub); | 583 DISALLOW_COPY_AND_ASSIGN(FastCloneShallowObjectStub); |
549 }; | 584 }; |
550 | 585 |
551 | 586 |
552 class InstanceofStub: public PlatformCodeStub { | 587 class InstanceofStub: public PlatformCodeStub { |
553 public: | 588 public: |
554 enum Flags { | 589 enum Flags { |
555 kNoFlags = 0, | 590 kNoFlags = 0, |
556 kArgsInRegisters = 1 << 0, | 591 kArgsInRegisters = 1 << 0, |
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1284 bool previous_allow_; | 1319 bool previous_allow_; |
1285 | 1320 |
1286 DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope); | 1321 DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope); |
1287 }; | 1322 }; |
1288 | 1323 |
1289 | 1324 |
1290 class KeyedLoadDictionaryElementStub : public PlatformCodeStub { | 1325 class KeyedLoadDictionaryElementStub : public PlatformCodeStub { |
1291 public: | 1326 public: |
1292 KeyedLoadDictionaryElementStub() {} | 1327 KeyedLoadDictionaryElementStub() {} |
1293 | 1328 |
1294 Major MajorKey() { return KeyedLoadElement; } | |
1295 int MinorKey() { return DICTIONARY_ELEMENTS; } | |
1296 | |
1297 void Generate(MacroAssembler* masm); | 1329 void Generate(MacroAssembler* masm); |
1298 | 1330 |
1299 private: | 1331 private: |
| 1332 Major MajorKey() { return KeyedLoadElement; } |
| 1333 int MinorKey() { return DICTIONARY_ELEMENTS; } |
| 1334 |
1300 DISALLOW_COPY_AND_ASSIGN(KeyedLoadDictionaryElementStub); | 1335 DISALLOW_COPY_AND_ASSIGN(KeyedLoadDictionaryElementStub); |
1301 }; | 1336 }; |
1302 | 1337 |
1303 | 1338 |
1304 class KeyedLoadFastElementStub : public HydrogenCodeStub { | 1339 class KeyedLoadFastElementStub : public HydrogenCodeStub { |
1305 public: | 1340 public: |
1306 KeyedLoadFastElementStub(bool is_js_array, ElementsKind elements_kind) { | 1341 KeyedLoadFastElementStub(bool is_js_array, ElementsKind elements_kind) |
| 1342 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS) { |
1307 bit_field_ = ElementsKindBits::encode(elements_kind) | | 1343 bit_field_ = ElementsKindBits::encode(elements_kind) | |
1308 IsJSArrayBits::encode(is_js_array); | 1344 IsJSArrayBits::encode(is_js_array); |
1309 } | 1345 } |
1310 | 1346 |
1311 bool is_js_array() const { | 1347 bool is_js_array() const { |
1312 return IsJSArrayBits::decode(bit_field_); | 1348 return IsJSArrayBits::decode(bit_field_); |
1313 } | 1349 } |
1314 | 1350 |
1315 ElementsKind elements_kind() const { | 1351 ElementsKind elements_kind() const { |
1316 return ElementsKindBits::decode(bit_field_); | 1352 return ElementsKindBits::decode(bit_field_); |
1317 } | 1353 } |
1318 | 1354 |
1319 virtual Handle<Code> GenerateCode(); | 1355 virtual Handle<Code> GenerateCode(); |
1320 | 1356 |
1321 virtual void InitializeInterfaceDescriptor( | 1357 virtual void InitializeInterfaceDescriptor( |
1322 Isolate* isolate, | 1358 Isolate* isolate, |
1323 CodeStubInterfaceDescriptor* descriptor); | 1359 CodeStubInterfaceDescriptor* descriptor); |
1324 | 1360 |
1325 private: | 1361 private: |
| 1362 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
1326 class IsJSArrayBits: public BitField<bool, 8, 1> {}; | 1363 class IsJSArrayBits: public BitField<bool, 8, 1> {}; |
1327 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | |
1328 uint32_t bit_field_; | 1364 uint32_t bit_field_; |
1329 | 1365 |
1330 Major MajorKey() { return KeyedLoadElement; } | 1366 Major MajorKey() { return KeyedLoadElement; } |
1331 int MinorKey() { return bit_field_; } | 1367 int NotMissMinorKey() { return bit_field_; } |
1332 | 1368 |
1333 DISALLOW_COPY_AND_ASSIGN(KeyedLoadFastElementStub); | 1369 DISALLOW_COPY_AND_ASSIGN(KeyedLoadFastElementStub); |
1334 }; | 1370 }; |
1335 | 1371 |
1336 | 1372 |
1337 class KeyedStoreFastElementStub : public HydrogenCodeStub { | 1373 class KeyedStoreFastElementStub : public HydrogenCodeStub { |
1338 public: | 1374 public: |
1339 KeyedStoreFastElementStub(bool is_js_array, | 1375 KeyedStoreFastElementStub(bool is_js_array, |
1340 ElementsKind elements_kind, | 1376 ElementsKind elements_kind, |
1341 KeyedAccessStoreMode mode) { | 1377 KeyedAccessStoreMode mode) |
| 1378 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS) { |
1342 bit_field_ = ElementsKindBits::encode(elements_kind) | | 1379 bit_field_ = ElementsKindBits::encode(elements_kind) | |
1343 IsJSArrayBits::encode(is_js_array) | | 1380 IsJSArrayBits::encode(is_js_array) | |
1344 StoreModeBits::encode(mode); | 1381 StoreModeBits::encode(mode); |
1345 } | 1382 } |
1346 | 1383 |
1347 Major MajorKey() { return KeyedStoreElement; } | |
1348 int MinorKey() { return bit_field_; } | |
1349 | |
1350 bool is_js_array() const { | 1384 bool is_js_array() const { |
1351 return IsJSArrayBits::decode(bit_field_); | 1385 return IsJSArrayBits::decode(bit_field_); |
1352 } | 1386 } |
1353 | 1387 |
1354 ElementsKind elements_kind() const { | 1388 ElementsKind elements_kind() const { |
1355 return ElementsKindBits::decode(bit_field_); | 1389 return ElementsKindBits::decode(bit_field_); |
1356 } | 1390 } |
1357 | 1391 |
1358 KeyedAccessStoreMode store_mode() const { | 1392 KeyedAccessStoreMode store_mode() const { |
1359 return StoreModeBits::decode(bit_field_); | 1393 return StoreModeBits::decode(bit_field_); |
1360 } | 1394 } |
1361 | 1395 |
1362 virtual Handle<Code> GenerateCode(); | 1396 virtual Handle<Code> GenerateCode(); |
1363 | 1397 |
1364 virtual void InitializeInterfaceDescriptor( | 1398 virtual void InitializeInterfaceDescriptor( |
1365 Isolate* isolate, | 1399 Isolate* isolate, |
1366 CodeStubInterfaceDescriptor* descriptor); | 1400 CodeStubInterfaceDescriptor* descriptor); |
1367 | 1401 |
1368 private: | 1402 private: |
1369 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | 1403 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
1370 class StoreModeBits: public BitField<KeyedAccessStoreMode, 8, 4> {}; | 1404 class StoreModeBits: public BitField<KeyedAccessStoreMode, 8, 4> {}; |
1371 class IsJSArrayBits: public BitField<bool, 12, 1> {}; | 1405 class IsJSArrayBits: public BitField<bool, 12, 1> {}; |
1372 uint32_t bit_field_; | 1406 uint32_t bit_field_; |
1373 | 1407 |
| 1408 Major MajorKey() { return KeyedStoreElement; } |
| 1409 int NotMissMinorKey() { return bit_field_; } |
| 1410 |
1374 DISALLOW_COPY_AND_ASSIGN(KeyedStoreFastElementStub); | 1411 DISALLOW_COPY_AND_ASSIGN(KeyedStoreFastElementStub); |
1375 }; | 1412 }; |
1376 | 1413 |
1377 | 1414 |
1378 class TransitionElementsKindStub : public HydrogenCodeStub { | 1415 class TransitionElementsKindStub : public HydrogenCodeStub { |
1379 public: | 1416 public: |
1380 TransitionElementsKindStub(ElementsKind from_kind, | 1417 TransitionElementsKindStub(ElementsKind from_kind, |
1381 ElementsKind to_kind) { | 1418 ElementsKind to_kind) |
| 1419 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS) { |
1382 bit_field_ = FromKindBits::encode(from_kind) | | 1420 bit_field_ = FromKindBits::encode(from_kind) | |
1383 ToKindBits::encode(to_kind); | 1421 ToKindBits::encode(to_kind); |
1384 } | 1422 } |
1385 | 1423 |
1386 ElementsKind from_kind() const { | 1424 ElementsKind from_kind() const { |
1387 return FromKindBits::decode(bit_field_); | 1425 return FromKindBits::decode(bit_field_); |
1388 } | 1426 } |
1389 | 1427 |
1390 ElementsKind to_kind() const { | 1428 ElementsKind to_kind() const { |
1391 return ToKindBits::decode(bit_field_); | 1429 return ToKindBits::decode(bit_field_); |
1392 } | 1430 } |
1393 | 1431 |
1394 virtual Handle<Code> GenerateCode(); | 1432 virtual Handle<Code> GenerateCode(); |
1395 | 1433 |
1396 virtual void InitializeInterfaceDescriptor( | 1434 virtual void InitializeInterfaceDescriptor( |
1397 Isolate* isolate, | 1435 Isolate* isolate, |
1398 CodeStubInterfaceDescriptor* descriptor); | 1436 CodeStubInterfaceDescriptor* descriptor); |
1399 | 1437 |
1400 private: | 1438 private: |
1401 class FromKindBits: public BitField<ElementsKind, 8, 8> {}; | 1439 class FromKindBits: public BitField<ElementsKind, 8, 8> {}; |
1402 class ToKindBits: public BitField<ElementsKind, 0, 8> {}; | 1440 class ToKindBits: public BitField<ElementsKind, 0, 8> {}; |
1403 uint32_t bit_field_; | 1441 uint32_t bit_field_; |
1404 | 1442 |
1405 Major MajorKey() { return TransitionElementsKind; } | 1443 Major MajorKey() { return TransitionElementsKind; } |
1406 int MinorKey() { return bit_field_; } | 1444 int NotMissMinorKey() { return bit_field_; } |
1407 | 1445 |
1408 DISALLOW_COPY_AND_ASSIGN(TransitionElementsKindStub); | 1446 DISALLOW_COPY_AND_ASSIGN(TransitionElementsKindStub); |
1409 }; | 1447 }; |
1410 | 1448 |
1411 | 1449 |
1412 class ArrayNoArgumentConstructorStub : public HydrogenCodeStub { | 1450 class ArrayNoArgumentConstructorStub : public HydrogenCodeStub { |
1413 public: | 1451 public: |
1414 ArrayNoArgumentConstructorStub() { | 1452 ArrayNoArgumentConstructorStub() |
| 1453 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS) { |
1415 } | 1454 } |
1416 | 1455 |
1417 Major MajorKey() { return ArrayNoArgumentConstructor; } | |
1418 int MinorKey() { return 0; } | |
1419 | |
1420 virtual Handle<Code> GenerateCode(); | 1456 virtual Handle<Code> GenerateCode(); |
1421 | 1457 |
1422 virtual void InitializeInterfaceDescriptor( | 1458 virtual void InitializeInterfaceDescriptor( |
1423 Isolate* isolate, | 1459 Isolate* isolate, |
1424 CodeStubInterfaceDescriptor* descriptor); | 1460 CodeStubInterfaceDescriptor* descriptor); |
1425 | 1461 |
1426 private: | 1462 private: |
| 1463 Major MajorKey() { return ArrayNoArgumentConstructor; } |
| 1464 int NotMissMinorKey() { return 0; } |
| 1465 |
1427 DISALLOW_COPY_AND_ASSIGN(ArrayNoArgumentConstructorStub); | 1466 DISALLOW_COPY_AND_ASSIGN(ArrayNoArgumentConstructorStub); |
1428 }; | 1467 }; |
1429 | 1468 |
1430 | 1469 |
1431 class ArraySingleArgumentConstructorStub : public HydrogenCodeStub { | 1470 class ArraySingleArgumentConstructorStub : public HydrogenCodeStub { |
1432 public: | 1471 public: |
1433 ArraySingleArgumentConstructorStub() { | 1472 ArraySingleArgumentConstructorStub() |
1434 } | 1473 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS) {} |
1435 | |
1436 Major MajorKey() { return ArraySingleArgumentConstructor; } | |
1437 int MinorKey() { return 0; } | |
1438 | 1474 |
1439 virtual Handle<Code> GenerateCode(); | 1475 virtual Handle<Code> GenerateCode(); |
1440 | 1476 |
1441 virtual void InitializeInterfaceDescriptor( | 1477 virtual void InitializeInterfaceDescriptor( |
1442 Isolate* isolate, | 1478 Isolate* isolate, |
1443 CodeStubInterfaceDescriptor* descriptor); | 1479 CodeStubInterfaceDescriptor* descriptor); |
1444 | 1480 |
1445 private: | 1481 private: |
| 1482 Major MajorKey() { return ArraySingleArgumentConstructor; } |
| 1483 int NotMissMinorKey() { return 0; } |
| 1484 |
1446 DISALLOW_COPY_AND_ASSIGN(ArraySingleArgumentConstructorStub); | 1485 DISALLOW_COPY_AND_ASSIGN(ArraySingleArgumentConstructorStub); |
1447 }; | 1486 }; |
1448 | 1487 |
1449 | 1488 |
1450 class ArrayNArgumentsConstructorStub : public HydrogenCodeStub { | 1489 class ArrayNArgumentsConstructorStub : public HydrogenCodeStub { |
1451 public: | 1490 public: |
1452 ArrayNArgumentsConstructorStub() { | 1491 ArrayNArgumentsConstructorStub() |
1453 } | 1492 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS) {} |
1454 | |
1455 Major MajorKey() { return ArrayNArgumentsConstructor; } | |
1456 int MinorKey() { return 0; } | |
1457 | 1493 |
1458 virtual Handle<Code> GenerateCode(); | 1494 virtual Handle<Code> GenerateCode(); |
1459 | 1495 |
1460 virtual void InitializeInterfaceDescriptor( | 1496 virtual void InitializeInterfaceDescriptor( |
1461 Isolate* isolate, | 1497 Isolate* isolate, |
1462 CodeStubInterfaceDescriptor* descriptor); | 1498 CodeStubInterfaceDescriptor* descriptor); |
1463 | 1499 |
1464 private: | 1500 private: |
| 1501 Major MajorKey() { return ArrayNArgumentsConstructor; } |
| 1502 int NotMissMinorKey() { return 0; } |
| 1503 |
1465 DISALLOW_COPY_AND_ASSIGN(ArrayNArgumentsConstructorStub); | 1504 DISALLOW_COPY_AND_ASSIGN(ArrayNArgumentsConstructorStub); |
1466 }; | 1505 }; |
1467 | 1506 |
1468 | 1507 |
1469 class KeyedStoreElementStub : public PlatformCodeStub { | 1508 class KeyedStoreElementStub : public PlatformCodeStub { |
1470 public: | 1509 public: |
1471 KeyedStoreElementStub(bool is_js_array, | 1510 KeyedStoreElementStub(bool is_js_array, |
1472 ElementsKind elements_kind, | 1511 ElementsKind elements_kind, |
1473 KeyedAccessStoreMode store_mode) | 1512 KeyedAccessStoreMode store_mode) |
1474 : is_js_array_(is_js_array), | 1513 : is_js_array_(is_js_array), |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1688 | 1727 |
1689 // The current function entry hook. | 1728 // The current function entry hook. |
1690 static FunctionEntryHook entry_hook_; | 1729 static FunctionEntryHook entry_hook_; |
1691 | 1730 |
1692 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 1731 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
1693 }; | 1732 }; |
1694 | 1733 |
1695 } } // namespace v8::internal | 1734 } } // namespace v8::internal |
1696 | 1735 |
1697 #endif // V8_CODE_STUBS_H_ | 1736 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |