OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 JSObject* object, | 355 JSObject* object, |
356 int index, | 356 int index, |
357 Map* transition, | 357 Map* transition, |
358 Register receiver_reg, | 358 Register receiver_reg, |
359 Register name_reg, | 359 Register name_reg, |
360 Register scratch, | 360 Register scratch, |
361 Label* miss_label); | 361 Label* miss_label); |
362 static void GenerateLoadMiss(MacroAssembler* masm, Code::Kind kind); | 362 static void GenerateLoadMiss(MacroAssembler* masm, Code::Kind kind); |
363 | 363 |
364 protected: | 364 protected: |
365 Object* GetCodeWithFlags(Code::Flags flags); | 365 Object* GetCodeWithFlags(Code::Flags flags, char* name); |
| 366 Object* GetCodeWithFlags(Code::Flags flags, String* name); |
366 | 367 |
367 MacroAssembler* masm() { return &masm_; } | 368 MacroAssembler* masm() { return &masm_; } |
368 | 369 |
369 private: | 370 private: |
370 HandleScope scope_; | 371 HandleScope scope_; |
371 MacroAssembler masm_; | 372 MacroAssembler masm_; |
372 }; | 373 }; |
373 | 374 |
374 | 375 |
375 class LoadStubCompiler: public StubCompiler { | 376 class LoadStubCompiler: public StubCompiler { |
376 public: | 377 public: |
377 Object* CompileLoadField(JSObject* object, JSObject* holder, int index); | 378 Object* CompileLoadField(JSObject* object, |
| 379 JSObject* holder, |
| 380 int index, |
| 381 String* name); |
378 Object* CompileLoadCallback(JSObject* object, | 382 Object* CompileLoadCallback(JSObject* object, |
379 JSObject* holder, | 383 JSObject* holder, |
380 AccessorInfo* callback); | 384 AccessorInfo* callback, |
| 385 String* name); |
381 Object* CompileLoadConstant(JSObject* object, | 386 Object* CompileLoadConstant(JSObject* object, |
382 JSObject* holder, | 387 JSObject* holder, |
383 Object* value); | 388 Object* value, |
| 389 String* name); |
384 Object* CompileLoadInterceptor(JSObject* object, | 390 Object* CompileLoadInterceptor(JSObject* object, |
385 JSObject* holder, | 391 JSObject* holder, |
386 String* name); | 392 String* name); |
387 | 393 |
388 private: | 394 private: |
389 Object* GetCode(PropertyType); | 395 Object* GetCode(PropertyType type, String* name); |
390 }; | 396 }; |
391 | 397 |
392 | 398 |
393 class KeyedLoadStubCompiler: public StubCompiler { | 399 class KeyedLoadStubCompiler: public StubCompiler { |
394 public: | 400 public: |
395 Object* CompileLoadField(String* name, | 401 Object* CompileLoadField(String* name, |
396 JSObject* object, | 402 JSObject* object, |
397 JSObject* holder, | 403 JSObject* holder, |
398 int index); | 404 int index); |
399 Object* CompileLoadCallback(String* name, | 405 Object* CompileLoadCallback(String* name, |
400 JSObject* object, | 406 JSObject* object, |
401 JSObject* holder, | 407 JSObject* holder, |
402 AccessorInfo* callback); | 408 AccessorInfo* callback); |
403 Object* CompileLoadConstant(String* name, | 409 Object* CompileLoadConstant(String* name, |
404 JSObject* object, | 410 JSObject* object, |
405 JSObject* holder, | 411 JSObject* holder, |
406 Object* value); | 412 Object* value); |
407 Object* CompileLoadInterceptor(JSObject* object, | 413 Object* CompileLoadInterceptor(JSObject* object, |
408 JSObject* holder, | 414 JSObject* holder, |
409 String* name); | 415 String* name); |
410 Object* CompileLoadArrayLength(String* name); | 416 Object* CompileLoadArrayLength(String* name); |
411 Object* CompileLoadStringLength(String* name); | 417 Object* CompileLoadStringLength(String* name); |
412 Object* CompileLoadFunctionPrototype(String* name); | 418 Object* CompileLoadFunctionPrototype(String* name); |
413 | 419 |
414 private: | 420 private: |
415 Object* GetCode(PropertyType); | 421 Object* GetCode(PropertyType type, String* name); |
416 }; | 422 }; |
417 | 423 |
418 | 424 |
419 class StoreStubCompiler: public StubCompiler { | 425 class StoreStubCompiler: public StubCompiler { |
420 public: | 426 public: |
421 Object* CompileStoreField(JSObject* object, | 427 Object* CompileStoreField(JSObject* object, |
422 int index, | 428 int index, |
423 Map* transition, | 429 Map* transition, |
424 String* name); | 430 String* name); |
425 Object* CompileStoreCallback(JSObject* object, | 431 Object* CompileStoreCallback(JSObject* object, |
426 AccessorInfo* callbacks, | 432 AccessorInfo* callbacks, |
427 String* name); | 433 String* name); |
428 Object* CompileStoreInterceptor(JSObject* object, String* name); | 434 Object* CompileStoreInterceptor(JSObject* object, String* name); |
429 | 435 |
430 private: | 436 private: |
431 Object* GetCode(PropertyType type); | 437 Object* GetCode(PropertyType type, String* name); |
432 }; | 438 }; |
433 | 439 |
434 | 440 |
435 class KeyedStoreStubCompiler: public StubCompiler { | 441 class KeyedStoreStubCompiler: public StubCompiler { |
436 public: | 442 public: |
437 Object* CompileStoreField(JSObject* object, | 443 Object* CompileStoreField(JSObject* object, |
438 int index, | 444 int index, |
439 Map* transition, | 445 Map* transition, |
440 String* name); | 446 String* name); |
441 | 447 |
442 private: | 448 private: |
443 Object* GetCode(PropertyType type); | 449 Object* GetCode(PropertyType type, String* name); |
444 }; | 450 }; |
445 | 451 |
446 | 452 |
447 class CallStubCompiler: public StubCompiler { | 453 class CallStubCompiler: public StubCompiler { |
448 public: | 454 public: |
449 explicit CallStubCompiler(int argc) : arguments_(argc) { } | 455 explicit CallStubCompiler(int argc) : arguments_(argc) { } |
450 | 456 |
451 Object* CompileCallField(Object* object, JSObject* holder, int index); | 457 Object* CompileCallField(Object* object, |
| 458 JSObject* holder, |
| 459 int index, |
| 460 String* name); |
452 Object* CompileCallConstant(Object* object, | 461 Object* CompileCallConstant(Object* object, |
453 JSObject* holder, | 462 JSObject* holder, |
454 JSFunction* function, | 463 JSFunction* function, |
455 CheckType check); | 464 CheckType check); |
456 Object* CompileCallInterceptor(Object* object, | 465 Object* CompileCallInterceptor(Object* object, |
457 JSObject* holder, | 466 JSObject* holder, |
458 String* name); | 467 String* name); |
459 | 468 |
460 private: | 469 private: |
461 const ParameterCount arguments_; | 470 const ParameterCount arguments_; |
462 | 471 |
463 const ParameterCount& arguments() { return arguments_; } | 472 const ParameterCount& arguments() { return arguments_; } |
464 | 473 |
465 Object* GetCode(PropertyType type); | 474 Object* GetCode(PropertyType type, String* name); |
466 }; | 475 }; |
467 | 476 |
468 | 477 |
469 } } // namespace v8::internal | 478 } } // namespace v8::internal |
470 | 479 |
471 #endif // V8_STUB_CACHE_H_ | 480 #endif // V8_STUB_CACHE_H_ |
OLD | NEW |