Chromium Code Reviews| 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( |
| 297 Isolate* isolate) { | |
|
Jakob Kummerow
2013/04/18 17:43:07
unnecessary change?
danno
2013/04/19 06:47:41
Done.
| |
| 292 return isolate->code_stub_interface_descriptor(MajorKey()); | 298 return isolate->code_stub_interface_descriptor(MajorKey()); |
| 293 } | 299 } |
| 294 | 300 |
| 301 bool IsMiss() { return is_miss_; } | |
| 302 | |
| 303 template<class SubClass> | |
| 304 static Handle<Code> GetUninitialized(Isolate* isolate) { | |
| 305 SubClass::GenerateAheadOfTime(isolate); | |
| 306 return SubClass().GetCode(isolate); | |
| 307 } | |
| 308 | |
| 295 virtual void InitializeInterfaceDescriptor( | 309 virtual void InitializeInterfaceDescriptor( |
| 296 Isolate* isolate, | 310 Isolate* isolate, |
| 297 CodeStubInterfaceDescriptor* descriptor) = 0; | 311 CodeStubInterfaceDescriptor* descriptor) = 0; |
| 312 | |
| 313 // Retrieve the code for the stub. Generate the code if needed. | |
| 314 virtual Handle<Code> GenerateCode() = 0; | |
| 315 | |
| 316 virtual int NotMissMinorKey() = 0; | |
| 317 | |
| 318 Handle<Code> GenerateLightweightMissCode(Isolate* isolate); | |
| 319 | |
| 320 private: | |
| 321 class MinorKeyBits: public BitField<int, 0, kStubMinorKeyBits - 1> {}; | |
| 322 class IsMissBits: public BitField<bool, kStubMinorKeyBits - 1, 1> {}; | |
| 323 | |
| 324 void GenerateLightweightMiss(MacroAssembler* masm); | |
| 325 virtual int MinorKey() { | |
| 326 return IsMissBits::encode(is_miss_) | | |
| 327 MinorKeyBits::encode(NotMissMinorKey()); | |
| 328 } | |
| 329 | |
| 330 bool is_miss_; | |
| 298 }; | 331 }; |
| 299 | 332 |
| 300 | 333 |
| 301 // Helper interface to prepare to/restore after making runtime calls. | 334 // Helper interface to prepare to/restore after making runtime calls. |
| 302 class RuntimeCallHelper { | 335 class RuntimeCallHelper { |
| 303 public: | 336 public: |
| 304 virtual ~RuntimeCallHelper() {} | 337 virtual ~RuntimeCallHelper() {} |
| 305 | 338 |
| 306 virtual void BeforeCall(MacroAssembler* masm) const = 0; | 339 virtual void BeforeCall(MacroAssembler* masm) const = 0; |
| 307 | 340 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 460 COPY_ON_WRITE_ELEMENTS, | 493 COPY_ON_WRITE_ELEMENTS, |
| 461 CLONE_ANY_ELEMENTS, | 494 CLONE_ANY_ELEMENTS, |
| 462 LAST_CLONE_MODE = CLONE_ANY_ELEMENTS | 495 LAST_CLONE_MODE = CLONE_ANY_ELEMENTS |
| 463 }; | 496 }; |
| 464 | 497 |
| 465 static const int kFastCloneModeCount = LAST_CLONE_MODE + 1; | 498 static const int kFastCloneModeCount = LAST_CLONE_MODE + 1; |
| 466 | 499 |
| 467 FastCloneShallowArrayStub(Mode mode, | 500 FastCloneShallowArrayStub(Mode mode, |
| 468 AllocationSiteMode allocation_site_mode, | 501 AllocationSiteMode allocation_site_mode, |
| 469 int length) | 502 int length) |
| 470 : mode_(mode), | 503 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS), |
| 504 mode_(mode), | |
| 471 allocation_site_mode_(allocation_site_mode), | 505 allocation_site_mode_(allocation_site_mode), |
| 472 length_((mode == COPY_ON_WRITE_ELEMENTS) ? 0 : length) { | 506 length_((mode == COPY_ON_WRITE_ELEMENTS) ? 0 : length) { |
| 473 ASSERT_GE(length_, 0); | 507 ASSERT_GE(length_, 0); |
| 474 ASSERT_LE(length_, kMaximumClonedLength); | 508 ASSERT_LE(length_, kMaximumClonedLength); |
| 475 } | 509 } |
| 476 | 510 |
| 477 Mode mode() const { return mode_; } | 511 Mode mode() const { return mode_; } |
| 478 int length() const { return length_; } | 512 int length() const { return length_; } |
| 479 AllocationSiteMode allocation_site_mode() const { | 513 AllocationSiteMode allocation_site_mode() const { |
| 480 return allocation_site_mode_; | 514 return allocation_site_mode_; |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 506 int length_; | 540 int length_; |
| 507 | 541 |
| 508 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; | 542 class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {}; |
| 509 class ModeBits: public BitField<Mode, 1, 4> {}; | 543 class ModeBits: public BitField<Mode, 1, 4> {}; |
| 510 class LengthBits: public BitField<int, 5, 4> {}; | 544 class LengthBits: public BitField<int, 5, 4> {}; |
| 511 // Ensure data fits within available bits. | 545 // Ensure data fits within available bits. |
| 512 STATIC_ASSERT(LAST_ALLOCATION_SITE_MODE == 1); | 546 STATIC_ASSERT(LAST_ALLOCATION_SITE_MODE == 1); |
| 513 STATIC_ASSERT(kFastCloneModeCount < 16); | 547 STATIC_ASSERT(kFastCloneModeCount < 16); |
| 514 STATIC_ASSERT(kMaximumClonedLength < 16); | 548 STATIC_ASSERT(kMaximumClonedLength < 16); |
| 515 Major MajorKey() { return FastCloneShallowArray; } | 549 Major MajorKey() { return FastCloneShallowArray; } |
| 516 int MinorKey() { | 550 int NotMissMinorKey() { |
| 517 return AllocationSiteModeBits::encode(allocation_site_mode_) | 551 return AllocationSiteModeBits::encode(allocation_site_mode_) |
| 518 | ModeBits::encode(mode_) | 552 | ModeBits::encode(mode_) |
| 519 | LengthBits::encode(length_); | 553 | LengthBits::encode(length_); |
| 520 } | 554 } |
| 521 }; | 555 }; |
| 522 | 556 |
| 523 | 557 |
| 524 class FastCloneShallowObjectStub : public HydrogenCodeStub { | 558 class FastCloneShallowObjectStub : public HydrogenCodeStub { |
| 525 public: | 559 public: |
| 526 // Maximum number of properties in copied object. | 560 // Maximum number of properties in copied object. |
| 527 static const int kMaximumClonedProperties = 6; | 561 static const int kMaximumClonedProperties = 6; |
| 528 | 562 |
| 529 explicit FastCloneShallowObjectStub(int length) : length_(length) { | 563 explicit FastCloneShallowObjectStub(int length) |
| 564 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS), | |
| 565 length_(length) { | |
| 530 ASSERT_GE(length_, 0); | 566 ASSERT_GE(length_, 0); |
| 531 ASSERT_LE(length_, kMaximumClonedProperties); | 567 ASSERT_LE(length_, kMaximumClonedProperties); |
| 532 } | 568 } |
| 533 | 569 |
| 534 int length() const { return length_; } | 570 int length() const { return length_; } |
| 535 | 571 |
| 536 virtual Handle<Code> GenerateCode(); | 572 virtual Handle<Code> GenerateCode(); |
| 537 | 573 |
| 538 virtual void InitializeInterfaceDescriptor( | 574 virtual void InitializeInterfaceDescriptor( |
| 539 Isolate* isolate, | 575 Isolate* isolate, |
| 540 CodeStubInterfaceDescriptor* descriptor); | 576 CodeStubInterfaceDescriptor* descriptor); |
| 541 | 577 |
| 542 private: | 578 private: |
| 543 int length_; | 579 int length_; |
| 544 | 580 |
| 545 Major MajorKey() { return FastCloneShallowObject; } | 581 Major MajorKey() { return FastCloneShallowObject; } |
| 546 int MinorKey() { return length_; } | 582 int NotMissMinorKey() { return length_; } |
| 547 | 583 |
| 548 DISALLOW_COPY_AND_ASSIGN(FastCloneShallowObjectStub); | 584 DISALLOW_COPY_AND_ASSIGN(FastCloneShallowObjectStub); |
| 549 }; | 585 }; |
| 550 | 586 |
| 551 | 587 |
| 552 class InstanceofStub: public PlatformCodeStub { | 588 class InstanceofStub: public PlatformCodeStub { |
| 553 public: | 589 public: |
| 554 enum Flags { | 590 enum Flags { |
| 555 kNoFlags = 0, | 591 kNoFlags = 0, |
| 556 kArgsInRegisters = 1 << 0, | 592 kArgsInRegisters = 1 << 0, |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1284 bool previous_allow_; | 1320 bool previous_allow_; |
| 1285 | 1321 |
| 1286 DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope); | 1322 DISALLOW_COPY_AND_ASSIGN(AllowStubCallsScope); |
| 1287 }; | 1323 }; |
| 1288 | 1324 |
| 1289 | 1325 |
| 1290 class KeyedLoadDictionaryElementStub : public PlatformCodeStub { | 1326 class KeyedLoadDictionaryElementStub : public PlatformCodeStub { |
| 1291 public: | 1327 public: |
| 1292 KeyedLoadDictionaryElementStub() {} | 1328 KeyedLoadDictionaryElementStub() {} |
| 1293 | 1329 |
| 1294 Major MajorKey() { return KeyedLoadElement; } | |
| 1295 int MinorKey() { return DICTIONARY_ELEMENTS; } | |
| 1296 | |
| 1297 void Generate(MacroAssembler* masm); | 1330 void Generate(MacroAssembler* masm); |
| 1298 | 1331 |
| 1299 private: | 1332 private: |
| 1333 Major MajorKey() { return KeyedLoadElement; } | |
| 1334 int MinorKey() { return DICTIONARY_ELEMENTS; } | |
| 1335 | |
| 1300 DISALLOW_COPY_AND_ASSIGN(KeyedLoadDictionaryElementStub); | 1336 DISALLOW_COPY_AND_ASSIGN(KeyedLoadDictionaryElementStub); |
| 1301 }; | 1337 }; |
| 1302 | 1338 |
| 1303 | 1339 |
| 1304 class KeyedLoadFastElementStub : public HydrogenCodeStub { | 1340 class KeyedLoadFastElementStub : public HydrogenCodeStub { |
| 1305 public: | 1341 public: |
| 1306 KeyedLoadFastElementStub(bool is_js_array, ElementsKind elements_kind) { | 1342 KeyedLoadFastElementStub(bool is_js_array, ElementsKind elements_kind) |
| 1343 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS) { | |
| 1307 bit_field_ = ElementsKindBits::encode(elements_kind) | | 1344 bit_field_ = ElementsKindBits::encode(elements_kind) | |
| 1308 IsJSArrayBits::encode(is_js_array); | 1345 IsJSArrayBits::encode(is_js_array); |
| 1309 } | 1346 } |
| 1310 | 1347 |
| 1311 bool is_js_array() const { | 1348 bool is_js_array() const { |
| 1312 return IsJSArrayBits::decode(bit_field_); | 1349 return IsJSArrayBits::decode(bit_field_); |
| 1313 } | 1350 } |
| 1314 | 1351 |
| 1315 ElementsKind elements_kind() const { | 1352 ElementsKind elements_kind() const { |
| 1316 return ElementsKindBits::decode(bit_field_); | 1353 return ElementsKindBits::decode(bit_field_); |
| 1317 } | 1354 } |
| 1318 | 1355 |
| 1319 virtual Handle<Code> GenerateCode(); | 1356 virtual Handle<Code> GenerateCode(); |
| 1320 | 1357 |
| 1321 virtual void InitializeInterfaceDescriptor( | 1358 virtual void InitializeInterfaceDescriptor( |
| 1322 Isolate* isolate, | 1359 Isolate* isolate, |
| 1323 CodeStubInterfaceDescriptor* descriptor); | 1360 CodeStubInterfaceDescriptor* descriptor); |
| 1324 | 1361 |
| 1325 private: | 1362 private: |
| 1363 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | |
| 1326 class IsJSArrayBits: public BitField<bool, 8, 1> {}; | 1364 class IsJSArrayBits: public BitField<bool, 8, 1> {}; |
| 1327 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | |
| 1328 uint32_t bit_field_; | 1365 uint32_t bit_field_; |
| 1329 | 1366 |
| 1330 Major MajorKey() { return KeyedLoadElement; } | 1367 Major MajorKey() { return KeyedLoadElement; } |
| 1331 int MinorKey() { return bit_field_; } | 1368 int NotMissMinorKey() { return bit_field_; } |
| 1332 | 1369 |
| 1333 DISALLOW_COPY_AND_ASSIGN(KeyedLoadFastElementStub); | 1370 DISALLOW_COPY_AND_ASSIGN(KeyedLoadFastElementStub); |
| 1334 }; | 1371 }; |
| 1335 | 1372 |
| 1336 | 1373 |
| 1337 class KeyedStoreFastElementStub : public HydrogenCodeStub { | 1374 class KeyedStoreFastElementStub : public HydrogenCodeStub { |
| 1338 public: | 1375 public: |
| 1339 KeyedStoreFastElementStub(bool is_js_array, | 1376 KeyedStoreFastElementStub(bool is_js_array, |
| 1340 ElementsKind elements_kind, | 1377 ElementsKind elements_kind, |
| 1341 KeyedAccessStoreMode mode) { | 1378 KeyedAccessStoreMode mode) |
| 1379 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS) { | |
| 1342 bit_field_ = ElementsKindBits::encode(elements_kind) | | 1380 bit_field_ = ElementsKindBits::encode(elements_kind) | |
| 1343 IsJSArrayBits::encode(is_js_array) | | 1381 IsJSArrayBits::encode(is_js_array) | |
| 1344 StoreModeBits::encode(mode); | 1382 StoreModeBits::encode(mode); |
| 1345 } | 1383 } |
| 1346 | 1384 |
| 1347 Major MajorKey() { return KeyedStoreElement; } | |
| 1348 int MinorKey() { return bit_field_; } | |
| 1349 | |
| 1350 bool is_js_array() const { | 1385 bool is_js_array() const { |
| 1351 return IsJSArrayBits::decode(bit_field_); | 1386 return IsJSArrayBits::decode(bit_field_); |
| 1352 } | 1387 } |
| 1353 | 1388 |
| 1354 ElementsKind elements_kind() const { | 1389 ElementsKind elements_kind() const { |
| 1355 return ElementsKindBits::decode(bit_field_); | 1390 return ElementsKindBits::decode(bit_field_); |
| 1356 } | 1391 } |
| 1357 | 1392 |
| 1358 KeyedAccessStoreMode store_mode() const { | 1393 KeyedAccessStoreMode store_mode() const { |
| 1359 return StoreModeBits::decode(bit_field_); | 1394 return StoreModeBits::decode(bit_field_); |
| 1360 } | 1395 } |
| 1361 | 1396 |
| 1362 virtual Handle<Code> GenerateCode(); | 1397 virtual Handle<Code> GenerateCode(); |
| 1363 | 1398 |
| 1364 virtual void InitializeInterfaceDescriptor( | 1399 virtual void InitializeInterfaceDescriptor( |
| 1365 Isolate* isolate, | 1400 Isolate* isolate, |
| 1366 CodeStubInterfaceDescriptor* descriptor); | 1401 CodeStubInterfaceDescriptor* descriptor); |
| 1367 | 1402 |
| 1368 private: | 1403 private: |
| 1369 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | 1404 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
| 1370 class StoreModeBits: public BitField<KeyedAccessStoreMode, 8, 4> {}; | 1405 class StoreModeBits: public BitField<KeyedAccessStoreMode, 8, 4> {}; |
| 1371 class IsJSArrayBits: public BitField<bool, 12, 1> {}; | 1406 class IsJSArrayBits: public BitField<bool, 12, 1> {}; |
| 1372 uint32_t bit_field_; | 1407 uint32_t bit_field_; |
| 1373 | 1408 |
| 1409 Major MajorKey() { return KeyedStoreElement; } | |
| 1410 int NotMissMinorKey() { return bit_field_; } | |
| 1411 | |
| 1374 DISALLOW_COPY_AND_ASSIGN(KeyedStoreFastElementStub); | 1412 DISALLOW_COPY_AND_ASSIGN(KeyedStoreFastElementStub); |
| 1375 }; | 1413 }; |
| 1376 | 1414 |
| 1377 | 1415 |
| 1378 class TransitionElementsKindStub : public HydrogenCodeStub { | 1416 class TransitionElementsKindStub : public HydrogenCodeStub { |
| 1379 public: | 1417 public: |
| 1380 TransitionElementsKindStub(ElementsKind from_kind, | 1418 TransitionElementsKindStub(ElementsKind from_kind, |
| 1381 ElementsKind to_kind) { | 1419 ElementsKind to_kind) |
| 1420 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS) { | |
| 1382 bit_field_ = FromKindBits::encode(from_kind) | | 1421 bit_field_ = FromKindBits::encode(from_kind) | |
| 1383 ToKindBits::encode(to_kind); | 1422 ToKindBits::encode(to_kind); |
| 1384 } | 1423 } |
| 1385 | 1424 |
| 1386 ElementsKind from_kind() const { | 1425 ElementsKind from_kind() const { |
| 1387 return FromKindBits::decode(bit_field_); | 1426 return FromKindBits::decode(bit_field_); |
| 1388 } | 1427 } |
| 1389 | 1428 |
| 1390 ElementsKind to_kind() const { | 1429 ElementsKind to_kind() const { |
| 1391 return ToKindBits::decode(bit_field_); | 1430 return ToKindBits::decode(bit_field_); |
| 1392 } | 1431 } |
| 1393 | 1432 |
| 1394 virtual Handle<Code> GenerateCode(); | 1433 virtual Handle<Code> GenerateCode(); |
| 1395 | 1434 |
| 1396 virtual void InitializeInterfaceDescriptor( | 1435 virtual void InitializeInterfaceDescriptor( |
| 1397 Isolate* isolate, | 1436 Isolate* isolate, |
| 1398 CodeStubInterfaceDescriptor* descriptor); | 1437 CodeStubInterfaceDescriptor* descriptor); |
| 1399 | 1438 |
| 1400 private: | 1439 private: |
| 1401 class FromKindBits: public BitField<ElementsKind, 8, 8> {}; | 1440 class FromKindBits: public BitField<ElementsKind, 8, 8> {}; |
| 1402 class ToKindBits: public BitField<ElementsKind, 0, 8> {}; | 1441 class ToKindBits: public BitField<ElementsKind, 0, 8> {}; |
| 1403 uint32_t bit_field_; | 1442 uint32_t bit_field_; |
| 1404 | 1443 |
| 1405 Major MajorKey() { return TransitionElementsKind; } | 1444 Major MajorKey() { return TransitionElementsKind; } |
| 1406 int MinorKey() { return bit_field_; } | 1445 int NotMissMinorKey() { return bit_field_; } |
| 1407 | 1446 |
| 1408 DISALLOW_COPY_AND_ASSIGN(TransitionElementsKindStub); | 1447 DISALLOW_COPY_AND_ASSIGN(TransitionElementsKindStub); |
| 1409 }; | 1448 }; |
| 1410 | 1449 |
| 1411 | 1450 |
| 1412 class ArrayNoArgumentConstructorStub : public HydrogenCodeStub { | 1451 class ArrayNoArgumentConstructorStub : public HydrogenCodeStub { |
| 1413 public: | 1452 public: |
| 1414 ArrayNoArgumentConstructorStub() { | 1453 ArrayNoArgumentConstructorStub() |
| 1454 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS) { | |
| 1415 } | 1455 } |
| 1416 | 1456 |
| 1417 Major MajorKey() { return ArrayNoArgumentConstructor; } | |
| 1418 int MinorKey() { return 0; } | |
| 1419 | |
| 1420 virtual Handle<Code> GenerateCode(); | 1457 virtual Handle<Code> GenerateCode(); |
| 1421 | 1458 |
| 1422 virtual void InitializeInterfaceDescriptor( | 1459 virtual void InitializeInterfaceDescriptor( |
| 1423 Isolate* isolate, | 1460 Isolate* isolate, |
| 1424 CodeStubInterfaceDescriptor* descriptor); | 1461 CodeStubInterfaceDescriptor* descriptor); |
| 1425 | 1462 |
| 1426 private: | 1463 private: |
| 1464 Major MajorKey() { return ArrayNoArgumentConstructor; } | |
| 1465 int NotMissMinorKey() { return 0; } | |
| 1466 | |
| 1427 DISALLOW_COPY_AND_ASSIGN(ArrayNoArgumentConstructorStub); | 1467 DISALLOW_COPY_AND_ASSIGN(ArrayNoArgumentConstructorStub); |
| 1428 }; | 1468 }; |
| 1429 | 1469 |
| 1430 | 1470 |
| 1431 class ArraySingleArgumentConstructorStub : public HydrogenCodeStub { | 1471 class ArraySingleArgumentConstructorStub : public HydrogenCodeStub { |
| 1432 public: | 1472 public: |
| 1433 ArraySingleArgumentConstructorStub() { | 1473 ArraySingleArgumentConstructorStub() |
| 1434 } | 1474 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS) {} |
| 1435 | |
| 1436 Major MajorKey() { return ArraySingleArgumentConstructor; } | |
| 1437 int MinorKey() { return 0; } | |
| 1438 | 1475 |
| 1439 virtual Handle<Code> GenerateCode(); | 1476 virtual Handle<Code> GenerateCode(); |
| 1440 | 1477 |
| 1441 virtual void InitializeInterfaceDescriptor( | 1478 virtual void InitializeInterfaceDescriptor( |
| 1442 Isolate* isolate, | 1479 Isolate* isolate, |
| 1443 CodeStubInterfaceDescriptor* descriptor); | 1480 CodeStubInterfaceDescriptor* descriptor); |
| 1444 | 1481 |
| 1445 private: | 1482 private: |
| 1483 Major MajorKey() { return ArraySingleArgumentConstructor; } | |
| 1484 int NotMissMinorKey() { return 0; } | |
| 1485 | |
| 1446 DISALLOW_COPY_AND_ASSIGN(ArraySingleArgumentConstructorStub); | 1486 DISALLOW_COPY_AND_ASSIGN(ArraySingleArgumentConstructorStub); |
| 1447 }; | 1487 }; |
| 1448 | 1488 |
| 1449 | 1489 |
| 1450 class ArrayNArgumentsConstructorStub : public HydrogenCodeStub { | 1490 class ArrayNArgumentsConstructorStub : public HydrogenCodeStub { |
| 1451 public: | 1491 public: |
| 1452 ArrayNArgumentsConstructorStub() { | 1492 ArrayNArgumentsConstructorStub() |
| 1453 } | 1493 : HydrogenCodeStub(CODE_STUB_IS_NOT_MISS) {} |
| 1454 | |
| 1455 Major MajorKey() { return ArrayNArgumentsConstructor; } | |
| 1456 int MinorKey() { return 0; } | |
| 1457 | 1494 |
| 1458 virtual Handle<Code> GenerateCode(); | 1495 virtual Handle<Code> GenerateCode(); |
| 1459 | 1496 |
| 1460 virtual void InitializeInterfaceDescriptor( | 1497 virtual void InitializeInterfaceDescriptor( |
| 1461 Isolate* isolate, | 1498 Isolate* isolate, |
| 1462 CodeStubInterfaceDescriptor* descriptor); | 1499 CodeStubInterfaceDescriptor* descriptor); |
| 1463 | 1500 |
| 1464 private: | 1501 private: |
| 1502 Major MajorKey() { return ArrayNArgumentsConstructor; } | |
| 1503 int NotMissMinorKey() { return 0; } | |
| 1504 | |
| 1465 DISALLOW_COPY_AND_ASSIGN(ArrayNArgumentsConstructorStub); | 1505 DISALLOW_COPY_AND_ASSIGN(ArrayNArgumentsConstructorStub); |
| 1466 }; | 1506 }; |
| 1467 | 1507 |
| 1468 | 1508 |
| 1469 class KeyedStoreElementStub : public PlatformCodeStub { | 1509 class KeyedStoreElementStub : public PlatformCodeStub { |
| 1470 public: | 1510 public: |
| 1471 KeyedStoreElementStub(bool is_js_array, | 1511 KeyedStoreElementStub(bool is_js_array, |
| 1472 ElementsKind elements_kind, | 1512 ElementsKind elements_kind, |
| 1473 KeyedAccessStoreMode store_mode) | 1513 KeyedAccessStoreMode store_mode) |
| 1474 : is_js_array_(is_js_array), | 1514 : is_js_array_(is_js_array), |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1688 | 1728 |
| 1689 // The current function entry hook. | 1729 // The current function entry hook. |
| 1690 static FunctionEntryHook entry_hook_; | 1730 static FunctionEntryHook entry_hook_; |
| 1691 | 1731 |
| 1692 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 1732 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
| 1693 }; | 1733 }; |
| 1694 | 1734 |
| 1695 } } // namespace v8::internal | 1735 } } // namespace v8::internal |
| 1696 | 1736 |
| 1697 #endif // V8_CODE_STUBS_H_ | 1737 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |