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

Side by Side Diff: src/objects-inl.h

Issue 10701054: Enable stub generation using Hydrogen/Lithium (again) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 8 years 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
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 3214 matching lines...) Expand 10 before | Expand all | Expand 10 after
3225 3225
3226 3226
3227 int Code::arguments_count() { 3227 int Code::arguments_count() {
3228 ASSERT(is_call_stub() || is_keyed_call_stub() || kind() == STUB); 3228 ASSERT(is_call_stub() || is_keyed_call_stub() || kind() == STUB);
3229 return ExtractArgumentsCountFromFlags(flags()); 3229 return ExtractArgumentsCountFromFlags(flags());
3230 } 3230 }
3231 3231
3232 3232
3233 int Code::major_key() { 3233 int Code::major_key() {
3234 ASSERT(kind() == STUB || 3234 ASSERT(kind() == STUB ||
3235 kind() == COMPILED_STUB ||
3235 kind() == UNARY_OP_IC || 3236 kind() == UNARY_OP_IC ||
3236 kind() == BINARY_OP_IC || 3237 kind() == BINARY_OP_IC ||
3237 kind() == COMPARE_IC || 3238 kind() == COMPARE_IC ||
3238 kind() == TO_BOOLEAN_IC); 3239 kind() == TO_BOOLEAN_IC);
3239 return StubMajorKeyField::decode( 3240 return StubMajorKeyField::decode(
3240 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset)); 3241 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset));
3241 } 3242 }
3242 3243
3243 3244
3244 void Code::set_major_key(int major) { 3245 void Code::set_major_key(int major) {
3245 ASSERT(kind() == STUB || 3246 ASSERT(kind() == STUB ||
3247 kind() == COMPILED_STUB ||
3246 kind() == UNARY_OP_IC || 3248 kind() == UNARY_OP_IC ||
3247 kind() == BINARY_OP_IC || 3249 kind() == BINARY_OP_IC ||
3248 kind() == COMPARE_IC || 3250 kind() == COMPARE_IC ||
3249 kind() == TO_BOOLEAN_IC); 3251 kind() == TO_BOOLEAN_IC);
3250 ASSERT(0 <= major && major < 256); 3252 ASSERT(0 <= major && major < 256);
3251 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); 3253 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset);
3252 int updated = StubMajorKeyField::update(previous, major); 3254 int updated = StubMajorKeyField::update(previous, major);
3253 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); 3255 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated);
3254 } 3256 }
3255 3257
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
3344 3346
3345 3347
3346 void Code::set_profiler_ticks(int ticks) { 3348 void Code::set_profiler_ticks(int ticks) {
3347 ASSERT_EQ(FUNCTION, kind()); 3349 ASSERT_EQ(FUNCTION, kind());
3348 ASSERT(ticks < 256); 3350 ASSERT(ticks < 256);
3349 WRITE_BYTE_FIELD(this, kProfilerTicksOffset, ticks); 3351 WRITE_BYTE_FIELD(this, kProfilerTicksOffset, ticks);
3350 } 3352 }
3351 3353
3352 3354
3353 unsigned Code::stack_slots() { 3355 unsigned Code::stack_slots() {
3354 ASSERT(kind() == OPTIMIZED_FUNCTION); 3356 ASSERT(kind() == OPTIMIZED_FUNCTION || kind() == COMPILED_STUB);
3355 return StackSlotsField::decode( 3357 return StackSlotsField::decode(
3356 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); 3358 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset));
3357 } 3359 }
3358 3360
3359 3361
3360 void Code::set_stack_slots(unsigned slots) { 3362 void Code::set_stack_slots(unsigned slots) {
3361 CHECK(slots <= (1 << kStackSlotsBitCount)); 3363 CHECK(slots <= (1 << kStackSlotsBitCount));
3362 ASSERT(kind() == OPTIMIZED_FUNCTION); 3364 ASSERT(kind() == OPTIMIZED_FUNCTION || kind() == COMPILED_STUB);
3363 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); 3365 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset);
3364 int updated = StackSlotsField::update(previous, slots); 3366 int updated = StackSlotsField::update(previous, slots);
3365 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); 3367 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated);
3366 } 3368 }
3367 3369
3368 3370
3369 unsigned Code::safepoint_table_offset() { 3371 unsigned Code::safepoint_table_offset() {
3370 ASSERT(kind() == OPTIMIZED_FUNCTION); 3372 ASSERT(kind() == OPTIMIZED_FUNCTION || kind() == COMPILED_STUB);
3371 return SafepointTableOffsetField::decode( 3373 return SafepointTableOffsetField::decode(
3372 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset)); 3374 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset));
3373 } 3375 }
3374 3376
3375 3377
3376 void Code::set_safepoint_table_offset(unsigned offset) { 3378 void Code::set_safepoint_table_offset(unsigned offset) {
3377 CHECK(offset <= (1 << kSafepointTableOffsetBitCount)); 3379 CHECK(offset <= (1 << kSafepointTableOffsetBitCount));
3378 ASSERT(kind() == OPTIMIZED_FUNCTION); 3380 ASSERT(kind() == OPTIMIZED_FUNCTION || kind() == COMPILED_STUB);
3379 ASSERT(IsAligned(offset, static_cast<unsigned>(kIntSize))); 3381 ASSERT(IsAligned(offset, static_cast<unsigned>(kIntSize)));
3380 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); 3382 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset);
3381 int updated = SafepointTableOffsetField::update(previous, offset); 3383 int updated = SafepointTableOffsetField::update(previous, offset);
3382 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); 3384 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated);
3383 } 3385 }
3384 3386
3385 3387
3386 unsigned Code::stack_check_table_offset() { 3388 unsigned Code::stack_check_table_offset() {
3387 ASSERT_EQ(FUNCTION, kind()); 3389 ASSERT_EQ(FUNCTION, kind());
3388 return StackCheckTableOffsetField::decode( 3390 return StackCheckTableOffsetField::decode(
(...skipping 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after
5552 #undef WRITE_UINT32_FIELD 5554 #undef WRITE_UINT32_FIELD
5553 #undef READ_SHORT_FIELD 5555 #undef READ_SHORT_FIELD
5554 #undef WRITE_SHORT_FIELD 5556 #undef WRITE_SHORT_FIELD
5555 #undef READ_BYTE_FIELD 5557 #undef READ_BYTE_FIELD
5556 #undef WRITE_BYTE_FIELD 5558 #undef WRITE_BYTE_FIELD
5557 5559
5558 5560
5559 } } // namespace v8::internal 5561 } } // namespace v8::internal
5560 5562
5561 #endif // V8_OBJECTS_INL_H_ 5563 #endif // V8_OBJECTS_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698