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 3314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3325 Handle<FixedArray> result = Factory::NewFixedArray(2, TENURED); | 3325 Handle<FixedArray> result = Factory::NewFixedArray(2, TENURED); |
3326 ObjectLiteral* object_literal = expression->AsObjectLiteral(); | 3326 ObjectLiteral* object_literal = expression->AsObjectLiteral(); |
3327 if (object_literal != NULL) { | 3327 if (object_literal != NULL) { |
3328 ASSERT(object_literal->is_simple()); | 3328 ASSERT(object_literal->is_simple()); |
3329 result->set(kTypeSlot, Smi::FromInt(OBJECT_LITERAL)); | 3329 result->set(kTypeSlot, Smi::FromInt(OBJECT_LITERAL)); |
3330 result->set(kElementsSlot, *object_literal->constant_properties()); | 3330 result->set(kElementsSlot, *object_literal->constant_properties()); |
3331 } else { | 3331 } else { |
3332 ArrayLiteral* array_literal = expression->AsArrayLiteral(); | 3332 ArrayLiteral* array_literal = expression->AsArrayLiteral(); |
3333 ASSERT(array_literal != NULL && array_literal->is_simple()); | 3333 ASSERT(array_literal != NULL && array_literal->is_simple()); |
3334 result->set(kTypeSlot, Smi::FromInt(ARRAY_LITERAL)); | 3334 result->set(kTypeSlot, Smi::FromInt(ARRAY_LITERAL)); |
3335 result->set(kElementsSlot, *array_literal->literals()); | 3335 result->set(kElementsSlot, *array_literal->constant_elements()); |
3336 } | 3336 } |
3337 return result; | 3337 return result; |
3338 } | 3338 } |
3339 | 3339 |
3340 | 3340 |
3341 CompileTimeValue::Type CompileTimeValue::GetType(Handle<FixedArray> value) { | 3341 CompileTimeValue::Type CompileTimeValue::GetType(Handle<FixedArray> value) { |
3342 Smi* type_value = Smi::cast(value->get(kTypeSlot)); | 3342 Smi* type_value = Smi::cast(value->get(kTypeSlot)); |
3343 return static_cast<Type>(type_value->value()); | 3343 return static_cast<Type>(type_value->value()); |
3344 } | 3344 } |
3345 | 3345 |
(...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4790 start_position, | 4790 start_position, |
4791 is_expression); | 4791 is_expression); |
4792 return result; | 4792 return result; |
4793 } | 4793 } |
4794 | 4794 |
4795 | 4795 |
4796 #undef NEW | 4796 #undef NEW |
4797 | 4797 |
4798 | 4798 |
4799 } } // namespace v8::internal | 4799 } } // namespace v8::internal |
OLD | NEW |