| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 17 matching lines...) Expand all Loading... |
| 28 #include "v8.h" | 28 #include "v8.h" |
| 29 | 29 |
| 30 #include "api.h" | 30 #include "api.h" |
| 31 #include "arguments.h" | 31 #include "arguments.h" |
| 32 #include "bootstrapper.h" | 32 #include "bootstrapper.h" |
| 33 #include "debug.h" | 33 #include "debug.h" |
| 34 #include "execution.h" | 34 #include "execution.h" |
| 35 #include "objects-inl.h" | 35 #include "objects-inl.h" |
| 36 #include "objects-visiting.h" | 36 #include "objects-visiting.h" |
| 37 #include "macro-assembler.h" | 37 #include "macro-assembler.h" |
| 38 #include "scanner.h" | 38 #include "scanner-base.h" |
| 39 #include "scopeinfo.h" | 39 #include "scopeinfo.h" |
| 40 #include "string-stream.h" | 40 #include "string-stream.h" |
| 41 #include "utils.h" | 41 #include "utils.h" |
| 42 | 42 |
| 43 #ifdef ENABLE_DISASSEMBLER | 43 #ifdef ENABLE_DISASSEMBLER |
| 44 #include "disassembler.h" | 44 #include "disassembler.h" |
| 45 #endif | 45 #endif |
| 46 | 46 |
| 47 | 47 |
| 48 namespace v8 { | 48 namespace v8 { |
| (...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 return FastPropertyAtPut(index, value); | 1201 return FastPropertyAtPut(index, value); |
| 1202 } | 1202 } |
| 1203 | 1203 |
| 1204 | 1204 |
| 1205 MaybeObject* JSObject::AddFastProperty(String* name, | 1205 MaybeObject* JSObject::AddFastProperty(String* name, |
| 1206 Object* value, | 1206 Object* value, |
| 1207 PropertyAttributes attributes) { | 1207 PropertyAttributes attributes) { |
| 1208 // Normalize the object if the name is an actual string (not the | 1208 // Normalize the object if the name is an actual string (not the |
| 1209 // hidden symbols) and is not a real identifier. | 1209 // hidden symbols) and is not a real identifier. |
| 1210 StringInputBuffer buffer(name); | 1210 StringInputBuffer buffer(name); |
| 1211 if (!Scanner::IsIdentifier(&buffer) && name != Heap::hidden_symbol()) { | 1211 if (!ScannerConstants::IsIdentifier(&buffer) |
| 1212 && name != Heap::hidden_symbol()) { |
| 1212 Object* obj; | 1213 Object* obj; |
| 1213 { MaybeObject* maybe_obj = | 1214 { MaybeObject* maybe_obj = |
| 1214 NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0); | 1215 NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0); |
| 1215 if (!maybe_obj->ToObject(&obj)) return maybe_obj; | 1216 if (!maybe_obj->ToObject(&obj)) return maybe_obj; |
| 1216 } | 1217 } |
| 1217 return AddSlowProperty(name, value, attributes); | 1218 return AddSlowProperty(name, value, attributes); |
| 1218 } | 1219 } |
| 1219 | 1220 |
| 1220 DescriptorArray* old_descriptors = map()->instance_descriptors(); | 1221 DescriptorArray* old_descriptors = map()->instance_descriptors(); |
| 1221 // Compute the new index for new field. | 1222 // Compute the new index for new field. |
| (...skipping 3859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5081 this->set_map(Heap::undetectable_ascii_string_map()); | 5082 this->set_map(Heap::undetectable_ascii_string_map()); |
| 5082 return true; | 5083 return true; |
| 5083 } | 5084 } |
| 5084 // Rest cannot be marked as undetectable | 5085 // Rest cannot be marked as undetectable |
| 5085 return false; | 5086 return false; |
| 5086 } | 5087 } |
| 5087 | 5088 |
| 5088 | 5089 |
| 5089 bool String::IsEqualTo(Vector<const char> str) { | 5090 bool String::IsEqualTo(Vector<const char> str) { |
| 5090 int slen = length(); | 5091 int slen = length(); |
| 5091 Access<Scanner::Utf8Decoder> decoder(Scanner::utf8_decoder()); | 5092 Access<ScannerConstants::Utf8Decoder> |
| 5093 decoder(ScannerConstants::utf8_decoder()); |
| 5092 decoder->Reset(str.start(), str.length()); | 5094 decoder->Reset(str.start(), str.length()); |
| 5093 int i; | 5095 int i; |
| 5094 for (i = 0; i < slen && decoder->has_more(); i++) { | 5096 for (i = 0; i < slen && decoder->has_more(); i++) { |
| 5095 uc32 r = decoder->GetNext(); | 5097 uc32 r = decoder->GetNext(); |
| 5096 if (Get(i) != r) return false; | 5098 if (Get(i) != r) return false; |
| 5097 } | 5099 } |
| 5098 return i == slen && !decoder->has_more(); | 5100 return i == slen && !decoder->has_more(); |
| 5099 } | 5101 } |
| 5100 | 5102 |
| 5101 | 5103 |
| (...skipping 4243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9345 if (break_point_objects()->IsUndefined()) return 0; | 9347 if (break_point_objects()->IsUndefined()) return 0; |
| 9346 // Single beak point. | 9348 // Single beak point. |
| 9347 if (!break_point_objects()->IsFixedArray()) return 1; | 9349 if (!break_point_objects()->IsFixedArray()) return 1; |
| 9348 // Multiple break points. | 9350 // Multiple break points. |
| 9349 return FixedArray::cast(break_point_objects())->length(); | 9351 return FixedArray::cast(break_point_objects())->length(); |
| 9350 } | 9352 } |
| 9351 #endif | 9353 #endif |
| 9352 | 9354 |
| 9353 | 9355 |
| 9354 } } // namespace v8::internal | 9356 } } // namespace v8::internal |
| OLD | NEW |